qemuxml2argvtest: Properly initialize qemuCaps->arch

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
Jiri Denemark 2016-08-03 12:26:41 +02:00
parent 4df4b8dea3
commit 6bb5f0b218
3 changed files with 18 additions and 0 deletions

View File

@ -2250,6 +2250,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;

View File

@ -56,4 +56,7 @@ char *virQEMUCapsFormatCache(virQEMUCapsPtr qemuCaps,
time_t selfCTime,
unsigned long selfVersion);
void
virQEMUCapsSetArch(virQEMUCapsPtr qemuCaps,
virArch arch);
#endif

View File

@ -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;