提交 d7be1b1c 编写于 作者: M Marc Hartmayer 提交者: Ján Tomko

qemu: Replace virDomainChrSourceDefFree with virObjectUnref

Replace virDomainChrSourceDefFree with virObjectUnref.
Signed-off-by: NMarc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: NBoris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
Signed-off-by: NJán Tomko <jtomko@redhat.com>
上级 527da4ce
......@@ -120,7 +120,6 @@ useless_free_options = \
--name=virConfFreeValue \
--name=virDomainActualNetDefFree \
--name=virDomainChrDefFree \
--name=virDomainChrSourceDefFree \
--name=virDomainControllerDefFree \
--name=virDomainDefFree \
--name=virDomainDeviceDefFree \
......
......@@ -2199,7 +2199,7 @@ virDomainNetDefClear(virDomainNetDefPtr def)
switch (def->type) {
case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
virDomainChrSourceDefFree(def->data.vhostuser);
virObjectUnref(def->data.vhostuser);
def->data.vhostuser = NULL;
break;
......@@ -2438,13 +2438,6 @@ virDomainChrSourceDefDispose(void *obj)
}
void
virDomainChrSourceDefFree(virDomainChrSourceDefPtr def)
{
virObjectUnref(def);
}
/* virDomainChrSourceDefIsEqual:
* @src: Source
* @tgt: Target
......@@ -2535,7 +2528,7 @@ void virDomainChrDefFree(virDomainChrDefPtr def)
break;
}
virDomainChrSourceDefFree(def->source);
virObjectUnref(def->source);
virDomainDeviceInfoClear(&def->info);
VIR_FREE(def);
......@@ -2558,7 +2551,7 @@ void virDomainSmartcardDefFree(virDomainSmartcardDefPtr def)
break;
case VIR_DOMAIN_SMARTCARD_TYPE_PASSTHROUGH:
virDomainChrSourceDefFree(def->data.passthru);
virObjectUnref(def->data.passthru);
break;
default:
......@@ -2817,7 +2810,7 @@ void virDomainRedirdevDefFree(virDomainRedirdevDefPtr def)
if (!def)
return;
virDomainChrSourceDefFree(def->source);
virObjectUnref(def->source);
virDomainDeviceInfoClear(&def->info);
VIR_FREE(def);
......@@ -26540,7 +26533,7 @@ virDomainRNGDefFree(virDomainRNGDefPtr def)
VIR_FREE(def->source.file);
break;
case VIR_DOMAIN_RNG_BACKEND_EGD:
virDomainChrSourceDefFree(def->source.chardev);
virObjectUnref(def->source.chardev);
break;
case VIR_DOMAIN_RNG_BACKEND_LAST:
break;
......
......@@ -2926,7 +2926,6 @@ void virDomainNetDefClear(virDomainNetDefPtr def);
void virDomainNetDefFree(virDomainNetDefPtr def);
void virDomainSmartcardDefFree(virDomainSmartcardDefPtr def);
void virDomainChrDefFree(virDomainChrDefPtr def);
void virDomainChrSourceDefFree(virDomainChrSourceDefPtr def);
int virDomainChrSourceDefCopy(virDomainChrSourceDefPtr dest,
virDomainChrSourceDefPtr src);
void virDomainSoundCodecDefFree(virDomainSoundCodecDefPtr def);
......
......@@ -221,7 +221,6 @@ virDomainChrSerialTargetTypeFromString;
virDomainChrSerialTargetTypeToString;
virDomainChrSourceDefClear;
virDomainChrSourceDefCopy;
virDomainChrSourceDefFree;
virDomainChrSourceDefGetPath;
virDomainChrSourceDefNew;
virDomainChrSpicevmcTypeFromString;
......
......@@ -2063,7 +2063,7 @@ qemuDomainObjPrivateFree(void *data)
qemuDomainObjPrivateDataClear(priv);
virDomainChrSourceDefFree(priv->monConfig);
virObjectUnref(priv->monConfig);
qemuDomainObjFreeJob(priv);
VIR_FREE(priv->lockState);
VIR_FREE(priv->origname);
......@@ -3073,7 +3073,7 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt,
VIR_FREE(tmp);
virBitmapFree(priv->namespaces);
priv->namespaces = NULL;
virDomainChrSourceDefFree(priv->monConfig);
virObjectUnref(priv->monConfig);
priv->monConfig = NULL;
virStringListFree(priv->qemuDevices);
priv->qemuDevices = NULL;
......
......@@ -2495,7 +2495,7 @@ qemuParseCommandLine(virFileCachePtr capsCache,
goto error;
if (qemuParseCommandLineChr(chr, val) < 0) {
virDomainChrSourceDefFree(chr);
virObjectUnref(chr);
goto error;
}
......@@ -2732,7 +2732,7 @@ qemuParseCommandLine(virFileCachePtr capsCache,
virStringListFree(list);
VIR_FREE(nics);
if (monConfig) {
virDomainChrSourceDefFree(*monConfig);
virObjectUnref(*monConfig);
*monConfig = NULL;
}
if (pidfile)
......
......@@ -1887,8 +1887,7 @@ qemuConnectMonitor(virQEMUDriverPtr driver, virDomainObjPtr vm, int asyncJob,
virObjectRef(vm);
ignore_value(virTimeMillisNow(&priv->monStart));
monConfig = priv->monConfig;
virObjectRef(monConfig);
monConfig = virObjectRef(priv->monConfig);
virObjectUnlock(vm);
mon = qemuMonitorOpen(vm,
......@@ -7184,7 +7183,7 @@ void qemuProcessStop(virQEMUDriverPtr driver,
if (priv->monConfig) {
if (priv->monConfig->type == VIR_DOMAIN_CHR_TYPE_UNIX)
unlink(priv->monConfig->data.nix.path);
virDomainChrSourceDefFree(priv->monConfig);
virObjectUnref(priv->monConfig);
priv->monConfig = NULL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册