On Tue, 22 Nov 2022 12:35:56 -1000
Bryan Angelo <bang...@gmail.com> wrote:

> Related follow up.
> 
> When I add memory to a running VM via hotplug, QEMU preallocates this
> memory too (as expected based on your explanation).  When I subsequently
> remove memory added to the VM via hotplug, QEMU does not always appear to
> free the underlying memory.
> 
> For example:
> 
>         -m 8G,slots=1,maxmem=12G
> 
> QEMU using 8G, VM shows 8G total.
> 
>         object_add memory-backend-ram,id=mem1,size=4G
>         device_add pc-dimm,id=dimm1,memdev=mem1
> 
> QEMU using 12G, VM shows 12G total.
> 
> After using the VM for a bit:
> 
>         device_del dimm1
>         object_del mem1
> 
> QEMU using 12G, VM shows 8G total.
> 
> Does it just so happen that the VFIO device is using memory that QEMU
> allocated/pinned for the hotplug device and therefore QEMU cannot free it?
> Or is there something else going on here?

Is this a Windows guest?  Hot adding memory is easy, hot removing it is
much more difficult.  I'm under the impression that Windows doesn't
actually support hot-remove.  For example, what happens if you try to
added it again?  Is the slot still in use?  Does memory size increase
by another 4G?  Thanks,

Alex

_______________________________________________
vfio-users mailing list
vfio-users@redhat.com
https://listman.redhat.com/mailman/listinfo/vfio-users

Reply via email to