- hw/virtio/virtio-pmem: Replace impossible check by assertion - tests: Fix printf format string in acpi-utils.c - softmmu/dirtylimit: Add parameter check for hmp "set_vcpu_dirty_limit" - disas/riscv: Fix the typo of inverted order of pmpaddr13 and pmpaddr14 - qga: Fix memory leak when output stream is unused - ui/vnc-clipboard: fix infinite loop in inflate_buffer (CVE-2023-3255) - target/i386: Add few security fix bits in ARCH_CAPABILITIES into SapphireRapids CPU model - target/i386: Add new bit definitions of MSR_IA32_ARCH_CAPABILITIES - target/i386: Allow MCDT_NO if host supports - target/i386: Add support for MCDT_NO in CPUID enumeration - target/i386: Export MSR_ARCH_CAPABILITIES bits to guests - target/i386: add support for FB_CLEAR feature - target/i386: add support for FLUSH_L1D feature - crypto: remove shadowed 'ret' variable - hw/i2c/pmbus_device: Fix modifying QOM class internals from instance - hw/arm/xlnx-zynqmp: fix unsigned error when checking the RPUs number Signed-off-by: Jiabo Feng <fengjiabo1@huawei.com>
46 lines
1.6 KiB
Diff
46 lines
1.6 KiB
Diff
From 12eed71f72cbb5d81b14f66fde254058f121979a Mon Sep 17 00:00:00 2001
|
|
From: qihao <qihao_yewu@cmss.chinamobile.com>
|
|
Date: Wed, 25 Oct 2023 17:44:42 +0800
|
|
Subject: [PATCH] hw/virtio/virtio-pmem: Replace impossible check by assertion
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
cheery-pick from 184256d261cfc773360f14a80092ace5a716bb8f
|
|
|
|
The get_memory_region() handler is used when (un)plugging the
|
|
device, which can only occur *after* it is realized.
|
|
|
|
virtio_pmem_realize() ensure the instance can not be realized
|
|
without 'memdev'. Remove the superfluous check, replacing it
|
|
by an assertion.
|
|
|
|
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
|
|
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
|
|
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
|
|
Message-Id: <20231017140150.44995-2-philmd@linaro.org>
|
|
Signed-off-by: qihao_yewu <qihao_yewu@cmss.chinamobile.com>
|
|
---
|
|
hw/virtio/virtio-pmem.c | 5 +----
|
|
1 file changed, 1 insertion(+), 4 deletions(-)
|
|
|
|
diff --git a/hw/virtio/virtio-pmem.c b/hw/virtio/virtio-pmem.c
|
|
index d1aeb90a31..39f3949a3b 100644
|
|
--- a/hw/virtio/virtio-pmem.c
|
|
+++ b/hw/virtio/virtio-pmem.c
|
|
@@ -149,10 +149,7 @@ static void virtio_pmem_fill_device_info(const VirtIOPMEM *pmem,
|
|
static MemoryRegion *virtio_pmem_get_memory_region(VirtIOPMEM *pmem,
|
|
Error **errp)
|
|
{
|
|
- if (!pmem->memdev) {
|
|
- error_setg(errp, "'%s' property must be set", VIRTIO_PMEM_MEMDEV_PROP);
|
|
- return NULL;
|
|
- }
|
|
+ assert(pmem->memdev);
|
|
|
|
return &pmem->memdev->mr;
|
|
}
|
|
--
|
|
2.41.0.windows.1
|
|
|