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