render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
404507
From 50bfc7b26b1a45d34ff8f62febbd59d6be9fb02c Mon Sep 17 00:00:00 2001
404507
Message-Id: <50bfc7b26b1a45d34ff8f62febbd59d6be9fb02c@dist-git>
404507
From: Martin Kletzander <mkletzan@redhat.com>
404507
Date: Wed, 31 Jan 2018 16:32:43 +0100
404507
Subject: [PATCH] qemu: Restore machinename even without cgroups
404507
404507
The virresctrl will use this as well and we need to have that info after restart
404507
to properly clean up /sys/fs/resctrl.
404507
404507
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
404507
(cherry picked from commit 272649a1d7b4c6a9f5c355a3b3e2a49b748e0f4d)
404507
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
404507
404507
https://bugzilla.redhat.com/show_bug.cgi?id=1289368
404507
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
404507
---
404507
 src/qemu/qemu_cgroup.c  | 4 ----
404507
 src/qemu/qemu_process.c | 4 ++++
404507
 2 files changed, 4 insertions(+), 4 deletions(-)
404507
404507
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
404507
index 19252ea239..41e27c21e2 100644
404507
--- a/src/qemu/qemu_cgroup.c
404507
+++ b/src/qemu/qemu_cgroup.c
404507
@@ -986,10 +986,6 @@ qemuConnectCgroup(virDomainObjPtr vm)
404507
     if (!virCgroupAvailable())
404507
         goto done;
404507
 
404507
-    priv->machineName = qemuDomainGetMachineName(vm);
404507
-    if (!priv->machineName)
404507
-            goto cleanup;
404507
-
404507
     virCgroupFree(&priv->cgroup);
404507
 
404507
     if (virCgroupNewDetectMachine(vm->def->name,
404507
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
404507
index 29a8d8ba53..08081aa278 100644
404507
--- a/src/qemu/qemu_process.c
404507
+++ b/src/qemu/qemu_process.c
404507
@@ -7194,6 +7194,10 @@ qemuProcessReconnect(void *opaque)
404507
     if (qemuHostdevUpdateActiveDomainDevices(driver, obj->def) < 0)
404507
         goto error;
404507
 
404507
+    priv->machineName = qemuDomainGetMachineName(obj);
404507
+    if (!priv->machineName)
404507
+        goto error;
404507
+
404507
     if (qemuConnectCgroup(obj) < 0)
404507
         goto error;
404507
 
404507
-- 
404507
2.16.1
404507