qemu: Replace virDomainChrSourceDefFree with virObjectUnref

Replace virDomainChrSourceDefFree with virObjectUnref.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Marc Hartmayer 2019-02-20 09:51:07 +01:00 committed by Ján Tomko
parent 527da4ce9b
commit d7be1b1c5e
7 changed files with 11 additions and 22 deletions

1
cfg.mk
View File

@ -120,7 +120,6 @@ useless_free_options = \
--name=virConfFreeValue \
--name=virDomainActualNetDefFree \
--name=virDomainChrDefFree \
--name=virDomainChrSourceDefFree \
--name=virDomainControllerDefFree \
--name=virDomainDefFree \
--name=virDomainDeviceDefFree \

View File

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

View File

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

View File

@ -221,7 +221,6 @@ virDomainChrSerialTargetTypeFromString;
virDomainChrSerialTargetTypeToString;
virDomainChrSourceDefClear;
virDomainChrSourceDefCopy;
virDomainChrSourceDefFree;
virDomainChrSourceDefGetPath;
virDomainChrSourceDefNew;
virDomainChrSpicevmcTypeFromString;

View File

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

View File

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

View File

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