]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: hotplug: Clean up memory backing files after failed memory hotplug
authorPeter Krempa <pkrempa@redhat.com>
Tue, 13 Mar 2018 17:19:39 +0000 (18:19 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 15 Mar 2018 09:04:40 +0000 (10:04 +0100)
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

index e0a5300f08fafb699fa2217caa4126d78007ba55..49af4d4ff0ba4917797ef89b01fb0289905a47bc 100644 (file)
@@ -2212,6 +2212,10 @@ qemuDomainAttachMemory(virQEMUDriverPtr driver,
         ignore_value(qemuMonitorDelObject(priv->mon, objalias));
     if (qemuDomainObjExitMonitor(driver, vm) < 0)
         mem = NULL;
+
+    if (objAdded && mem)
+        ignore_value(qemuProcessDestroyMemoryBackingPath(driver, vm, mem));
+
     virErrorRestore(&orig_err);
     if (!mem)
         goto audit;