On Tue, 30 Jun 2015 15:56:13 +0200 Eduardo Otubo <eduardo.ot...@profitbricks.com> wrote:
> On Tue, Jun 30, 2015 at 11=18=21AM +0200, Igor Mammedov wrote: > > On Tue, 30 Jun 2015 10:07:52 +0200 > > Eduardo Otubo <eduardo.ot...@profitbricks.com> wrote: > > > > > Hello all, > > > > > > I compiled the HEAD of the master branch and was testing memory > > > hotunplug and got to this issue. Note: I followed exactly what's > > > written on the docs/memory-hotplug.txt file. > > > > > > QEMU 2.3.50 monitor - type 'help' for more information > > > (qemu) object_add memory-backend-ram,id=mem1,size=1G > > > object_add memory-backend-ram,id=mem1,size=1G > > > (qemu) device_add pc-dimm,id=dimm1,memdev=mem1 > > > device_add pc-dimm,id=dimm1,memdev=mem1 > > > (qemu) device_del dimm1 > > > device_del dimm1 > > > (qemu) object_del mem1 > > > object_del mem1 > > > mem1 is in use, can not be deleted > > > > probably because dimm1 isn't deleted, > > you can check it in monitor using command "info memory-devices" > > Yes, you're right. The reason is surely because dimm1 wasn't deleted > -- and I think I didn't make my point very clear -- my question was > more about: Is there any reason for dimm1 not being deleted? The > reason why I tested with the guest OS fully running and on GRUB is > because I guessed the guest OS was using this memory and couldn't be > deallocated. If that's the case, and qemu did a best effort to remove > and couldn't because guest was using it, then Ok, I just need to > adapt my tests. Other than that perhaps I hit a bug. Guest OS has to: 1. support memory hot remove 2. eject memory device using ACPI _EJ0 method, once it has handled removal request, provided it is able to free corresponding memory pages See docs they should have flows described for success and failure case. If you are creating tests, it would be nice if you could integrate them into QEMU's 'make check' infrastructure. That could be hard to do for a full guest OS setup but it should be easier to implement using MMIO interface QEMU exposes and simulating ACPI part of memory hotplug in tests. It's not full coverage but it will provide regression testing for the most parts of related code (sans ACPI parts). > > Regards, >