提交 18d779c8 编写于 作者: J Ján Tomko

qemu_command: use VIR_AUTOUNREF

Signed-off-by: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 641b649d
......@@ -6850,7 +6850,7 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver,
{
int ret = -1;
size_t i;
virCapsPtr caps = NULL;
VIR_AUTOUNREF(virCapsPtr) caps = NULL;
virCPUDefPtr cpu = def->cpu;
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
......@@ -6928,7 +6928,6 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver,
ret = 0;
cleanup:
virObjectUnref(caps);
return ret;
}
......@@ -8436,7 +8435,7 @@ qemuInterfaceVhostuserConnect(virQEMUDriverPtr driver,
virQEMUCapsPtr qemuCaps,
char **chardev)
{
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
VIR_AUTOUNREF(virQEMUDriverConfigPtr) cfg = virQEMUDriverGetConfig(driver);
int ret = -1;
switch ((virDomainChrType)net->data.vhostuser->type) {
......@@ -8469,7 +8468,6 @@ qemuInterfaceVhostuserConnect(virQEMUDriverPtr driver,
ret = 0;
cleanup:
virObjectUnref(cfg);
return ret;
}
......@@ -10366,7 +10364,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
size_t i;
char uuid[VIR_UUID_STRING_BUFLEN];
virCommandPtr cmd = NULL;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
VIR_AUTOUNREF(virQEMUDriverConfigPtr) cfg = virQEMUDriverGetConfig(driver);
unsigned int bootHostdevNet = 0;
qemuDomainObjPrivatePtr priv = vm->privateData;
virDomainDefPtr def = vm->def;
......@@ -10621,11 +10619,9 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
cfg->logTimestamp)
virCommandAddArgList(cmd, "-msg", "timestamp=on", NULL);
virObjectUnref(cfg);
return cmd;
error:
virObjectUnref(cfg);
virCommandFree(cmd);
return NULL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册