From: Peter Krempa Date: Tue, 13 Mar 2018 17:19:39 +0000 (+0100) Subject: qemu: hotplug: Clean up memory backing files after failed memory hotplug X-Git-Tag: v4.2.0-rc1~160 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=892e37d5a4fd2f6716ceb2acb5d35a22b60c167e;p=thirdparty%2Flibvirt.git qemu: hotplug: Clean up memory backing files after failed memory hotplug 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 --- diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index e0a5300f08..49af4d4ff0 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -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;