[libvirt] [PATCH v2] qemu: hotplug: Clean up memory backing files after failed memory hotplug

Peter Krempa posted 1 patch 6 years, 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/155d90a014f06050fbbac745d52d5daeba81d532.1521027848.git.pkrempa@redhat.com
Test syntax-check passed
src/qemu/qemu_hotplug.c | 4 ++++
1 file changed, 4 insertions(+)
[libvirt] [PATCH v2] qemu: hotplug: Clean up memory backing files after failed memory hotplug
Posted by Peter Krempa 6 years, 1 month ago
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>
---

Differences to v1:
- dropped mostly unhelpful comment
- moved the call slightly earlier so that the error of the original
hotplug operation is preserved

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

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v2] qemu: hotplug: Clean up memory backing files after failed memory hotplug
Posted by Martin Kletzander 6 years, 1 month ago
On Wed, Mar 14, 2018 at 12:45:04PM +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>

ACK

>---
>
>Differences to v1:
>- dropped mostly unhelpful comment
>- moved the call slightly earlier so that the error of the original
>hotplug operation is preserved
>
> 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 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;
>-- 
>2.16.2
>
>--
>libvir-list mailing list
>libvir-list@redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list