[PATCH 09/41] qemuxml2argvtest: Properly initialize qemuCaps->arch

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

 



qemuCaps->arch should match the guest architecture from domain XML.

Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 src/qemu/qemu_capabilities.c | 9 +++++++++
 src/qemu/qemu_capspriv.h     | 3 +++
 tests/qemuxml2argvtest.c     | 6 ++++++
 3 files changed, 18 insertions(+)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 1dcc970..58a96d4 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -2188,6 +2188,15 @@ const char *virQEMUCapsGetBinary(virQEMUCapsPtr qemuCaps)
     return qemuCaps->binary;
 }
 
+
+void
+virQEMUCapsSetArch(virQEMUCapsPtr qemuCaps,
+                   virArch arch)
+{
+    qemuCaps->arch = arch;
+}
+
+
 virArch virQEMUCapsGetArch(virQEMUCapsPtr qemuCaps)
 {
     return qemuCaps->arch;
diff --git a/src/qemu/qemu_capspriv.h b/src/qemu/qemu_capspriv.h
index aeb1293..c409acb 100644
--- a/src/qemu/qemu_capspriv.h
+++ b/src/qemu/qemu_capspriv.h
@@ -56,4 +56,7 @@ char *virQEMUCapsFormatCache(virQEMUCapsPtr qemuCaps,
                              time_t selfCTime,
                              unsigned long selfVersion);
 
+void
+virQEMUCapsSetArch(virQEMUCapsPtr qemuCaps,
+                   virArch arch);
 #endif
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 9e9db6e..f9ed6f5 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -27,6 +27,10 @@
 # include "storage/storage_driver.h"
 # include "virmock.h"
 
+# define __QEMU_CAPSRIV_H_ALLOW__
+# include "qemu/qemu_capspriv.h"
+# undef __QEMU_CAPSRIV_H_ALLOW__
+
 # include "testutilsqemu.h"
 
 # define VIR_FROM_THIS VIR_FROM_QEMU
@@ -332,6 +336,8 @@ testUpdateQEMUCaps(const struct testInfo *info,
 {
     int ret = -1;
 
+    virQEMUCapsSetArch(info->qemuCaps, vm->def->os.arch);
+
     if (testAddCPUModels(info->qemuCaps, info->skipLegacyCPUs) < 0)
         goto cleanup;
 
-- 
2.9.2

--
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]