From nobody Mon Feb 9 06:00:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1589371112; cv=none; d=zohomail.com; s=zohoarc; b=fR30St1SBuEpeCIfb5zNITSdX3ZTvAOSyJLix0xo8ppnIVgO/D65B2mq1KH+j45sWn0gvR2ebV5Zzy0w+NGljbaDUILLgjU3ZTXGoTro2Ew4NxboP7jwvcUjRONthxH3RXPWhp9Fs4k/wdba0MLIEPpq2OThZspCtd/qVhf2Dv8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589371112; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5fAT0t1vClZ3gCk15dpo6M1xh829YDoenWTDNir6nmU=; b=A3fWiQvgvXrxLYtzeoysVzgDkYvkt7xNqyVqUFeR5rzP+mCpqBuJLZgrJKpV3XQHsKjiD16FF+rmYxE26ctUx1Mve36gJTdfrEPlCgBtvM88A3zWBErVVNnqGUipex4Dg+5660An+ASxskdKXNeiG9A4UZtw4WFeFm+pu1QnqIc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1589371112877303.30971433116304; Wed, 13 May 2020 04:58:32 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-271-HknAOjOsM-29fIuCP2pR3w-1; Wed, 13 May 2020 07:58:29 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7F3CD8018AB; Wed, 13 May 2020 11:58:21 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5B5C32E187; Wed, 13 May 2020 11:58:21 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 2A4154E586; Wed, 13 May 2020 11:58:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 04DBwFWC015974 for ; Wed, 13 May 2020 07:58:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2489D5EDD7; Wed, 13 May 2020 11:58:15 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1F4F9110EB4 for ; Wed, 13 May 2020 11:58:15 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0032C80CDB4 for ; Wed, 13 May 2020 11:58:15 +0000 (UTC) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-463-xFa6cVjtP96qGYPi6yIRCA-1; Wed, 13 May 2020 07:58:12 -0400 Received: by mail-wr1-f65.google.com with SMTP id v12so20498289wrp.12 for ; Wed, 13 May 2020 04:58:12 -0700 (PDT) Received: from localhost.localdomain (public-gprs367127.centertel.pl. [37.47.65.88]) by smtp.gmail.com with ESMTPSA id l1sm27838422wrc.24.2020.05.13.04.58.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2020 04:58:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589371111; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=5fAT0t1vClZ3gCk15dpo6M1xh829YDoenWTDNir6nmU=; b=gTrSUE/4SGtRNoF/6l/AsMSG9zMrwrgIVUTjSUGPSEphR0KOi8s78cnI9dK/k009mTlOW0 t9SeD2RrTAU2uCmpF3fKts+9nmDd6mB4pFk25CxUGvthovzv1VPVIl2Avo5ui9z+Jq0kXP YUx5/L+UZrerLfgZRJxZwnS7UHMx1yw= X-MC-Unique: HknAOjOsM-29fIuCP2pR3w-1 X-MC-Unique: xFa6cVjtP96qGYPi6yIRCA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5fAT0t1vClZ3gCk15dpo6M1xh829YDoenWTDNir6nmU=; b=eRx5KkZ27PmHSY9uQKY6o649JlFHvllmJ6ijX4KbRsBtGM96aRyNp1cl9pKM/2uxTo ggEQxHvBr+yeYGPE1VsrpfSyHMnq2SIdc9oquoUvd78LVnL9cLcFKcix/LTh0g0foOMF 2w1Yf/UEUlY6DdWPgdFf46ZT8CyutE4htnJOOIpaUThfj6dC2c/KFB8kVe0wTpU4ZqX2 KOezkret5nunfgz1NfnRRM9fGqzYAqVlAwkH64+QGz7Pmpdj/uiCaKM57yEI8bMxMwC4 uwrMFjvrXePlk93cAlJZmmgQV4HfeRP05cgK5SFKwcqzQk/uWfiFxhyLwvzfurF2TFlG HkoA== X-Gm-Message-State: AOAM531eJ2+IQu43dacbwxznBkGIwXD1gbxkNCuQKznVQAkcS6hPsxLV PTgU/Ai9NQz+UyeSRcLhqm0ZK1lk X-Google-Smtp-Source: ABdhPJyowLW0xwayLtqJnEbvpHE0Of2R+l1LxDbZnnxfcdOASXnv7oiw2EgCDvFp+2kZAIZxD1EaXw== X-Received: by 2002:a5d:4e4d:: with SMTP id r13mr10118205wrt.122.1589371090892; Wed, 13 May 2020 04:58:10 -0700 (PDT) From: Rafael Fonseca To: libvirt-list@redhat.com Subject: [PATCH 07/40] conf: convert virDomainXMLOption to GObject Date: Wed, 13 May 2020 13:56:51 +0200 Message-Id: <20200513115724.157687-8-r4f4rfs@gmail.com> In-Reply-To: <20200513115724.157687-1-r4f4rfs@gmail.com> References: <20200513115724.157687-1-r4f4rfs@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Rafael Fonseca X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Rafael Fonseca --- src/bhyve/bhyve_driver.c | 2 +- src/conf/domain_conf.c | 29 +++++++++++++++++++---------- src/conf/domain_conf.h | 9 +++++++++ src/esx/esx_driver.c | 2 +- src/libvirt_private.syms | 1 + src/libxl/libxl_driver.c | 2 +- src/lxc/lxc_controller.c | 2 +- src/lxc/lxc_driver.c | 2 +- src/openvz/openvz_conf.c | 2 +- src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_process.c | 15 +++++---------- src/security/virt-aa-helper.c | 2 +- src/test/test_driver.c | 2 +- src/vbox/vbox_common.c | 2 +- src/vmware/vmware_conf.c | 2 +- src/vz/vz_driver.c | 2 +- tests/bhyveargv2xmltest.c | 2 +- tests/bhyvexml2argvtest.c | 2 +- tests/bhyvexml2xmltest.c | 2 +- tests/domainconftest.c | 2 +- tests/genericxml2xmltest.c | 2 +- tests/openvzutilstest.c | 2 +- tests/testutilslxc.c | 2 +- tests/testutilsqemu.c | 2 +- tests/testutilsxen.c | 2 +- tests/vmx2xmltest.c | 2 +- tests/xml2vmxtest.c | 4 ++-- 27 files changed, 58 insertions(+), 44 deletions(-) diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c index bbaf6ea1f5..6a37c7973b 100644 --- a/src/bhyve/bhyve_driver.c +++ b/src/bhyve/bhyve_driver.c @@ -1182,7 +1182,7 @@ bhyveStateCleanup(void) =20 virObjectUnref(bhyve_driver->domains); g_clear_object(&bhyve_driver->caps); - virObjectUnref(bhyve_driver->xmlopt); + g_clear_object(&bhyve_driver->xmlopt); virSysinfoDefFree(bhyve_driver->hostsysinfo); virObjectUnref(bhyve_driver->closeCallbacks); virObjectUnref(bhyve_driver->domainEventState); diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 301b4b0d84..62f49a598a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -70,7 +70,7 @@ VIR_LOG_INIT("conf.domain_conf"); /* This structure holds various callbacks and data needed * while parsing and creating domain XMLs */ struct _virDomainXMLOption { - virObject parent; + GObject parent; =20 /* XML parser callbacks and defaults */ virDomainDefParserConfig config; @@ -1324,18 +1324,26 @@ VIR_ENUM_IMPL(virDomainLaunchSecurity, ); =20 static virClassPtr virDomainObjClass; -static virClassPtr virDomainXMLOptionClass; static void virDomainObjDispose(void *obj); -static void virDomainXMLOptionDispose(void *obj); +G_DEFINE_TYPE(virDomainXMLOption, vir_domain_xml_option, G_TYPE_OBJECT); +static void virDomainXMLOptionFinalize(GObject *obj); + +static void vir_domain_xml_option_init(virDomainXMLOption *option G_GNUC_U= NUSED) +{ +} + +static void vir_domain_xml_option_class_init(virDomainXMLOptionClass *klas= s) +{ + GObjectClass *obj =3D G_OBJECT_CLASS(klass); + + obj->finalize =3D virDomainXMLOptionFinalize; +} =20 static int virDomainObjOnceInit(void) { if (!VIR_CLASS_NEW(virDomainObj, virClassForObjectLockable())) return -1; =20 - if (!VIR_CLASS_NEW(virDomainXMLOption, virClassForObject())) - return -1; - return 0; } =20 @@ -1343,12 +1351,14 @@ VIR_ONCE_GLOBAL_INIT(virDomainObj); =20 =20 static void -virDomainXMLOptionDispose(void *obj) +virDomainXMLOptionFinalize(GObject *obj) { - virDomainXMLOptionPtr xmlopt =3D obj; + virDomainXMLOptionPtr xmlopt =3D VIR_DOMAIN_XML_OPTION(obj); =20 if (xmlopt->config.privFree) (xmlopt->config.privFree)(xmlopt->config.priv); + + G_OBJECT_CLASS(vir_domain_xml_option_parent_class)->finalize(obj); } =20 /** @@ -1475,8 +1485,7 @@ virDomainXMLOptionNew(virDomainDefParserConfigPtr con= fig, if (virDomainObjInitialize() < 0) return NULL; =20 - if (!(xmlopt =3D virObjectNew(virDomainXMLOptionClass))) - return NULL; + xmlopt =3D VIR_DOMAIN_XML_OPTION(g_object_new(VIR_TYPE_DOMAIN_XML_OPTI= ON, NULL)); =20 if (priv) xmlopt->privateData =3D *priv; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index ddc75d8de2..20fc734e06 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -58,6 +58,8 @@ #include "virresctrl.h" #include "virenum.h" =20 +#include + /* Flags for the 'type' field in virDomainDeviceDef */ typedef enum { VIR_DOMAIN_DEVICE_NONE =3D 0, @@ -2876,6 +2878,13 @@ struct _virDomainABIStability { virDomainABIStabilityDomain domain; }; =20 +#define VIR_TYPE_DOMAIN_XML_OPTION vir_domain_xml_option_get_type() +G_DECLARE_FINAL_TYPE(virDomainXMLOption, + vir_domain_xml_option, + VIR, + DOMAIN_XML_OPTION, + GObject); + virDomainXMLOptionPtr virDomainXMLOptionNew(virDomainDefParserConfigPtr co= nfig, virDomainXMLPrivateDataCallbac= ksPtr priv, virXMLNamespacePtr xmlns, diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 39412f746a..42f6ab9392 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -70,7 +70,7 @@ esxFreePrivate(esxPrivate **priv) esxVI_Context_Free(&(*priv)->vCenter); esxUtil_FreeParsedUri(&(*priv)->parsedUri); g_clear_object(&(*priv)->caps); - virObjectUnref((*priv)->xmlopt); + g_clear_object(&(*priv)->xmlopt); VIR_FREE(*priv); } =20 diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 88fdc1a3a8..ed7813ce0e 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -219,6 +219,7 @@ virSEVCapabilitiesFree; =20 =20 # conf/domain_conf.h +vir_domain_xml_option_get_type; virBlkioDeviceArrayClear; virDiskNameParse; virDiskNameToBusDeviceIndex; diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 63ec0a2188..0e465f7d05 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -507,7 +507,7 @@ libxlStateCleanup(void) return -1; =20 virObjectUnref(libxl_driver->hostdevMgr); - virObjectUnref(libxl_driver->xmlopt); + g_clear_object(&libxl_driver->xmlopt); virObjectUnref(libxl_driver->domains); virPortAllocatorRangeFree(libxl_driver->reservedGraphicsPorts); virPortAllocatorRangeFree(libxl_driver->migrationPorts); diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index f078c1c425..0aa56f6d24 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -180,7 +180,7 @@ virLXCControllerDriverFree(virLXCDriverPtr driver) { if (!driver) return; - virObjectUnref(driver->xmlopt); + g_clear_object(&driver->xmlopt); g_clear_object(&driver->caps); virMutexDestroy(&driver->lock); g_free(driver); diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index b76e2a4f15..c34bcd5397 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -1614,7 +1614,7 @@ static int lxcStateCleanup(void) virObjectUnref(lxc_driver->hostdevMgr); g_clear_object(&lxc_driver->caps); virObjectUnref(lxc_driver->securityManager); - virObjectUnref(lxc_driver->xmlopt); + g_clear_object(&lxc_driver->xmlopt); =20 if (lxc_driver->lockFD !=3D -1) virPidFileRelease(lxc_driver->config->stateDir, "driver", lxc_driv= er->lockFD); diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c index 0d11d71dfd..474f75840f 100644 --- a/src/openvz/openvz_conf.c +++ b/src/openvz/openvz_conf.c @@ -479,7 +479,7 @@ openvzFreeDriver(struct openvz_driver *driver) if (!driver) return; =20 - virObjectUnref(driver->xmlopt); + g_clear_object(&driver->xmlopt); virObjectUnref(driver->domains); g_clear_object(&driver->caps); VIR_FREE(driver); diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index e5b34b1f98..13d3948bd6 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -1121,7 +1121,7 @@ qemuStateCleanup(void) virObjectUnref(qemu_driver->securityManager); virObjectUnref(qemu_driver->domainEventState); virObjectUnref(qemu_driver->qemuCapsCache); - virObjectUnref(qemu_driver->xmlopt); + g_clear_object(&qemu_driver->xmlopt); virCPUDefFree(qemu_driver->hostcpu); virCapabilitiesHostNUMAUnref(qemu_driver->hostnuma); g_clear_object(&qemu_driver->caps); diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 57700438e9..0d9a83ab89 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -8560,9 +8560,8 @@ qemuProcessQMPInitMonitor(qemuMonitorPtr mon) static int qemuProcessQMPConnectMonitor(qemuProcessQMPPtr proc) { - virDomainXMLOptionPtr xmlopt =3D NULL; + g_autoptr(virDomainXMLOption) xmlopt =3D NULL; virDomainChrSourceDef monConfig; - int ret =3D -1; =20 VIR_DEBUG("proc=3D%p, emulator=3D%s, proc->pid=3D%lld", proc, proc->binary, (long long)proc->pid); @@ -8574,25 +8573,21 @@ qemuProcessQMPConnectMonitor(qemuProcessQMPPtr proc) if (!(xmlopt =3D virDomainXMLOptionNew(NULL, NULL, NULL, NULL, NULL)) = || !(proc->vm =3D virDomainObjNew(xmlopt)) || !(proc->vm->def =3D virDomainDefNew())) - goto cleanup; + return -1; =20 proc->vm->pid =3D proc->pid; =20 if (!(proc->mon =3D qemuMonitorOpen(proc->vm, &monConfig, true, 0, virEventThreadGetContext(proc->event= Thread), &callbacks, NULL))) - goto cleanup; + return -1; =20 virObjectLock(proc->mon); =20 if (qemuProcessQMPInitMonitor(proc->mon) < 0) - goto cleanup; - - ret =3D 0; + return -1; =20 - cleanup: - virObjectUnref(xmlopt); - return ret; + return 0; } =20 =20 diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index 370efd8dd1..d8e4ef9111 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -80,7 +80,7 @@ vahDeinit(vahControl * ctl) =20 VIR_FREE(ctl->def); g_clear_object(&ctl->caps); - virObjectUnref(ctl->xmlopt); + g_clear_object(&ctl->xmlopt); VIR_FREE(ctl->files); VIR_FREE(ctl->virtType); VIR_FREE(ctl->os); diff --git a/src/test/test_driver.c b/src/test/test_driver.c index d824d12baf..d1e9b6cd49 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -159,7 +159,7 @@ testDriverDispose(void *obj) size_t i; =20 g_clear_object(&driver->caps); - virObjectUnref(driver->xmlopt); + g_clear_object(&driver->xmlopt); virObjectUnref(driver->domains); virNodeDeviceObjListFree(driver->devs); virObjectUnref(driver->networks); diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index febf843cd5..7ca314d0dc 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -123,7 +123,7 @@ vboxDriverDispose(void *obj) vboxDriverPtr driver =3D obj; =20 g_clear_object(&driver->caps); - virObjectUnref(driver->xmlopt); + g_clear_object(&driver->xmlopt); } =20 static int diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_conf.c index 017df7237f..1779edaf68 100644 --- a/src/vmware/vmware_conf.c +++ b/src/vmware/vmware_conf.c @@ -55,7 +55,7 @@ vmwareFreeDriver(struct vmware_driver *driver) virMutexDestroy(&driver->lock); virObjectUnref(driver->domains); g_clear_object(&driver->caps); - virObjectUnref(driver->xmlopt); + g_clear_object(&driver->xmlopt); VIR_FREE(driver->vmrun); VIR_FREE(driver); } diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c index 85dac9a682..4fe072233e 100644 --- a/src/vz/vz_driver.c +++ b/src/vz/vz_driver.c @@ -149,7 +149,7 @@ static void vzDriverDispose(void * obj) prlsdkDisconnect(driver); virObjectUnref(driver->domains); g_clear_object(&driver->caps); - virObjectUnref(driver->xmlopt); + g_clear_object(&driver->xmlopt); virObjectUnref(driver->domainEventState); virSysinfoDefFree(driver->hostsysinfo); } diff --git a/tests/bhyveargv2xmltest.c b/tests/bhyveargv2xmltest.c index 3150c4583f..7abbf9a7fd 100644 --- a/tests/bhyveargv2xmltest.c +++ b/tests/bhyveargv2xmltest.c @@ -196,7 +196,7 @@ mymain(void) DO_TEST_FAIL("extraargs"); =20 g_clear_object(&driver.caps); - virObjectUnref(driver.xmlopt); + g_clear_object(&driver.xmlopt); =20 return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } diff --git a/tests/bhyvexml2argvtest.c b/tests/bhyvexml2argvtest.c index 0429394246..0f2caa011b 100644 --- a/tests/bhyvexml2argvtest.c +++ b/tests/bhyvexml2argvtest.c @@ -250,7 +250,7 @@ mymain(void) DO_TEST_FAILURE("cputopology"); =20 g_clear_object(&driver.caps); - virObjectUnref(driver.xmlopt); + g_clear_object(&driver.xmlopt); virPortAllocatorRangeFree(driver.remotePorts); =20 return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; diff --git a/tests/bhyvexml2xmltest.c b/tests/bhyvexml2xmltest.c index 27b9abb204..782741aab7 100644 --- a/tests/bhyvexml2xmltest.c +++ b/tests/bhyvexml2xmltest.c @@ -128,7 +128,7 @@ mymain(void) DO_TEST_DIFFERENT("input-xhci-tablet"); =20 g_clear_object(&driver.caps); - virObjectUnref(driver.xmlopt); + g_clear_object(&driver.xmlopt); =20 return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } diff --git a/tests/domainconftest.c b/tests/domainconftest.c index 54fdd72c25..361628dcf4 100644 --- a/tests/domainconftest.c +++ b/tests/domainconftest.c @@ -104,7 +104,7 @@ mymain(void) DO_TEST_GET_FS("/doesnotexist", false); =20 g_clear_object(&caps); - virObjectUnref(xmlopt); + g_clear_object(&xmlopt); =20 cleanup: return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; diff --git a/tests/genericxml2xmltest.c b/tests/genericxml2xmltest.c index a92f5dc613..139e2326ff 100644 --- a/tests/genericxml2xmltest.c +++ b/tests/genericxml2xmltest.c @@ -199,7 +199,7 @@ mymain(void) =20 =20 g_clear_object(&caps); - virObjectUnref(xmlopt); + g_clear_object(&xmlopt); =20 return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } diff --git a/tests/openvzutilstest.c b/tests/openvzutilstest.c index 124f17c3ce..00ed653835 100644 --- a/tests/openvzutilstest.c +++ b/tests/openvzutilstest.c @@ -131,7 +131,7 @@ testReadNetworkConf(const void *data G_GNUC_UNUSED) result =3D 0; =20 cleanup: - virObjectUnref(driver.xmlopt); + g_clear_object(&driver.xmlopt); g_clear_object(&driver.caps); VIR_FREE(actual); virDomainDefFree(def); diff --git a/tests/testutilslxc.c b/tests/testutilslxc.c index bffc3ba440..c871f3b920 100644 --- a/tests/testutilslxc.c +++ b/tests/testutilslxc.c @@ -76,7 +76,7 @@ testLXCDriverInit(void) void testLXCDriverFree(virLXCDriverPtr driver) { - virObjectUnref(driver->xmlopt); + g_clear_object(&driver->xmlopt); g_clear_object(&driver->caps); virMutexDestroy(&driver->lock); g_free(driver); diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index ea0a89e902..396c069bd2 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -307,7 +307,7 @@ void qemuTestDriverFree(virQEMUDriver *driver) virFileDeleteTree(driver->config->configDir); } virObjectUnref(driver->qemuCapsCache); - virObjectUnref(driver->xmlopt); + g_clear_object(&driver->xmlopt); g_clear_object(&driver->caps); virObjectUnref(driver->config); virObjectUnref(driver->securityManager); diff --git a/tests/testutilsxen.c b/tests/testutilsxen.c index 7da90cdd1e..d680fe36e3 100644 --- a/tests/testutilsxen.c +++ b/tests/testutilsxen.c @@ -112,7 +112,7 @@ libxlDriverPrivatePtr testXLInitDriver(void) void testXLFreeDriver(libxlDriverPrivatePtr driver) { virObjectUnref(driver->config); - virObjectUnref(driver->xmlopt); + g_clear_object(&driver->xmlopt); virMutexDestroy(&driver->lock); g_free(driver); } diff --git a/tests/vmx2xmltest.c b/tests/vmx2xmltest.c index 613331cabc..07cb718f12 100644 --- a/tests/vmx2xmltest.c +++ b/tests/vmx2xmltest.c @@ -282,7 +282,7 @@ mymain(void) DO_TEST("datacenterpath", "datacenterpath"); =20 g_clear_object(&caps); - virObjectUnref(xmlopt); + g_clear_object(&xmlopt); =20 return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } diff --git a/tests/xml2vmxtest.c b/tests/xml2vmxtest.c index 5d5fb8e69a..58e8adafcb 100644 --- a/tests/xml2vmxtest.c +++ b/tests/xml2vmxtest.c @@ -60,7 +60,7 @@ testCapsInit(void) =20 failure: g_clear_object(&caps); - virObjectUnref(xmlopt); + g_clear_object(&xmlopt); } =20 static int @@ -291,7 +291,7 @@ mymain(void) DO_TEST("datacenterpath", "datacenterpath", 4); =20 g_clear_object(&caps); - virObjectUnref(xmlopt); + g_clear_object(&xmlopt); =20 return result =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } --=20 2.26.2