[PATCH v1 02/26] qemu_command.c: move mem.nosharepages validation to qemu_domain.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Move QEMU_CAPS_MEM_MERGE validation from qemuBuildMachineCommandLine()
to qemuDomainDefValidateMemory().

Signed-off-by: Daniel Henrique Barboza <danielhb413@xxxxxxxxx>
---
 src/qemu/qemu_command.c | 10 +---------
 src/qemu/qemu_domain.c  |  7 +++++++
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 12a9d47f44..a56f324af2 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -7120,16 +7120,8 @@ qemuBuildMachineCommandLine(virCommandPtr cmd,
                           cfg->dumpGuestCore ? "on" : "off");
     }
 
-    if (def->mem.nosharepages) {
-        if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MEM_MERGE)) {
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                           _("disable shared memory is not available "
-                             "with this QEMU binary"));
-            return -1;
-        }
-
+    if (def->mem.nosharepages)
         virBufferAddLit(&buf, ",mem-merge=off");
-    }
 
     if (def->keywrap &&
         !qemuAppendKeyWrapMachineParms(&buf, qemuCaps, def->keywrap))
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index e25b439a39..d78c5904ff 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -5049,6 +5049,13 @@ qemuDomainDefValidateMemory(const virDomainDef *def,
         return -1;
     }
 
+    if (mem->nosharepages && !virQEMUCapsGet(qemuCaps, QEMU_CAPS_MEM_MERGE)) {
+         virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                        _("disable shared memory is not available "
+                          "with this QEMU binary"));
+        return -1;
+    }
+
     return 0;
 }
 
-- 
2.23.0


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux