Remove the local variable 'emulator' and just use def->emulator Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx> --- src/qemu/qemu_command.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index a9b5c3b..ab27619 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4760,7 +4760,6 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver, static int qemuBuildCpuArgStr(virQEMUDriverPtr driver, const virDomainDef *def, - const char *emulator, virQEMUCapsPtr qemuCaps, virArch hostarch, char **opt, @@ -4801,8 +4800,8 @@ qemuBuildCpuArgStr(virQEMUDriverPtr driver, */ if (def->os.arch == VIR_ARCH_I686 && ((hostarch == VIR_ARCH_X86_64 && - strstr(emulator, "kvm")) || - strstr(emulator, "x86_64"))) { + strstr(def->emulator, "kvm")) || + strstr(def->emulator, "x86_64"))) { virBufferAdd(&buf, default_model, -1); have_cpu = true; } @@ -6624,7 +6623,6 @@ qemuBuildCommandLine(virConnectPtr conn, { virErrorPtr originalError = NULL; size_t i, j; - const char *emulator; char uuid[VIR_UUID_STRING_BUFLEN]; char *cpu; char *smp; @@ -6679,8 +6677,6 @@ qemuBuildCommandLine(virConnectPtr conn, virUUIDFormat(def->uuid, uuid); - emulator = def->emulator; - if (!virQEMUDriverIsPrivileged(driver)) { /* If we have no cgroups then we can have no tunings that * require them */ @@ -6731,7 +6727,7 @@ qemuBuildCommandLine(virConnectPtr conn, (def->virtType == VIR_DOMAIN_VIRT_QEMU)) virQEMUCapsClear(qemuCaps, QEMU_CAPS_DRIVE_BOOT); - cmd = virCommandNew(emulator); + cmd = virCommandNew(def->emulator); virCommandAddEnvPassCommon(cmd); @@ -6753,7 +6749,7 @@ qemuBuildCommandLine(virConnectPtr conn, if (qemuBuildMachineArgStr(cmd, def, qemuCaps) < 0) goto error; - if (qemuBuildCpuArgStr(driver, def, emulator, qemuCaps, + if (qemuBuildCpuArgStr(driver, def, qemuCaps, hostarch, &cpu, &hasHwVirt, !!migrateURI) < 0) goto error; @@ -6878,7 +6874,7 @@ qemuBuildCommandLine(virConnectPtr conn, if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SMBIOS_TYPE)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("the QEMU binary %s does not support smbios settings"), - emulator); + def->emulator); goto error; } @@ -8003,7 +7999,7 @@ qemuBuildCommandLine(virConnectPtr conn, } if (def->tpm) { - if (qemuBuildTPMCommandLine(def, cmd, qemuCaps, emulator) < 0) + if (qemuBuildTPMCommandLine(def, cmd, qemuCaps, def->emulator) < 0) goto error; } -- 2.5.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list