render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Blob Blame History Raw
From 9cde726d82715272f2b06580dde9a65882263e85 Mon Sep 17 00:00:00 2001
Message-Id: <9cde726d82715272f2b06580dde9a65882263e85@dist-git>
From: Peter Krempa <pkrempa@redhat.com>
Date: Fri, 28 Apr 2017 10:45:16 +0200
Subject: [PATCH] qemu: process: Clean automatic NUMA/cpu pinning information
 on shutdown

Clean the stale data after shutting down the VM. Otherwise the data
would be leaked on next VM start. This happens due to the fact that the
private data object is not freed on destroy of the VM.

(cherry picked from commit 1730cdc665a499afc28683a4ce21493f967411b7)
https://bugzilla.redhat.com/show_bug.cgi?id=1445627

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/qemu/qemu_process.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 027c831e6..5d2d0662b 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -6433,6 +6433,12 @@ void qemuProcessStop(virQEMUDriverPtr driver,
     priv->qemuCaps = NULL;
     VIR_FREE(priv->pidfile);
 
+    /* remove automatic pinning data */
+    virBitmapFree(priv->autoNodeset);
+    priv->autoNodeset = NULL;
+    virBitmapFree(priv->autoCpuset);
+    priv->autoCpuset = NULL;
+
     /* The "release" hook cleans up additional resources */
     if (virHookPresent(VIR_HOOK_DRIVER_QEMU)) {
         char *xml = qemuDomainDefFormatXML(driver, vm->def, 0);
-- 
2.12.2