* [PATCH v1] virtio-mem: improve error message when unplug of device fails due to plugged memory
@ 2024-04-16 14:14 David Hildenbrand
2024-04-26 7:50 ` Mario Casquero
0 siblings, 1 reply; 2+ messages in thread
From: David Hildenbrand @ 2024-04-16 14:14 UTC (permalink / raw)
To: qemu-devel
Cc: David Hildenbrand, Liang Cong, Mario Casquero, Michael S. Tsirkin
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.
Cc: Liang Cong <lcong@redhat.com>
Cc: Mario Casquero <mcasquer@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
---
hw/virtio/virtio-mem.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c
index ffd119ebac..ef64bf1b4a 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) {
--
2.44.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v1] virtio-mem: improve error message when unplug of device fails due to plugged memory
2024-04-16 14:14 [PATCH v1] virtio-mem: improve error message when unplug of device fails due to plugged memory David Hildenbrand
@ 2024-04-26 7:50 ` Mario Casquero
0 siblings, 0 replies; 2+ messages in thread
From: Mario Casquero @ 2024-04-26 7:50 UTC (permalink / raw)
To: David Hildenbrand; +Cc: qemu-devel, Liang Cong, Michael S. Tsirkin
This patch has been successfully tested. Boot up a VM with a
virtio-mem device, hotplug some memory increasing the requested-size,
finally try to unplug the device and see the new message:
(qemu) device_del vmem0
Error: virtio-mem device cannot get unplugged while some of its memory
is still plugged
Tested-by: Mario Casquero <mcasquer@redhat.com>
On Tue, Apr 16, 2024 at 4:14 PM David Hildenbrand <david@redhat.com> wrote:
>
> 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.
>
> Cc: Liang Cong <lcong@redhat.com>
> Cc: Mario Casquero <mcasquer@redhat.com>
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
> hw/virtio/virtio-mem.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c
> index ffd119ebac..ef64bf1b4a 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) {
> --
> 2.44.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-04-26 7:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-16 14:14 [PATCH v1] virtio-mem: improve error message when unplug of device fails due to plugged memory David Hildenbrand
2024-04-26 7:50 ` Mario Casquero
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).