Blame SOURCES/libvirt-qemu-Set-alias-for-memory-cell-in-qemuBuildMemoryCellBackendStr.patch

c1c534
From 5d839559bfdaf17dd1c550eb451c64fcac7079b3 Mon Sep 17 00:00:00 2001
c1c534
Message-Id: <5d839559bfdaf17dd1c550eb451c64fcac7079b3@dist-git>
c1c534
From: Michal Privoznik <mprivozn@redhat.com>
c1c534
Date: Thu, 9 Nov 2017 16:06:44 +0100
c1c534
Subject: [PATCH] qemu: Set alias for memory cell in
c1c534
 qemuBuildMemoryCellBackendStr
c1c534
c1c534
https://bugzilla.redhat.com/show_bug.cgi?id=1461214
c1c534
c1c534
Very soon qemuBuildMemoryBackendStr() is going to use memory cell
c1c534
aliases. Therefore set one. At the same time, move it a bit
c1c534
further - if virAsprintf() fails, there's no point in setting
c1c534
rest of the members.
c1c534
c1c534
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
c1c534
Reviewed-by: John Ferlan <jferlan@redhat.com>
c1c534
(cherry picked from commit d52e6043bc5b19484ce5489345f9b9be61d95c1c)
c1c534
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
c1c534
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c1c534
---
c1c534
 src/qemu/qemu_command.c | 7 ++++---
c1c534
 1 file changed, 4 insertions(+), 3 deletions(-)
c1c534
c1c534
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
c1c534
index 9f346c3649..57c855c047 100644
c1c534
--- a/src/qemu/qemu_command.c
c1c534
+++ b/src/qemu/qemu_command.c
c1c534
@@ -3542,12 +3542,13 @@ qemuBuildMemoryCellBackendStr(virDomainDefPtr def,
c1c534
     unsigned long long memsize = virDomainNumaGetNodeMemorySize(def->numa,
c1c534
                                                                 cell);
c1c534
 
c1c534
+    if (virAsprintf(&alias, "ram-node%zu", cell) < 0)
c1c534
+        goto cleanup;
c1c534
+
c1c534
     *backendStr = NULL;
c1c534
     mem.size = memsize;
c1c534
     mem.targetNode = cell;
c1c534
-
c1c534
-    if (virAsprintf(&alias, "ram-node%zu", cell) < 0)
c1c534
-        goto cleanup;
c1c534
+    mem.info.alias = alias;
c1c534
 
c1c534
     if ((rc = qemuBuildMemoryBackendStr(&props, &backendType, cfg, priv->qemuCaps,
c1c534
                                         def, &mem, priv->autoNodeset, false)) < 0)
c1c534
-- 
c1c534
2.15.0
c1c534