diff --git a/cfg.mk b/cfg.mk index c2524de5fc..7762422da7 100644 --- a/cfg.mk +++ b/cfg.mk @@ -120,7 +120,6 @@ useless_free_options = \ --name=virConfFreeValue \ --name=virDomainActualNetDefFree \ --name=virDomainChrDefFree \ - --name=virDomainChrSourceDefFree \ --name=virDomainControllerDefFree \ --name=virDomainDefFree \ --name=virDomainDeviceDefFree \ diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 6f96e6bcdb..477deb777e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 1036eb9b10..1f8454b38c 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -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); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index aa1b2c77be..038a744981 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -221,7 +221,6 @@ virDomainChrSerialTargetTypeFromString; virDomainChrSerialTargetTypeToString; virDomainChrSourceDefClear; virDomainChrSourceDefCopy; -virDomainChrSourceDefFree; virDomainChrSourceDefGetPath; virDomainChrSourceDefNew; virDomainChrSpicevmcTypeFromString; diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index c793c16668..55bb0ab5aa 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -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; diff --git a/src/qemu/qemu_parse_command.c b/src/qemu/qemu_parse_command.c index 81691cb85e..49b34b1c17 100644 --- a/src/qemu/qemu_parse_command.c +++ b/src/qemu/qemu_parse_command.c @@ -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) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index f06fe62f99..68c670d3f2 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -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; }