Libvirt provides full path to the backing file since commit
fec8f9c49afb479f6. This made qemu create the backend object but did not
delete it. This was fixed for unplug case in 4d83a6722f but not in case
of failure to hotplug the frontend. We'd leave the files behind which
would make memory unusable in case of hugepages.
https://bugzilla.redhat.com/show_bug.cgi?id=1553085
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
src/qemu/qemu_hotplug.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index cff40625f8..70325a1246 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -2219,6 +2219,10 @@ qemuDomainAttachMemory(virQEMUDriverPtr driver,
if (!mem)
goto audit;
+ /* we need to remove the memory backing file so that it does not hog memory */
+ if (objAdded)
+ ignore_value(qemuProcessDestroyMemoryBackingPath(driver, vm, mem));
+
removedef:
if ((id = virDomainMemoryFindByDef(vm->def, mem)) >= 0)
mem = virDomainMemoryRemove(vm->def, id);
--
2.16.2
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
On 03/13/2018 06:36 PM, Peter Krempa wrote: > Libvirt provides full path to the backing file since commit > fec8f9c49afb479f6. This made qemu create the backend object but did not > delete it. This was fixed for unplug case in 4d83a6722f but not in case > of failure to hotplug the frontend. We'd leave the files behind which > would make memory unusable in case of hugepages. > > https://bugzilla.redhat.com/show_bug.cgi?id=1553085 > > Signed-off-by: Peter Krempa <pkrempa@redhat.com> > --- > src/qemu/qemu_hotplug.c | 4 ++++ > 1 file changed, 4 insertions(+) > ACK Michal -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
On Tue, Mar 13, 2018 at 06:36:33PM +0100, Peter Krempa wrote: >Libvirt provides full path to the backing file since commit >fec8f9c49afb479f6. This made qemu create the backend object but did not >delete it. This was fixed for unplug case in 4d83a6722f but not in case >of failure to hotplug the frontend. We'd leave the files behind which >would make memory unusable in case of hugepages. > >https://bugzilla.redhat.com/show_bug.cgi?id=1553085 > >Signed-off-by: Peter Krempa <pkrempa@redhat.com> >--- > src/qemu/qemu_hotplug.c | 4 ++++ > 1 file changed, 4 insertions(+) > ACK >diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c >index cff40625f8..70325a1246 100644 >--- a/src/qemu/qemu_hotplug.c >+++ b/src/qemu/qemu_hotplug.c >@@ -2219,6 +2219,10 @@ qemuDomainAttachMemory(virQEMUDriverPtr driver, > if (!mem) > goto audit; > >+ /* we need to remove the memory backing file so that it does not hog memory */ This comment does not really help with understanding what's happening. I suggest deleting it since readers will have to read the code anyway. Jan -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
© 2016 - 2025 Red Hat, Inc.