qemu: hotplug: Clean up memory backing files after failed memory hotplug

Libvirt provides full path to the backing file since commit
fec8f9c49a. 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>
This commit is contained in:
Peter Krempa 2018-03-13 18:19:39 +01:00
parent 6c2e34e1a7
commit 892e37d5a4

View 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;