From: David Hildenbrand Date: Tue, 16 Apr 2024 14:14:26 +0000 (+0200) Subject: virtio-mem: improve error message when unplug of device fails due to plugged memory X-Git-Tag: v9.1.0-rc0~39^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d13ae45ff93fa825ceb39dfd16b305f4baccd18;p=thirdparty%2Fqemu.git virtio-mem: improve error message when unplug of device fails due to plugged memory The error message is actually expressive, considering QEMU only. But when called from Libvirt, talking about "size" can be confusing, because in Libvirt "size" translates to the memory backend size in QEMU (maximum size) and "current" translates to the QEMU "size" property. Let's simply avoid talking about the "size" property and spell out that some device memory is still plugged. Message-ID: <20240416141426.588544-1-david@redhat.com> Tested-by: Mario Casquero Cc: Liang Cong Cc: Mario Casquero Cc: "Michael S. Tsirkin" Signed-off-by: David Hildenbrand --- diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c index ffd119ebacb..ef64bf1b4a1 100644 --- a/hw/virtio/virtio-mem.c +++ b/hw/virtio/virtio-mem.c @@ -1832,8 +1832,8 @@ static void virtio_mem_unplug_request_check(VirtIOMEM *vmem, Error **errp) } if (vmem->size) { - error_setg(errp, "virtio-mem device cannot get unplugged while" - " '" VIRTIO_MEM_SIZE_PROP "' != '0'"); + error_setg(errp, "virtio-mem device cannot get unplugged while some" + " of its memory is still plugged"); return; } if (vmem->requested_size) {