From nobody Mon Feb 9 07:42:16 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=1585927013; cv=none; d=zohomail.com; s=zohoarc; b=LBeN0YemVjGHC9KilA3Qo5EfeP6gFVHjiHl4eaNoTAZ10bOxhMZZPq19EclfzV4dHYFBHk7WbiSj9pWt/5Rd/jHtVa2xQ1zCITZcTs3kH9lRKtYvvH9/Db7uDED8b7ARVPTWeZdZ7j4Eud2VrLE5KH9XNqFyRvm1hbnnHg++lnI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585927013; 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=4NlCfFsv04HwwxvJxn4O7B55ZaqTlLptehyowcbMuIA=; b=A5Il26LC14HPKVY/C92Wiwb4XF9KpRHOGKgSUXysXMFuIq/JRCZcB+4AUSfXBZfsN7sMeqgaTlolSf/aHaAjsVnw8aa9avZbqPZUZ3NDqT2uV8ZJnwnB30wzi5LY3+Fl5U+hP2KSaJHQX07ngGGZ5uJiTAAdZ3EvdgL7W1EFZJ0= 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 1585927013439644.3862731527715; Fri, 3 Apr 2020 08:16:53 -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-129-8_de5rurMNOMpGNZBwWFgA-1; Fri, 03 Apr 2020 11:16:49 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2A54BDBAB; Fri, 3 Apr 2020 15:16:42 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0018A5C557; Fri, 3 Apr 2020 15:16:41 +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 A6D2A18089CE; Fri, 3 Apr 2020 15:16:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 033FGUdJ028090 for ; Fri, 3 Apr 2020 11:16:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1396D2166B2E; Fri, 3 Apr 2020 15:16:30 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0FC1D2166B2C for ; Fri, 3 Apr 2020 15:16:30 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (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 E521D101A55F for ; Fri, 3 Apr 2020 15:16:29 +0000 (UTC) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-156-zCxWJIfjP9OZFr2vMwP_fQ-1; Fri, 03 Apr 2020 11:16:27 -0400 Received: by mail-wm1-f65.google.com with SMTP id d202so8150952wmd.1 for ; Fri, 03 Apr 2020 08:16:26 -0700 (PDT) Received: from localhost.localdomain (public-gprs375156.centertel.pl. [37.47.96.181]) by smtp.gmail.com with ESMTPSA id p13sm12331045wru.3.2020.04.03.08.16.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2020 08:16:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585927012; 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=4NlCfFsv04HwwxvJxn4O7B55ZaqTlLptehyowcbMuIA=; b=E8/w19zmmVndbwhSTH4X4wdQvxCx0pokoC9BFkqjp3Ay9NlL9hnfZ+g3sTbpsXUwklkcsJ MNPp9ZqVZ6Zehww4PcPQ89z4+j+jesG2OXDbcTg9uxJ+yC/9FrEXxIZ29fnjt6cLBi7BIm tC05MA7PXGBBsQgO4pEkOV9bmlnZzZk= X-MC-Unique: 8_de5rurMNOMpGNZBwWFgA-1 X-MC-Unique: zCxWJIfjP9OZFr2vMwP_fQ-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=ZPFCuvJCsYSSgvymmBSvXJGbuZF8IumDG63WXBzRe2Y=; b=dkYn+RVUFFwVF83gl5O9zSukZLhUcYvkYS9uBi6B3kAerRx/yzySOKcFPyuAtL5wWk LKhPMs0WbsixvKhWplmBxdahDAHkGCzV3fdM2aSyVfeI+C+t5FzGLz1DRHqIyjIlhCYz 419yBDoZWuLZQXve+hPnSSgai0j1iP2uV6qiM+rv3mqjn7CAOHxm/Rrmf2jbqOErtIaY SA4N0Lycztj2RuhJLJFhiPwv+HBTtZGGF7YvnPoR2h5D1yz2jNhmygliy8XNVTMIXXZf +2ywG7IiDGADcnWA45gOa67yFyWLoZ4w3JyHsP8xmf9DyKllrhG7IQgxY+XlLQjqlqsM Nuow== X-Gm-Message-State: AGi0PuYcHDmi4rNxTJA2yX5I/apXf5+adixWX+RoOZ4qcVLQHaUU8Cdb 4T0pbvJRvi7QZ7EFdakKVDu47dZbKY4= X-Google-Smtp-Source: APiQypIOzRQ+d2K75SP1Yt43HhVKYBrUUQOHJiAHABdcuSrkNX6xqgayhn0q3DCv0l9Y1jX1mcuLEA== X-Received: by 2002:a1c:7301:: with SMTP id d1mr9629521wmb.26.1585926985125; Fri, 03 Apr 2020 08:16:25 -0700 (PDT) From: Rafael Fonseca To: libvir-list@redhat.com Subject: [PATCH 06/36] conf: convert virDomainXMLOption to GObject Date: Fri, 3 Apr 2020 17:15:34 +0200 Message-Id: <20200403151604.106616-7-r4f4rfs@gmail.com> In-Reply-To: <20200403151604.106616-1-r4f4rfs@gmail.com> References: <20200403151604.106616-1-r4f4rfs@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 033FGUdJ028090 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.79 on 10.5.11.16 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 | 3 ++- src/conf/domain_conf.c | 29 +++++++++++++++++++---------- src/conf/domain_conf.h | 9 +++++++++ src/esx/esx_driver.c | 3 ++- src/libxl/libxl_driver.c | 3 ++- src/lxc/lxc_controller.c | 3 ++- src/lxc/lxc_driver.c | 3 ++- src/openvz/openvz_conf.c | 3 ++- src/qemu/qemu_driver.c | 3 ++- src/qemu/qemu_process.c | 15 +++++---------- src/security/virt-aa-helper.c | 3 ++- src/test/test_driver.c | 3 ++- src/vbox/vbox_common.c | 3 ++- src/vmware/vmware_conf.c | 3 ++- src/vz/vz_driver.c | 3 ++- tests/bhyveargv2xmltest.c | 2 +- tests/bhyvexml2argvtest.c | 2 +- tests/bhyvexml2xmltest.c | 2 +- tests/domainconftest.c | 3 ++- tests/genericxml2xmltest.c | 3 ++- tests/openvzutilstest.c | 2 +- tests/testutilslxc.c | 3 ++- tests/testutilsqemu.c | 3 ++- tests/testutilsxen.c | 3 ++- tests/vmx2xmltest.c | 3 ++- tests/xml2vmxtest.c | 6 ++++-- 26 files changed, 77 insertions(+), 44 deletions(-) diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c index 4ca3666700..2224395128 100644 --- a/src/bhyve/bhyve_driver.c +++ b/src/bhyve/bhyve_driver.c @@ -1183,7 +1183,8 @@ bhyveStateCleanup(void) virObjectUnref(bhyve_driver->domains); if (bhyve_driver->caps) g_object_unref(bhyve_driver->caps); - virObjectUnref(bhyve_driver->xmlopt); + if (bhyve_driver->xmlopt) + g_object_unref(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 425a6bccb6..38a0c04c1f 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -71,7 +71,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; @@ -1273,18 +1273,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 @@ -1292,12 +1300,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 /** @@ -1424,8 +1434,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 33875d942f..7e2792ae62 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, @@ -2800,6 +2802,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 f893d112d0..354f5cbe69 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -71,7 +71,8 @@ esxFreePrivate(esxPrivate **priv) esxUtil_FreeParsedUri(&(*priv)->parsedUri); if ((*priv)->caps) g_object_unref((*priv)->caps); - virObjectUnref((*priv)->xmlopt); + if ((*priv)->xmlopt) + g_object_unref((*priv)->xmlopt); VIR_FREE(*priv); } =20 diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 7ec4fcc3d1..6564b45ee4 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -507,7 +507,8 @@ libxlStateCleanup(void) return -1; =20 virObjectUnref(libxl_driver->hostdevMgr); - virObjectUnref(libxl_driver->xmlopt); + if (libxl_driver->xmlopt) + g_object_unref(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 2369704ac6..4c038c6228 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -180,7 +180,8 @@ virLXCControllerDriverFree(virLXCDriverPtr driver) { if (!driver) return; - virObjectUnref(driver->xmlopt); + if (driver->xmlopt) + g_object_unref(driver->xmlopt); if (driver->caps) g_object_unref(driver->caps); virMutexDestroy(&driver->lock); diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 1c59ddef6d..5da9ec7c58 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -1614,7 +1614,8 @@ static int lxcStateCleanup(void) if (lxc_driver->caps) g_object_unref(lxc_driver->caps); virObjectUnref(lxc_driver->securityManager); - virObjectUnref(lxc_driver->xmlopt); + if (lxc_driver->xmlopt) + g_object_unref(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 1f70bfc3d9..a62e536aa0 100644 --- a/src/openvz/openvz_conf.c +++ b/src/openvz/openvz_conf.c @@ -479,7 +479,8 @@ openvzFreeDriver(struct openvz_driver *driver) if (!driver) return; =20 - virObjectUnref(driver->xmlopt); + if (driver->xmlopt) + g_object_unref(driver->xmlopt); virObjectUnref(driver->domains); if (driver->caps) g_object_unref(driver->caps); diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 99a5058033..73f1037e8a 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -1131,7 +1131,8 @@ qemuStateCleanup(void) virObjectUnref(qemu_driver->securityManager); virObjectUnref(qemu_driver->domainEventState); virObjectUnref(qemu_driver->qemuCapsCache); - virObjectUnref(qemu_driver->xmlopt); + if (qemu_driver->xmlopt) + g_object_unref(qemu_driver->xmlopt); virCPUDefFree(qemu_driver->hostcpu); virCapabilitiesHostNUMAUnref(qemu_driver->hostnuma); if (qemu_driver->caps) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 3f28c5245c..ef34dd8cfd 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -8567,9 +8567,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); @@ -8581,25 +8580,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 7b0ae6acad..cbf4a567d5 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -81,7 +81,8 @@ vahDeinit(vahControl * ctl) VIR_FREE(ctl->def); if (ctl->caps) g_object_unref(ctl->caps); - virObjectUnref(ctl->xmlopt); + if (ctl->xmlopt) + g_object_unref(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 00c3d34a81..1696b956fe 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -160,7 +160,8 @@ testDriverDispose(void *obj) =20 if (driver->caps) g_object_unref(driver->caps); - virObjectUnref(driver->xmlopt); + if (driver->xmlopt) + g_object_unref(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 0e009a5739..60018668ca 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -124,7 +124,8 @@ vboxDriverDispose(void *obj) =20 if (driver->caps) g_object_unref(driver->caps); - virObjectUnref(driver->xmlopt); + if (driver->xmlopt) + g_object_unref(driver->xmlopt); } =20 static int diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_conf.c index ee21e96971..e5e3ee33a5 100644 --- a/src/vmware/vmware_conf.c +++ b/src/vmware/vmware_conf.c @@ -56,7 +56,8 @@ vmwareFreeDriver(struct vmware_driver *driver) virObjectUnref(driver->domains); if (driver->caps) g_object_unref(driver->caps); - virObjectUnref(driver->xmlopt); + if (driver->xmlopt) + g_object_unref(driver->xmlopt); VIR_FREE(driver->vmrun); VIR_FREE(driver); } diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c index 517259131d..ab06071731 100644 --- a/src/vz/vz_driver.c +++ b/src/vz/vz_driver.c @@ -150,7 +150,8 @@ static void vzDriverDispose(void * obj) virObjectUnref(driver->domains); if (driver->caps) g_object_unref(driver->caps); - virObjectUnref(driver->xmlopt); + if (driver->xmlopt) + g_object_unref(driver->xmlopt); virObjectUnref(driver->domainEventState); virSysinfoDefFree(driver->hostsysinfo); } diff --git a/tests/bhyveargv2xmltest.c b/tests/bhyveargv2xmltest.c index 5de5b48a8e..3cc6ca8b38 100644 --- a/tests/bhyveargv2xmltest.c +++ b/tests/bhyveargv2xmltest.c @@ -196,7 +196,7 @@ mymain(void) DO_TEST_FAIL("extraargs"); =20 g_object_unref(driver.caps); - virObjectUnref(driver.xmlopt); + g_object_unref(driver.xmlopt); =20 return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } diff --git a/tests/bhyvexml2argvtest.c b/tests/bhyvexml2argvtest.c index 9ea0d76f06..48abb436d0 100644 --- a/tests/bhyvexml2argvtest.c +++ b/tests/bhyvexml2argvtest.c @@ -250,7 +250,7 @@ mymain(void) DO_TEST_FAILURE("cputopology"); =20 g_object_unref(driver.caps); - virObjectUnref(driver.xmlopt); + g_object_unref(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 cb0f6022c3..add96d4859 100644 --- a/tests/bhyvexml2xmltest.c +++ b/tests/bhyvexml2xmltest.c @@ -128,7 +128,7 @@ mymain(void) DO_TEST_DIFFERENT("input-xhci-tablet"); =20 g_object_unref(driver.caps); - virObjectUnref(driver.xmlopt); + g_object_unref(driver.xmlopt); =20 return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } diff --git a/tests/domainconftest.c b/tests/domainconftest.c index ada397b925..c19da1ae97 100644 --- a/tests/domainconftest.c +++ b/tests/domainconftest.c @@ -105,7 +105,8 @@ mymain(void) =20 if (caps) g_object_unref(caps); - virObjectUnref(xmlopt); + if (xmlopt) + g_object_unref(xmlopt); =20 cleanup: return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; diff --git a/tests/genericxml2xmltest.c b/tests/genericxml2xmltest.c index 0659ca1b28..339d1478a3 100644 --- a/tests/genericxml2xmltest.c +++ b/tests/genericxml2xmltest.c @@ -197,7 +197,8 @@ mymain(void) =20 if (caps) g_object_unref(caps); - virObjectUnref(xmlopt); + if (xmlopt) + g_object_unref(xmlopt); =20 return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } diff --git a/tests/openvzutilstest.c b/tests/openvzutilstest.c index 48de2d1c7d..2fd21fc718 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_object_unref(driver.xmlopt); g_object_unref(driver.caps); VIR_FREE(actual); virDomainDefFree(def); diff --git a/tests/testutilslxc.c b/tests/testutilslxc.c index 2f28975332..ad2afdd683 100644 --- a/tests/testutilslxc.c +++ b/tests/testutilslxc.c @@ -76,7 +76,8 @@ testLXCDriverInit(void) void testLXCDriverFree(virLXCDriverPtr driver) { - virObjectUnref(driver->xmlopt); + if (driver->xmlopt) + g_object_unref(driver->xmlopt); if (driver->caps) g_object_unref(driver->caps); virMutexDestroy(&driver->lock); diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index dd8143ff55..a37865bc14 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -307,7 +307,8 @@ void qemuTestDriverFree(virQEMUDriver *driver) virFileDeleteTree(driver->config->configDir); } virObjectUnref(driver->qemuCapsCache); - virObjectUnref(driver->xmlopt); + if (driver->xmlopt) + g_object_unref(driver->xmlopt); if (driver->caps) g_object_unref(driver->caps); virObjectUnref(driver->config); diff --git a/tests/testutilsxen.c b/tests/testutilsxen.c index 7da90cdd1e..6b6b0bf038 100644 --- a/tests/testutilsxen.c +++ b/tests/testutilsxen.c @@ -112,7 +112,8 @@ libxlDriverPrivatePtr testXLInitDriver(void) void testXLFreeDriver(libxlDriverPrivatePtr driver) { virObjectUnref(driver->config); - virObjectUnref(driver->xmlopt); + if (driver->xmlopt) + g_object_unref(driver->xmlopt); virMutexDestroy(&driver->lock); g_free(driver); } diff --git a/tests/vmx2xmltest.c b/tests/vmx2xmltest.c index b5c557fe33..c87b60fc78 100644 --- a/tests/vmx2xmltest.c +++ b/tests/vmx2xmltest.c @@ -282,7 +282,8 @@ mymain(void) DO_TEST("datacenterpath", "datacenterpath"); =20 g_object_unref(caps); - virObjectUnref(xmlopt); + if (xmlopt) + g_object_unref(xmlopt); =20 return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } diff --git a/tests/xml2vmxtest.c b/tests/xml2vmxtest.c index d6c7eb4f53..735df01e56 100644 --- a/tests/xml2vmxtest.c +++ b/tests/xml2vmxtest.c @@ -61,7 +61,8 @@ testCapsInit(void) failure: if (caps) g_clear_object(&caps); - virObjectUnref(xmlopt); + if (xmlopt) + g_object_unref(xmlopt); } =20 static int @@ -292,7 +293,8 @@ mymain(void) DO_TEST("datacenterpath", "datacenterpath", 4); =20 g_object_unref(caps); - virObjectUnref(xmlopt); + if (xmlopt) + g_object_unref(xmlopt); =20 return result =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } --=20 2.25.1