From nobody Sun May 5 05:28:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1629895441; cv=none; d=zohomail.com; s=zohoarc; b=jU3DqFq1JTkdDqkccCUhslzjF14sP5sD3EL/KoaB60aD0ev4myZGviIQXO4a22VOCjG0VDDaV55l+wQoCO8AzUwgXTRyFHYH36GHifDSLM/ZXwn1q2RBBgj0WfxS4TiRNjDJaxcP1L0ZBFOlnAUb+dXL2ZaPW0woKoHXatR550g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629895441; 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=im08lVGyaRIUtVKlPsiI4Odye7HPqxKOgRBiHtwXArk=; b=R052+PoUlS6oXk30WTAE50BPTk3pQ5QKW0MNIEuSyBo/uxfq2xUK1OTXdShcFcs2HCgfvPLQcK/uGgvmtEnSPUxKdaRNLDlboYrKUtEZt4LK2HOas/vJ5EKy98uL7JmI8YiwwcKwAxvP4+wwk/DxLex3fMzwS1aW+0xIFFRGBCw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1629895441026425.89683415998184; Wed, 25 Aug 2021 05:44:01 -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-16-Nhl_txvtN9-P85EgiFwnug-1; Wed, 25 Aug 2021 08:43:46 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7650AC73A0; Wed, 25 Aug 2021 12:43:41 +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 588FD1B400; Wed, 25 Aug 2021 12:43: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 0C81A1821888; Wed, 25 Aug 2021 12:43:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17PChcHP013595 for ; Wed, 25 Aug 2021 08:43:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3B37A1ABD2; Wed, 25 Aug 2021 12:43:38 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.192.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 254221ABDF; Wed, 25 Aug 2021 12:43:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629895440; 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=im08lVGyaRIUtVKlPsiI4Odye7HPqxKOgRBiHtwXArk=; b=M2raq5jaMSj8FQUV3fFP0oZtW3RMVz8OHlAUBhrqZRvDbCxEaoBj8uUArGVpwGtKvCc4w0 +AY3qF3EFJx6rt5rVvprkc1yUEkCZZvoP38DsIffYxp46DxqxO+0KzwDlyXUe9kDNu6ZlD GWWOi3w8utDRttbc3rgUzoYmEszWkVY= X-MC-Unique: Nhl_txvtN9-P85EgiFwnug-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 01/11] glibcompat: Add wrapper for g_auto* Date: Wed, 25 Aug 2021 14:43:20 +0200 Message-Id: <20210825124330.84282-2-twiederh@redhat.com> In-Reply-To: <20210825124330.84282-1-twiederh@redhat.com> References: <20210825124330.84282-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1629895442948100001 Content-Type: text/plain; charset="utf-8" See comment for rationale. Signed-off-by: Tim Wiederhake --- src/util/glibcompat.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/util/glibcompat.h b/src/util/glibcompat.h index 697687b967..fe495c5c32 100644 --- a/src/util/glibcompat.h +++ b/src/util/glibcompat.h @@ -86,3 +86,23 @@ char *vir_g_strdup_vprintf(const char *msg, va_list args) #define g_fsync vir_g_fsync =20 void vir_g_source_unref(GSource *src, GMainContext *ctx); + +/* + * Clang falsely tags variable definitions as unused if the only access ha= ppens + * during the variables destruction at scope exit. See + * https://bugs.llvm.org/show_bug.cgi?id=3D3888 and + * https://bugs.llvm.org/show_bug.cgi?id=3D43482. + */ +#if defined(__clang__) +# define vir_g_auto(X) g_auto(X) G_GNUC_UNUSED +# define vir_g_autolist(X) g_autolist(X) G_GNUC_UNUSED +# define vir_g_autoptr(X) g_autoptr(X) G_GNUC_UNUSED +# define vir_g_autoqueue(X) g_autoqueue(X) G_GNUC_UNUSED +# define vir_g_autoslist(X) g_autoslist(X) G_GNUC_UNUSED +#else +# define vir_g_auto(X) g_auto(X) +# define vir_g_autolist(X) g_autolist(X) +# define vir_g_autoptr(X) g_autoptr(X) +# define vir_g_autoqueue(X) g_autoqueue(X) +# define vir_g_autoslist(X) g_autoslist(X) +#endif /* __clang__ */ --=20 2.31.1 From nobody Sun May 5 05:28:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1629895504; cv=none; d=zohomail.com; s=zohoarc; b=klaXdGMWijLZ9wBsnJb/YA5XyuQKeuHyYdZ+0hL3HppD1gldkGyZHOteqWjfmg+C9KDuKKVWMJGxxREAzSCdFegIMhSXdHEo/gUiKMvf0FYm/nNR+7EJITpvUwerirPFcuJu6P10p+04IPRBzd/m8UrplfY6chZ9j/UvFdVjbQM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629895504; 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=eYBF08TY2Qp34GYnEjiQG0CxmUyBbppFjym5jD1+ryo=; b=mgdDBk38INROusAyUzFi8Ll3c2gwcMdxujgbSJUnFHkQdIhxdAnzJitdw95vlRDtDow+5DujvAihlHGpzRjMh76fBNX7W+SNq3/Tn6cDK1z/7cOFR/kG+xFsyQK1kMB3Zv9pypdeLn4tToe+3MiOteC99oStQ/0gXMq0CoaofmM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1629895504744231.35463941936723; Wed, 25 Aug 2021 05:45:04 -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-249-W1pkc8yFNUSZ_LbQNntACA-1; Wed, 25 Aug 2021 08:43:56 -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 8131A802928; Wed, 25 Aug 2021 12:43:48 +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 545A09D62; Wed, 25 Aug 2021 12:43:48 +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 1C7A8182188E; Wed, 25 Aug 2021 12:43:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17PCheWe013602 for ; Wed, 25 Aug 2021 08:43:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id 19FEA1ABDF; Wed, 25 Aug 2021 12:43:40 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.192.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id AEBA3669ED; Wed, 25 Aug 2021 12:43:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629895503; 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=eYBF08TY2Qp34GYnEjiQG0CxmUyBbppFjym5jD1+ryo=; b=QywHLbPc5qoBxTYis/jgjdd0ypy2dzCmNWRQS9yZp5enAuaE95r+dODbTFVdm1j4rDqfTH hd05EJ0NaI1Bfye1+GoTefvlh3RqcO9agyzt2/9bXNx65q61D++7ZWUTfoV5b7wpuywwYa OgM+lRcDDyyNqLYnwismTY14pAK/ER8= X-MC-Unique: W1pkc8yFNUSZ_LbQNntACA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 02/11] VIR_XPATH_NODE_AUTORESTORE: Add semicolon Date: Wed, 25 Aug 2021 14:43:21 +0200 Message-Id: <20210825124330.84282-3-twiederh@redhat.com> In-Reply-To: <20210825124330.84282-1-twiederh@redhat.com> References: <20210825124330.84282-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1629895506753100003 Content-Type: text/plain; charset="utf-8" This is preparation for the next patch which will make the use of a semicolon after VIR_XPATH_NODE_AUTORESTORE mandatory. Signed-off-by: Tim Wiederhake --- src/conf/backup_conf.c | 2 +- src/conf/checkpoint_conf.c | 2 +- src/conf/cpu_conf.c | 2 +- src/conf/domain_conf.c | 140 ++++++++++++++--------------- src/conf/interface_conf.c | 8 +- src/conf/netdev_vlan_conf.c | 2 +- src/conf/network_conf.c | 14 +-- src/conf/networkcommon_conf.c | 2 +- src/conf/node_device_conf.c | 42 ++++----- src/conf/numa_conf.c | 6 +- src/conf/snapshot_conf.c | 2 +- src/conf/storage_adapter_conf.c | 2 +- src/conf/storage_conf.c | 4 +- src/conf/storage_encryption_conf.c | 4 +- src/conf/storage_source_conf.c | 2 +- src/conf/virsavecookie.c | 2 +- src/cpu/cpu_map.c | 4 +- src/cpu/cpu_x86.c | 2 +- src/lxc/lxc_domain.c | 2 +- src/qemu/qemu_capabilities.c | 2 +- src/qemu/qemu_domain.c | 8 +- src/qemu/qemu_domainjob.c | 2 +- src/qemu/qemu_migration_cookie.c | 8 +- 23 files changed, 132 insertions(+), 132 deletions(-) diff --git a/src/conf/backup_conf.c b/src/conf/backup_conf.c index 694553a544..9c67f5c232 100644 --- a/src/conf/backup_conf.c +++ b/src/conf/backup_conf.c @@ -102,7 +102,7 @@ virDomainBackupDiskDefParseXML(xmlNodePtr node, unsigned int flags, virDomainXMLOption *xmlopt) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); g_autofree char *type =3D NULL; g_autofree char *format =3D NULL; g_autofree char *idx =3D NULL; diff --git a/src/conf/checkpoint_conf.c b/src/conf/checkpoint_conf.c index 175a95fed7..aebdc2cb6d 100644 --- a/src/conf/checkpoint_conf.c +++ b/src/conf/checkpoint_conf.c @@ -96,7 +96,7 @@ virDomainCheckpointDiskDefParseXML(xmlNodePtr node, virDomainCheckpointDiskDef *def) { g_autofree char *checkpoint =3D NULL; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D node; =20 diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c index 1674cd6957..c42083d018 100644 --- a/src/conf/cpu_conf.c +++ b/src/conf/cpu_conf.c @@ -320,7 +320,7 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt, { g_autoptr(virCPUDef) def =3D NULL; g_autofree xmlNodePtr *nodes =3D NULL; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); int n; size_t i; g_autofree char *cpuMode =3D NULL; diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 6127513117..039199542e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1695,7 +1695,7 @@ virDomainBlkioDeviceParseXML(xmlNodePtr root, g_autofree char *write_bytes_sec =3D NULL; g_autofree char *read_iops_sec =3D NULL; g_autofree char *write_iops_sec =3D NULL; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D root; =20 @@ -6649,7 +6649,7 @@ virDomainDeviceInfoParseXML(virDomainXMLOption *xmlop= t, xmlNodePtr rom =3D NULL; int ret =3D -1; g_autofree char *aliasStr =3D NULL; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 virDomainDeviceInfoClear(info); ctxt->node =3D node; @@ -6721,7 +6721,7 @@ virDomainHostdevSubsysUSBDefParseXML(xmlNodePtr node, xmlNodePtr productNode; xmlNodePtr addressNode; virTristateBool autoAddress; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D node; =20 @@ -6823,7 +6823,7 @@ virDomainHostdevSubsysPCIDefParseXML(xmlNodePtr node, g_autofree char *filtering =3D NULL; xmlNodePtr address =3D NULL; xmlNodePtr origstates =3D NULL; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D node; =20 @@ -6922,7 +6922,7 @@ virDomainStorageNetworkParseHosts(xmlNodePtr node, g_autofree xmlNodePtr *hostnodes =3D NULL; ssize_t nhostnodes; size_t i; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D node; =20 @@ -6967,7 +6967,7 @@ virDomainHostdevSubsysSCSIHostDefParseXML(xmlNodePtr = sourcenode, { virDomainHostdevSubsysSCSIHost *scsihostsrc =3D &scsisrc->u.host; xmlNodePtr addressnode =3D NULL; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D sourcenode; =20 @@ -7019,7 +7019,7 @@ virDomainHostdevSubsysSCSIiSCSIDefParseXML(xmlNodePtr= sourcenode, virDomainHostdevSubsysSCSIiSCSI *iscsisrc =3D &def->u.iscsi; g_autoptr(virStorageAuthDef) authdef =3D NULL; xmlNodePtr node; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D sourcenode; =20 @@ -7509,7 +7509,7 @@ virDomainNetDefCoalesceParseXML(xmlNodePtr node, xmlXPathContextPtr ctxt, virNetDevCoalesce **coalesce) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); unsigned long long tmp =3D 0; g_autofree char *str =3D NULL; =20 @@ -7880,7 +7880,7 @@ virSecurityLabelDefsParseXML(virDomainDef *def, virDomainXMLOption *xmlopt, unsigned int flags) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); size_t i =3D 0, j; int n; g_autofree xmlNodePtr *list =3D NULL; @@ -7977,7 +7977,7 @@ virSecurityDeviceLabelDefParseXML(virSecurityDeviceLa= belDef ***seclabels_rtn, xmlXPathContextPtr ctxt, unsigned int flags) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); virSecurityDeviceLabelDef **seclabels =3D NULL; size_t nseclabels =3D 0; int n; @@ -8069,7 +8069,7 @@ virDomainLeaseDefParseXML(xmlNodePtr node, g_autofree char *key =3D NULL; g_autofree char *path =3D NULL; xmlNodePtr targetNode =3D NULL; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D node; def =3D g_new0(virDomainLeaseDef, 1); @@ -8160,7 +8160,7 @@ static virStorageNetCookieDef * virDomainStorageNetCookieParse(xmlNodePtr node, xmlXPathContextPtr ctxt) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); g_autoptr(virStorageNetCookieDef) cookie =3D NULL; =20 ctxt->node =3D node; @@ -8187,7 +8187,7 @@ virDomainStorageNetCookiesParse(xmlNodePtr node, xmlXPathContextPtr ctxt, virStorageSource *src) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); g_autofree xmlNodePtr *nodes =3D NULL; ssize_t nnodes; size_t i; @@ -8423,7 +8423,7 @@ virDomainDiskSourcePRParse(xmlNodePtr node, xmlXPathContextPtr ctxt, virStoragePRDef **pr) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D node; =20 @@ -8476,7 +8476,7 @@ static virStorageSourceSlice * virDomainStorageSourceParseSlice(xmlNodePtr node, xmlXPathContextPtr ctxt) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); g_autofree char *offset =3D NULL; g_autofree char *size =3D NULL; g_autofree virStorageSourceSlice *ret =3D g_new0(virStorageSourceSlice= , 1); @@ -8542,7 +8542,7 @@ virDomainStorageSourceParse(xmlNodePtr node, unsigned int flags, virDomainXMLOption *xmlopt) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); xmlNodePtr tmp; =20 ctxt->node =3D node; @@ -8624,7 +8624,7 @@ virDomainDiskBackingStoreParse(xmlXPathContextPtr ctx= t, unsigned int flags, virDomainXMLOption *xmlopt) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); xmlNodePtr source; g_autoptr(virStorageSource) backingStore =3D NULL; g_autofree char *type =3D NULL; @@ -8767,7 +8767,7 @@ virDomainDiskDefMirrorParse(virDomainDiskDef *def, virDomainXMLOption *xmlopt) { xmlNodePtr mirrorNode; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); g_autofree char *mirrorFormat =3D NULL; g_autofree char *mirrorType =3D NULL; g_autofree char *ready =3D NULL; @@ -8872,7 +8872,7 @@ virDomainDiskDefDriverParseXML(virDomainDiskDef *def, xmlNodePtr cur, xmlXPathContextPtr ctxt) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D cur; =20 @@ -8940,7 +8940,7 @@ virDomainDiskDefDriverSourceParseXML(virStorageSource= *src, xmlXPathContextPtr ctxt) { g_autofree char *tmp =3D NULL; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D cur; =20 @@ -8973,7 +8973,7 @@ virDomainDiskDefParsePrivateData(xmlXPathContextPtr c= txt, virDomainXMLOption *xmlopt) { xmlNodePtr private_node =3D virXPathNode("./privateData", ctxt); - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 if (!xmlopt || !xmlopt->privateData.diskParse || @@ -8996,7 +8996,7 @@ virDomainDiskDefParseSourceXML(virDomainXMLOption *xm= lopt, unsigned int flags) { g_autoptr(virStorageSource) src =3D virStorageSourceNew(); - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); g_autofree char *type =3D NULL; xmlNodePtr tmp; =20 @@ -9076,7 +9076,7 @@ virDomainDiskDefParseXML(virDomainXMLOption *xmlopt, unsigned int flags) { g_autoptr(virDomainDiskDef) def =3D NULL; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); xmlNodePtr sourceNode; xmlNodePtr targetNode; xmlNodePtr geometryNode; @@ -9433,7 +9433,7 @@ virDomainControllerDefParseXML(virDomainXMLOption *xm= lopt, int nmodelNodes =3D 0; int numaNode =3D -1; int ports; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); int rc; g_autofree char *idx =3D NULL; g_autofree char *model =3D NULL; @@ -9701,7 +9701,7 @@ virDomainFSDefParseXML(virDomainXMLOption *xmlopt, xmlXPathContextPtr ctxt, unsigned int flags) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); virDomainFSDef *def; xmlNodePtr driver_node =3D NULL; xmlNodePtr source_node =3D NULL; @@ -9961,7 +9961,7 @@ virDomainActualNetDefParseXML(xmlNodePtr node, { virDomainActualNetDef *actual =3D NULL; int ret =3D -1; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); xmlNodePtr bandwidth_node =3D NULL; xmlNodePtr vlanNode; xmlNodePtr virtPortNode; @@ -10141,7 +10141,7 @@ virDomainChrSourceReconnectDefParseXML(virDomainChr= SourceReconnectDef *def, xmlNodePtr node, xmlXPathContextPtr ctxt) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); xmlNodePtr cur; =20 ctxt->node =3D node; @@ -10208,7 +10208,7 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt, xmlNodePtr tmpNode; GHashTable *filterparams =3D NULL; virDomainActualNetDef *actual =3D NULL; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); virDomainChrSourceReconnectDef reconnect =3D {0}; int rv, val; g_autofree char *macaddr =3D NULL; @@ -11025,7 +11025,7 @@ virDomainChrDefParseTargetXML(virDomainChrDef *def, g_autofree char *targetModel =3D NULL; g_autofree char *addrStr =3D NULL; g_autofree char *portStr =3D NULL; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D cur; =20 @@ -11294,7 +11294,7 @@ virDomainChrSourceDefParseXML(virDomainChrSourceDef= *def, int nprotocols =3D 0; g_autofree xmlNodePtr *sources =3D NULL; int nsources =3D 0; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D cur; =20 @@ -11515,7 +11515,7 @@ virDomainChrDefParseXML(virDomainXMLOption *xmlopt, const char *nodeName; virDomainChrDef *def; g_autofree char *type =3D NULL; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D node; =20 @@ -11592,7 +11592,7 @@ virDomainSmartcardDefParseXML(virDomainXMLOption *x= mlopt, g_autofree char *type =3D NULL; g_autofree xmlNodePtr *certificates =3D NULL; int n =3D 0; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D node; def =3D g_new0(virDomainSmartcardDef, 1); @@ -11722,7 +11722,7 @@ virDomainTPMDefParseXML(virDomainXMLOption *xmlopt, unsigned int flags) { virDomainTPMDef *def; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); int nbackends; g_autofree char *path =3D NULL; g_autofree char *model =3D NULL; @@ -11865,7 +11865,7 @@ virDomainInputDefParseXML(virDomainXMLOption *xmlop= t, xmlXPathContextPtr ctxt, unsigned int flags) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); virDomainInputDef *def; g_autofree char *type =3D NULL; g_autofree char *bus =3D NULL; @@ -12090,7 +12090,7 @@ virDomainTimerDefParseXML(xmlNodePtr node, xmlXPathContextPtr ctxt) { virDomainTimerDef *def; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); xmlNodePtr catchup; int ret; g_autofree char *name =3D NULL; @@ -12420,7 +12420,7 @@ virDomainGraphicsListensParseXML(virDomainGraphicsD= ef *def, xmlXPathContextPtr ctxt, unsigned int flags) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); virDomainGraphicsListenDef newListen =3D {0}; int nListens; int ret =3D -1; @@ -12503,7 +12503,7 @@ virDomainGraphicsDefParseXMLVNC(virDomainGraphicsDe= f *def, g_autofree char *websocketGenerated =3D virXMLPropString(node, "websoc= ketGenerated"); g_autofree char *autoport =3D virXMLPropString(node, "autoport"); xmlNodePtr audioNode; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 if (virDomainGraphicsListensParseXML(def, node, ctxt, flags) < 0) return -1; @@ -12573,7 +12573,7 @@ virDomainGraphicsDefParseXMLSDL(virDomainGraphicsDe= f *def, xmlNodePtr node, xmlXPathContextPtr ctxt) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); xmlNodePtr glNode; virTristateBool fullscreen; =20 @@ -12670,7 +12670,7 @@ virDomainGraphicsDefParseXMLSpice(virDomainGraphics= Def *def, size_t i =3D 0; virTristateBool autoport; xmlNodePtr cur; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D node; =20 @@ -12827,7 +12827,7 @@ virDomainGraphicsDefParseXMLEGLHeadless(virDomainGr= aphicsDef *def, xmlNodePtr node, xmlXPathContextPtr ctxt) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); xmlNodePtr glNode; =20 ctxt->node =3D node; @@ -12955,7 +12955,7 @@ virDomainSoundDefParseXML(virDomainXMLOption *xmlop= t, unsigned int flags) { virDomainSoundDef *def; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); xmlNodePtr audioNode; =20 def =3D g_new0(virDomainSoundDef, 1); @@ -13199,7 +13199,7 @@ virDomainAudioDefParseXML(virDomainXMLOption *xmlop= t G_GNUC_UNUSED, xmlXPathContextPtr ctxt) { virDomainAudioDef *def; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); xmlNodePtr inputNode, outputNode; =20 def =3D g_new0(virDomainAudioDef, 1); @@ -13387,7 +13387,7 @@ virDomainRNGDefParseXML(virDomainXMLOption *xmlopt, unsigned int flags) { virDomainRNGDef *def; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); int nbackends; g_autofree xmlNodePtr *backends =3D NULL; g_autofree char *model =3D NULL; @@ -13499,7 +13499,7 @@ virDomainMemballoonDefParseXML(virDomainXMLOption *= xmlopt, unsigned int flags) { virDomainMemballoonDef *def; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); xmlNodePtr stats; =20 ctxt->node =3D node; @@ -13575,7 +13575,7 @@ virDomainShmemDefParseXML(virDomainXMLOption *xmlop= t, xmlNodePtr model; xmlNodePtr msi; xmlNodePtr server; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D node; =20 @@ -13645,7 +13645,7 @@ virSysinfoBIOSParseXML(xmlNodePtr node, xmlXPathContextPtr ctxt, virSysinfoBIOSDef **bios) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); int ret =3D -1; virSysinfoBIOSDef *def; =20 @@ -13707,7 +13707,7 @@ virSysinfoSystemParseXML(xmlNodePtr node, unsigned char *domUUID, bool uuid_generated) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); int ret =3D -1; virSysinfoSystemDef *def; g_autofree char *tmpUUID =3D NULL; @@ -13780,7 +13780,7 @@ virSysinfoBaseBoardParseXML(xmlXPathContextPtr ctxt, size_t *nbaseBoard) { size_t i, nboards =3D 0; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); int n; g_autofree virSysinfoBaseBoardDef *boards =3D NULL; g_autofree xmlNodePtr *nodes =3D NULL; @@ -13829,7 +13829,7 @@ virSysinfoOEMStringsParseXML(xmlNodePtr node, xmlXPathContextPtr ctxt, virSysinfoOEMStringsDef **oem) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); int ret =3D -1; virSysinfoOEMStringsDef *def; int nstrings; @@ -13867,7 +13867,7 @@ virSysinfoChassisParseXML(xmlNodePtr node, xmlXPathContextPtr ctxt, virSysinfoChassisDef **chassisdef) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); int ret =3D -1; virSysinfoChassisDef *def; =20 @@ -13951,7 +13951,7 @@ virSysinfoParseFWCfgDef(virSysinfoDef *def, xmlNodePtr node, xmlXPathContextPtr ctxt) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); g_autofree xmlNodePtr *nodes =3D NULL; int n; size_t i; @@ -14012,7 +14012,7 @@ virSysinfoParseXML(xmlNodePtr node, unsigned char *domUUID, bool uuid_generated) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); virSysinfoDef *def; g_autofree char *typeStr =3D NULL; int type; @@ -14170,7 +14170,7 @@ virDomainVideoDriverDefParseXML(xmlNodePtr node, { g_autofree virDomainVideoDriverDef *def =3D NULL; xmlNodePtr driver =3D NULL; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D node; =20 @@ -14197,7 +14197,7 @@ virDomainVideoDefParseXML(virDomainXMLOption *xmlop= t, xmlNodePtr driver; xmlNodePtr accel_node; xmlNodePtr res_node; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); g_autofree char *type =3D NULL; g_autofree char *heads =3D NULL; g_autofree char *vram =3D NULL; @@ -14296,7 +14296,7 @@ virDomainHostdevDefParseXML(virDomainXMLOption *xml= opt, unsigned int flags) { virDomainHostdevDef *def; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); g_autofree char *mode =3D virXMLPropString(node, "mode"); g_autofree char *type =3D virXMLPropString(node, "type"); =20 @@ -14520,7 +14520,7 @@ virDomainRedirFilterDefParseXML(xmlNodePtr node, { int n; size_t i; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); virDomainRedirFilterDef *def =3D NULL; g_autofree xmlNodePtr *nodes =3D NULL; =20 @@ -14642,7 +14642,7 @@ virDomainMemorySourceDefParseXML(xmlNodePtr node, xmlXPathContextPtr ctxt, virDomainMemoryDef *def) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); g_autofree char *nodemask =3D NULL; =20 ctxt->node =3D node; @@ -14696,7 +14696,7 @@ virDomainMemoryTargetDefParseXML(xmlNodePtr node, xmlXPathContextPtr ctxt, virDomainMemoryDef *def) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); int rv; =20 ctxt->node =3D node; @@ -14788,7 +14788,7 @@ static virDomainSecDef * virDomainSecDefParseXML(xmlNodePtr lsecNode, xmlXPathContextPtr ctxt) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); g_autoptr(virDomainSecDef) sec =3D g_new0(virDomainSecDef, 1); =20 ctxt->node =3D lsecNode; @@ -14824,7 +14824,7 @@ virDomainMemoryDefParseXML(virDomainXMLOption *xmlo= pt, xmlXPathContextPtr ctxt, unsigned int flags) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); xmlNodePtr node; virDomainMemoryDef *def; g_autofree char *tmp =3D NULL; @@ -14889,7 +14889,7 @@ static virDomainIOMMUDef * virDomainIOMMUDefParseXML(xmlNodePtr node, xmlXPathContextPtr ctxt) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); xmlNodePtr driver; g_autofree virDomainIOMMUDef *iommu =3D NULL; =20 @@ -14933,7 +14933,7 @@ virDomainVsockDefParseXML(virDomainXMLOption *xmlop= t, xmlXPathContextPtr ctxt, unsigned int flags) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); xmlNodePtr cid; g_autoptr(virDomainVsockDef) vsock =3D NULL; =20 @@ -16905,7 +16905,7 @@ virDomainIdmapDefParseXML(xmlXPathContextPtr ctxt, { size_t i; virDomainIdMapEntry *idmap =3D NULL; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 idmap =3D g_new0(virDomainIdMapEntry, num); =20 @@ -17248,7 +17248,7 @@ virDomainHugepagesParseXML(xmlNodePtr node, xmlXPathContextPtr ctxt, virDomainHugePage *hugepage) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); g_autofree char *nodeset =3D NULL; =20 ctxt->node =3D node; @@ -17283,7 +17283,7 @@ static virDomainResourceDef * virDomainResourceDefParse(xmlNodePtr node, xmlXPathContextPtr ctxt) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); virDomainResourceDef *def =3D NULL; char *partition =3D NULL; char *appid =3D NULL; @@ -18397,7 +18397,7 @@ virDomainCachetuneDefParseCache(xmlXPathContextPtr = ctxt, xmlNodePtr node, virResctrlAlloc *alloc) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); unsigned int level; unsigned int cache; virCacheType type; @@ -18508,7 +18508,7 @@ virDomainResctrlMonDefParse(virDomainDef *def, virDomainResctrlDef *resctrl) { virDomainResctrlMonDef *domresmon =3D NULL; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); unsigned int level =3D 0; size_t i =3D 0; int n =3D 0; @@ -18635,7 +18635,7 @@ virDomainCachetuneDefParse(virDomainDef *def, xmlNodePtr node, unsigned int flags) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); virDomainResctrlDef *resctrl =3D NULL; ssize_t i =3D 0; int n; @@ -18963,7 +18963,7 @@ virDomainMemorytuneDefParseMemory(xmlXPathContextPt= r ctxt, xmlNodePtr node, virResctrlAlloc *alloc) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); unsigned int id; unsigned int bandwidth; =20 @@ -18989,7 +18989,7 @@ virDomainMemorytuneDefParse(virDomainDef *def, xmlNodePtr node, unsigned int flags) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); virDomainResctrlDef *resctrl =3D NULL; virDomainResctrlDef *newresctrl =3D NULL; g_autoptr(virBitmap) vcpus =3D NULL; diff --git a/src/conf/interface_conf.c b/src/conf/interface_conf.c index b45dc37379..ccb8cec4dd 100644 --- a/src/conf/interface_conf.c +++ b/src/conf/interface_conf.c @@ -262,7 +262,7 @@ static int virInterfaceDefParseDhcp(virInterfaceProtocolDef *def, xmlNodePtr dhcp, xmlXPathContextPtr ctxt) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); char *tmp; int ret =3D 0; =20 @@ -420,7 +420,7 @@ static int virInterfaceDefParseIfAdressing(virInterfaceDef *def, xmlXPathContextPtr ctxt) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); xmlNodePtr *protoNodes =3D NULL; int nProtoNodes, pp, ret =3D -1; char *tmp; @@ -544,7 +544,7 @@ virInterfaceDefParseBondItfs(virInterfaceDef *def, xmlXPathContextPtr ctxt) { xmlNodePtr *interfaces =3D NULL; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); virInterfaceDef *itf; int nbItf; size_t i; @@ -682,7 +682,7 @@ virInterfaceDefParseXML(xmlXPathContextPtr ctxt, virInterfaceDef *def; int type; char *tmp; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); xmlNodePtr lnk; =20 =20 diff --git a/src/conf/netdev_vlan_conf.c b/src/conf/netdev_vlan_conf.c index 9d7cc732ba..734a61843f 100644 --- a/src/conf/netdev_vlan_conf.c +++ b/src/conf/netdev_vlan_conf.c @@ -33,7 +33,7 @@ int virNetDevVlanParse(xmlNodePtr node, xmlXPathContextPtr ctxt, virNetDevVlan= *def) { int ret =3D -1; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); char *trunk =3D NULL; char *nativeMode =3D NULL; xmlNodePtr *tagNodes =3D NULL; diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index f23599abac..6606331390 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -774,7 +774,7 @@ virNetworkDNSSrvDefParseXML(const char *networkName, bool partialOkay) { int ret; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D node; =20 @@ -932,7 +932,7 @@ virNetworkDNSDefParseXML(const char *networkName, g_autofree char *enable =3D NULL; int nhosts, nsrvs, ntxts, nfwds; size_t i; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D node; =20 @@ -1072,7 +1072,7 @@ virNetworkIPDefParseXML(const char *networkName, * On failure clear it out, but don't free it. */ =20 - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); xmlNodePtr dhcp; g_autofree char *address =3D NULL; g_autofree char *netmask =3D NULL; @@ -1243,7 +1243,7 @@ virNetworkPortGroupParseXML(virPortGroupDef *def, * On failure clear it out, but don't free it. */ =20 - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); xmlNodePtr virtPortNode; xmlNodePtr vlanNode; xmlNodePtr bandwidth_node; @@ -1312,7 +1312,7 @@ virNetworkForwardNatDefParseXML(const char *networkNa= me, g_autofree xmlNodePtr *natPortNodes =3D NULL; g_autofree char *addrStart =3D NULL; g_autofree char *addrEnd =3D NULL; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D node; =20 @@ -1441,7 +1441,7 @@ virNetworkForwardDefParseXML(const char *networkName, g_autofree char *forwardManaged =3D NULL; g_autofree char *forwardDriverName =3D NULL; g_autofree char *type =3D NULL; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D node; =20 @@ -1677,7 +1677,7 @@ virNetworkDefParseXML(xmlXPathContextPtr ctxt, xmlNodePtr forwardNode =3D NULL; g_autofree char *ipv6nogwStr =3D NULL; g_autofree char *trustGuestRxFilters =3D NULL; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); xmlNodePtr bandwidthNode =3D NULL; xmlNodePtr vlanNode; xmlNodePtr metadataNode =3D NULL; diff --git a/src/conf/networkcommon_conf.c b/src/conf/networkcommon_conf.c index 2f543ced70..c5e55dff33 100644 --- a/src/conf/networkcommon_conf.c +++ b/src/conf/networkcommon_conf.c @@ -222,7 +222,7 @@ virNetDevIPRouteParseXML(const char *errorDetail, * of an array. On failure clear: it out, but don't free it. */ =20 - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); g_autofree char *family =3D NULL; g_autofree char *address =3D NULL; g_autofree char *netmask =3D NULL; diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c index b4c1acb6a5..642e9cb89f 100644 --- a/src/conf/node_device_conf.c +++ b/src/conf/node_device_conf.c @@ -778,7 +778,7 @@ virNodeDevCapDRMParseXML(xmlXPathContextPtr ctxt, xmlNodePtr node, virNodeDevCapDRM *drm) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); int val; g_autofree char *type =3D NULL; =20 @@ -866,7 +866,7 @@ virNodeDevAPMatrixCapabilityParseXML(xmlXPathContextPtr= ctxt, virNodeDevCapAPMatrix *apm_dev) { g_autofree char *type =3D virXMLPropString(node, "type"); - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D node; =20 @@ -893,7 +893,7 @@ virNodeDevCSSCapabilityParseXML(xmlXPathContextPtr ctxt, virNodeDevCapCCW *ccw_dev) { g_autofree char *type =3D virXMLPropString(node, "type"); - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D node; =20 @@ -920,7 +920,7 @@ virNodeDevCapCCWParseXML(xmlXPathContextPtr ctxt, xmlNodePtr node, virNodeDevCapCCW *ccw_dev) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); g_autofree xmlNodePtr *nodes =3D NULL; int n =3D 0; size_t i =3D 0; @@ -1011,7 +1011,7 @@ virNodeDevCapAPCardParseXML(xmlXPathContextPtr ctxt, xmlNodePtr node, virNodeDevCapAPCard *ap_card) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); ctxt->node =3D node; =20 return virNodeDevCapAPAdapterParseXML(ctxt, def, &ap_card->ap_adapter); @@ -1025,7 +1025,7 @@ virNodeDevCapAPQueueParseXML(xmlXPathContextPtr ctxt, virNodeDevCapAPQueue *ap_queue) { int ret =3D -1; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); g_autofree char *dom =3D NULL; =20 ctxt->node =3D node; @@ -1065,7 +1065,7 @@ virNodeDevCapAPMatrixParseXML(xmlXPathContextPtr ctxt, xmlNodePtr node, virNodeDevCapAPMatrix *ap_matrix) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); g_autofree xmlNodePtr *nodes =3D NULL; int n =3D 0; size_t i =3D 0; @@ -1090,7 +1090,7 @@ virNodeDevCapStorageParseXML(xmlXPathContextPtr ctxt, xmlNodePtr node, virNodeDevCapStorage *storage) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); g_autofree xmlNodePtr *nodes =3D NULL; size_t i; int n; @@ -1176,7 +1176,7 @@ virNodeDevCapSCSIParseXML(xmlXPathContextPtr ctxt, xmlNodePtr node, virNodeDevCapSCSI *scsi) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D node; =20 @@ -1216,7 +1216,7 @@ virNodeDevCapSCSITargetParseXML(xmlXPathContextPtr ct= xt, xmlNodePtr node, virNodeDevCapSCSITarget *scsi_target) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); g_autofree xmlNodePtr *nodes =3D NULL; int n =3D 0; size_t i; @@ -1285,7 +1285,7 @@ virNodeDevCapSCSIHostParseXML(xmlXPathContextPtr ctxt, int create, const char *virt_type) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); g_autofree xmlNodePtr *nodes =3D NULL; int n =3D 0; size_t i; @@ -1378,7 +1378,7 @@ virNodeDevCapNetParseXML(xmlXPathContextPtr ctxt, xmlNodePtr node, virNodeDevCapNet *net) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); xmlNodePtr lnk; size_t i =3D -1; int n =3D -1; @@ -1449,7 +1449,7 @@ virNodeDevCapUSBInterfaceParseXML(xmlXPathContextPtr = ctxt, xmlNodePtr node, virNodeDevCapUSBIf *usb_if) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D node; =20 @@ -1513,7 +1513,7 @@ virNodeDevCapUSBDevParseXML(xmlXPathContextPtr ctxt, xmlNodePtr node, virNodeDevCapUSBDev *usb_dev) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D node; =20 @@ -1553,7 +1553,7 @@ virNodeDevCapPCIDevIommuGroupParseXML(xmlXPathContext= Ptr ctxt, xmlNodePtr iommuGroupNode, virNodeDevCapPCIDev *pci_dev) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); g_autofree xmlNodePtr *addrNodes =3D NULL; int nAddrNodes; size_t i; @@ -1604,7 +1604,7 @@ virPCIEDeviceInfoParseXML(xmlXPathContextPtr ctxt, xmlNodePtr pciExpressNode, virPCIEDeviceInfo *pci_express) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); xmlNodePtr lnk; =20 ctxt->node =3D pciExpressNode; @@ -1697,7 +1697,7 @@ virNodeDevPCICapabilityParseXML(xmlXPathContextPtr ct= xt, virNodeDevCapPCIDev *pci_dev) { g_autofree char *type =3D virXMLPropString(node, "type"); - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D node; =20 @@ -1735,7 +1735,7 @@ virNodeDevCapPCIDevParseXML(xmlXPathContextPtr ctxt, xmlNodePtr node, virNodeDevCapPCIDev *pci_dev) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); xmlNodePtr iommuGroupNode; xmlNodePtr pciExpress; g_autofree xmlNodePtr *nodes =3D NULL; @@ -1844,7 +1844,7 @@ virNodeDevCapSystemParseXML(xmlXPathContextPtr ctxt, { virNodeDevCapSystemHardware *hardware =3D &syscap->hardware; virNodeDevCapSystemFirmware *firmware =3D &syscap->firmware; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); g_autofree char *tmp =3D NULL; =20 ctxt->node =3D node; @@ -1880,7 +1880,7 @@ virNodeDevCapMdevAttributeParseXML(xmlXPathContextPtr= ctxt, xmlNodePtr node, virNodeDevCapMdev *mdev) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); g_autoptr(virMediatedDeviceAttr) attr =3D virMediatedDeviceAttrNew(); =20 ctxt->node =3D node; @@ -1903,7 +1903,7 @@ virNodeDevCapMdevParseXML(xmlXPathContextPtr ctxt, xmlNodePtr node, virNodeDevCapMdev *mdev) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); int nattrs =3D 0; g_autofree xmlNodePtr *attrs =3D NULL; size_t i; diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c index 9a9b5f4b60..5fb4efb34f 100644 --- a/src/conf/numa_conf.c +++ b/src/conf/numa_conf.c @@ -829,7 +829,7 @@ virDomainNumaDefNodeCacheParseXML(virDomainNuma *def, def->mem_nodes[cur_cell].caches =3D g_new0(virNumaCache, n); =20 for (i =3D 0; i < n; i++) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); virNumaCache *cache =3D &def->mem_nodes[cur_cell].caches[i]; g_autofree char *tmp =3D NULL; unsigned int level; @@ -928,7 +928,7 @@ virDomainNumaDefParseXML(virDomainNuma *def, def->nmem_nodes =3D n; =20 for (i =3D 0; i < n; i++) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); g_autofree char *tmp =3D NULL; int rc; unsigned int cur_cell; @@ -1026,7 +1026,7 @@ virDomainNumaDefParseXML(virDomainNuma *def, VIR_XML_PROP_REQUIRED, &value) < 0) return -1; } else if (virXMLNodeNameEqual(interconnect[i], "bandwidth")) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); type =3D VIR_NUMA_INTERCONNECT_TYPE_BANDWIDTH; =20 ctxt->node =3D interconnect[i]; diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c index fc6f0a859d..e1eab609d7 100644 --- a/src/conf/snapshot_conf.c +++ b/src/conf/snapshot_conf.c @@ -144,7 +144,7 @@ virDomainSnapshotDiskDefParseXML(xmlNodePtr node, char *type =3D NULL; char *driver =3D NULL; xmlNodePtr cur; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D node; =20 diff --git a/src/conf/storage_adapter_conf.c b/src/conf/storage_adapter_con= f.c index 135deeb933..dcc4cf8a55 100644 --- a/src/conf/storage_adapter_conf.c +++ b/src/conf/storage_adapter_conf.c @@ -169,7 +169,7 @@ virStorageAdapterParseXML(virStorageAdapter *adapter, xmlXPathContextPtr ctxt) { int type; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D node; =20 diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index c78456695c..b2fcde531c 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -533,7 +533,7 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt, g_autofree char *ver =3D NULL; g_autofree xmlNodePtr *nodeset =3D NULL; g_autofree char *sourcedir =3D NULL; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D node; =20 @@ -693,7 +693,7 @@ virStorageDefParsePerms(xmlXPathContextPtr ctxt, { long long val; int ret =3D -1; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); xmlNodePtr node; g_autofree char *mode =3D NULL; =20 diff --git a/src/conf/storage_encryption_conf.c b/src/conf/storage_encrypti= on_conf.c index 9112b96cc7..fabe3334cf 100644 --- a/src/conf/storage_encryption_conf.c +++ b/src/conf/storage_encryption_conf.c @@ -140,7 +140,7 @@ static virStorageEncryptionSecret * virStorageEncryptionSecretParse(xmlXPathContextPtr ctxt, xmlNodePtr node) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); virStorageEncryptionSecret *ret; g_autofree char *type_str =3D NULL; =20 @@ -213,7 +213,7 @@ virStorageEncryption * virStorageEncryptionParseNode(xmlNodePtr node, xmlXPathContextPtr ctxt) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); xmlNodePtr *nodes =3D NULL; virStorageEncryption *encdef =3D NULL; virStorageEncryption *ret =3D NULL; diff --git a/src/conf/storage_source_conf.c b/src/conf/storage_source_conf.c index 5ca06fa30a..5e1960cee8 100644 --- a/src/conf/storage_source_conf.c +++ b/src/conf/storage_source_conf.c @@ -234,7 +234,7 @@ virStorageAuthDef * virStorageAuthDefParse(xmlNodePtr node, xmlXPathContextPtr ctxt) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); virStorageAuthDef *ret =3D NULL; xmlNodePtr secretnode =3D NULL; g_autoptr(virStorageAuthDef) authdef =3D NULL; diff --git a/src/conf/virsavecookie.c b/src/conf/virsavecookie.c index 6cb7fafb1f..f95b85913e 100644 --- a/src/conf/virsavecookie.c +++ b/src/conf/virsavecookie.c @@ -57,7 +57,7 @@ virSaveCookieParse(xmlXPathContextPtr ctxt, virObject **obj, virSaveCookieCallbacks *saveCookie) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); int ret =3D -1; =20 *obj =3D NULL; diff --git a/src/cpu/cpu_map.c b/src/cpu/cpu_map.c index 6baaa77776..dd7e99f525 100644 --- a/src/cpu/cpu_map.c +++ b/src/cpu/cpu_map.c @@ -39,7 +39,7 @@ loadData(const char *mapfile, cpuMapLoadCallback callback, void *data) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); g_autofree xmlNodePtr *nodes =3D NULL; int n; size_t i; @@ -113,7 +113,7 @@ loadIncludes(xmlXPathContextPtr ctxt, cpuMapLoadCallback modelCB, void *data) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); g_autofree xmlNodePtr *nodes =3D NULL; int n; size_t i; diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 1b829e5658..7a1b54e9d0 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -1509,7 +1509,7 @@ x86ModelParseSignatures(virCPUx86Model *model, xmlXPathContextPtr ctxt) { g_autofree xmlNodePtr *nodes =3D NULL; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); size_t i; int n; =20 diff --git a/src/lxc/lxc_domain.c b/src/lxc/lxc_domain.c index 0920e91fd1..33f4066a51 100644 --- a/src/lxc/lxc_domain.c +++ b/src/lxc/lxc_domain.c @@ -210,7 +210,7 @@ lxcDomainDefNamespaceParse(xmlXPathContextPtr ctxt, { lxcDomainDef *lxcDef =3D NULL; g_autofree xmlNodePtr *nodes =3D NULL; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); int n; size_t i; int ret =3D -1; diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 286d34ae54..e1930d60af 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3750,7 +3750,7 @@ virQEMUCapsLoadHostCPUModelInfo(virQEMUCapsAccel *cap= s, char *str =3D NULL; xmlNodePtr hostCPUNode; g_autofree xmlNodePtr *nodes =3D NULL; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); g_autoptr(qemuMonitorCPUModelInfo) hostCPU =3D NULL; g_autofree char *xpath =3D g_strdup_printf("./hostCPU[@type=3D'%s']", = typeStr); int ret =3D -1; diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 50a921c80d..ab39816a73 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -231,7 +231,7 @@ qemuDomainObjPrivateXMLParseJobNBDSource(xmlNodePtr nod= e, virDomainDiskDef *disk, virDomainXMLOption *xmlopt) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); qemuDomainDiskPrivate *diskPriv =3D QEMU_DOMAIN_DISK_PRIVATE(disk); g_autofree char *format =3D NULL; g_autofree char *type =3D NULL; @@ -2645,7 +2645,7 @@ qemuDomainObjPrivateXMLParseBlockjobChain(xmlNodePtr = node, virDomainXMLOption *xmlopt) =20 { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); g_autofree char *format =3D NULL; g_autofree char *type =3D NULL; g_autofree char *index =3D NULL; @@ -2845,7 +2845,7 @@ qemuDomainObjPrivateXMLParseBlockjobData(virDomainObj= *vm, xmlXPathContextPtr ctxt, virDomainXMLOption *xmlopt) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); virDomainDiskDef *disk =3D NULL; g_autoptr(qemuBlockJobData) job =3D NULL; g_autofree char *name =3D NULL; @@ -3027,7 +3027,7 @@ qemuDomainObjPrivateXMLParseSlirpFeatures(xmlNodePtr = featuresNode, xmlXPathContextPtr ctxt, qemuSlirp *slirp) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); g_autofree xmlNodePtr *nodes =3D NULL; size_t i; int n; diff --git a/src/qemu/qemu_domainjob.c b/src/qemu/qemu_domainjob.c index 03a8d9ba5f..21d41c552e 100644 --- a/src/qemu/qemu_domainjob.c +++ b/src/qemu/qemu_domainjob.c @@ -1244,7 +1244,7 @@ qemuDomainObjPrivateXMLParseJob(virDomainObj *vm, { qemuDomainObjPrivate *priv =3D vm->privateData; qemuDomainJobObj *job =3D &priv->job; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); g_autofree char *tmp =3D NULL; =20 if (!(ctxt->node =3D virXPathNode("./job[1]", ctxt))) diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_coo= kie.c index b67728f9c0..336bccc605 100644 --- a/src/qemu/qemu_migration_cookie.c +++ b/src/qemu/qemu_migration_cookie.c @@ -963,7 +963,7 @@ qemuMigrationCookieNetworkXMLParse(xmlXPathContextPtr c= txt) size_t i; int n; g_autofree xmlNodePtr *interfaces =3D NULL; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 if ((n =3D virXPathNodeSet("./network/interface", ctxt, &interfaces)) = < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -1001,7 +1001,7 @@ qemuMigrationCookieNBDXMLParse(xmlXPathContextPtr ctx= t) size_t i; int n; g_autofree xmlNodePtr *disks =3D NULL; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 port =3D virXPathString("string(./nbd/@port)", ctxt); if (port && virStrToLong_i(port, NULL, 10, &ret->port) < 0) { @@ -1050,7 +1050,7 @@ qemuMigrationCookieStatisticsXMLParse(xmlXPathContext= Ptr ctxt) { qemuDomainJobInfo *jobInfo =3D NULL; qemuMonitorMigrationStats *stats; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 if (!(ctxt->node =3D virXPathNode("./statistics", ctxt))) return NULL; @@ -1221,7 +1221,7 @@ qemuMigrationCookieBlockDirtyBitmapsParse(xmlXPathCon= textPtr ctxt, g_autofree xmlNodePtr *disknodes =3D NULL; int ndisknodes; size_t i; - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 if ((ndisknodes =3D virXPathNodeSet("./blockDirtyBitmaps/disk", ctxt, = &disknodes)) < 0) return -1; --=20 2.31.1 From nobody Sun May 5 05:28:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1629895433; cv=none; d=zohomail.com; s=zohoarc; b=EBFurwkXC7fG/gu/xPCH4RedyrnTvbqihJu3O/kngWCZLhnkr986VJ4ab+bRBHv2+f5UPBSTzaiuRNI6URrpGjg8vdKutV9Irwijs4wg4snl0FDb4/hAiUiVJ98WSyJRR2NJrBQAxZ21PzXx44Bv4G28vI17iYmivl6hVaXjBow= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629895433; 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=Y1VrxoxwaRjBbXXEMCgeFgtpHnTpTWtU+lszFsLjpSI=; b=mHOAAUKdAp/Wow22x6NvskW8egewPw0VPCFmOz3DdEO/1AHfVezmGc2qga31hsxxMHpqLL2l+ef7zpNMvN9fx54q7Wp1TuVHbT66H4zgSLeYEiKdjnzvXgBzTVAb0IpzqIx0iLEJAYUlp16lkDBclKm9Pxj+XXYjBpH0Y0rCtkQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1629895433039480.69014617853736; Wed, 25 Aug 2021 05:43: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-454-zGUeJzE5ODqJaArayG6Yuw-1; Wed, 25 Aug 2021 08:43:50 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 802051008060; Wed, 25 Aug 2021 12:43:45 +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 6188C60C0F; Wed, 25 Aug 2021 12:43:45 +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 CDBBE182188B; Wed, 25 Aug 2021 12:43:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17PChgF5013616 for ; Wed, 25 Aug 2021 08:43:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 80EAA669ED; Wed, 25 Aug 2021 12:43:42 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.192.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id E6C4B1ABDF; Wed, 25 Aug 2021 12:43:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629895432; 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=Y1VrxoxwaRjBbXXEMCgeFgtpHnTpTWtU+lszFsLjpSI=; b=VCzlsKL5W8MR4hVUD9Zi9LI9Ci8BqPzc59Wm6p4GvP8QZe/zM8Eh05GwktTAkYeIUdnWFf h6G95k9nlvA+dq2NYB8Pv/sNkvbEplC448YXOOUZaGuBE1sLJiT3jixj3e+RrPW5YKyW6Q lvKetq1lmBlnWufSx35cjLfCDyQv+H8= X-MC-Unique: zGUeJzE5ODqJaArayG6Yuw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 03/11] virxml: Simplify VIR_XPATH_NODE_AUTORESTORE Date: Wed, 25 Aug 2021 14:43:22 +0200 Message-Id: <20210825124330.84282-4-twiederh@redhat.com> In-Reply-To: <20210825124330.84282-1-twiederh@redhat.com> References: <20210825124330.84282-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1629895433961100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake --- src/util/virxml.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/util/virxml.h b/src/util/virxml.h index 06fb7aebd8..b4716630b9 100644 --- a/src/util/virxml.h +++ b/src/util/virxml.h @@ -358,10 +358,8 @@ G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(virXPathContextNodeSa= ve, virXPathContextNodeRes * node pointer is reset to the original value when this macro was used. */ #define VIR_XPATH_NODE_AUTORESTORE(_ctxt) \ - VIR_WARNINGS_NO_UNUSED_VARIABLE \ - g_auto(virXPathContextNodeSave) _ctxt ## CtxtSave =3D { .ctxt =3D _ctx= t,\ - .node =3D _ctxt-= >node}; \ - VIR_WARNINGS_RESET + vir_g_auto(virXPathContextNodeSave) _ctxt ## CtxtSave =3D { .ctxt =3D = _ctxt, \ + .node =3D _c= txt->node} =20 G_DEFINE_AUTOPTR_CLEANUP_FUNC(xmlDoc, xmlFreeDoc); G_DEFINE_AUTOPTR_CLEANUP_FUNC(xmlXPathContext, xmlXPathFreeContext); --=20 2.31.1 From nobody Sun May 5 05:28:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1629895436; cv=none; d=zohomail.com; s=zohoarc; b=Ay81xLLsE6c4YBwgMOYjedlNXXIbmS+btumASoLD+f5vISG30fVK7MZdsMraNqxnTQCImk9f5BET7v102zSb/I6ufbbgVDxSRT5MWSqVy21+bV5z0YB2AakFwLQcipeVvkzqrt4bKgWrjZs5wQ1ro1cTJBPKbKhp2VvkqgE5+u0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629895436; 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=HP6usu7N2FX5tMF3v/szJ6cYGIF+Y9qGcYkvbq2TWWo=; b=fmk5iBiOmp+khsflfwzNeM9ar0uR3+jo1dRZb05zX6o7ZRV0xObCmuSmaWuAEF42LFBSx3ZQC9wsjcNEZuLJKEmexPQVL//WHUgPYnLA5kHsDfP1XTPY+Yxe/EoEiUUR+5xf+aDAWo8KwX48bJnNzP8M/r+Un2dze+oLt1z8H1U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1629895436674135.09104373811033; Wed, 25 Aug 2021 05:43:56 -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-360-ybyGaZ7GNpqqr5x3njTL7w-1; Wed, 25 Aug 2021 08:43:53 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B4B921008062; Wed, 25 Aug 2021 12:43:48 +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 943D760C9D; Wed, 25 Aug 2021 12:43:48 +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 5F5BB4A7CA; Wed, 25 Aug 2021 12:43:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17PChjOE013628 for ; Wed, 25 Aug 2021 08:43:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0040E1ABD7; Wed, 25 Aug 2021 12:43:45 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.192.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4FFBA1ABDF; Wed, 25 Aug 2021 12:43:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629895435; 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=HP6usu7N2FX5tMF3v/szJ6cYGIF+Y9qGcYkvbq2TWWo=; b=ToR0yt3DWCGIWgGqsPSMfAgVrkLzMBtSvFmJo1eREOslYeNVG61L8S+RwNRhEPSYQ5hqYM xsdWt3laGwgVUUZ/x8jYaCmy56Zs6J4ZEd3WI1XnWGCGgFR/q24CFg6g+jxTwjhM+UAscz 21HHEdUQRvPQN01H1nzji2z6uoL9mIg= X-MC-Unique: ybyGaZ7GNpqqr5x3njTL7w-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 04/11] internal: Add CONCAT macro Date: Wed, 25 Aug 2021 14:43:23 +0200 Message-Id: <20210825124330.84282-5-twiederh@redhat.com> In-Reply-To: <20210825124330.84282-1-twiederh@redhat.com> References: <20210825124330.84282-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1629895438301100001 Content-Type: text/plain; charset="utf-8" Using the two-step idiom to force resolution of other macros, e.g.: #define bar BAR CONCAT_(foo, bar) // foobar CONCAT(foo, bar) // fooBAR Signed-off-by: Tim Wiederhake --- src/internal.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/internal.h b/src/internal.h index e1250a59fe..48188e6fa3 100644 --- a/src/internal.h +++ b/src/internal.h @@ -93,6 +93,9 @@ =20 #define NUL_TERMINATE(buf) do { (buf)[sizeof(buf)-1] =3D '\0'; } while (0) =20 +#define CONCAT_(a, b) a ## b +#define CONCAT(a, b) CONCAT_(a, b) + #ifdef WIN32 # ifndef O_CLOEXEC # define O_CLOEXEC _O_NOINHERIT --=20 2.31.1 From nobody Sun May 5 05:28:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1629895441; cv=none; d=zohomail.com; s=zohoarc; b=U5rZFDFl9P5z0HbgVmhH2McPHy8HjqhgTgB8VDjGWcpZ5rsUq3MNgBwBpwyXtMlHlzwBRXRLhhgTtgjUnAXUzeByMkQu4XlkfjTsB+yVVnRsS9m2OHRRLILvMQVj9i5g8GP5CK8BVzrSBbPEcMtN3YOS2+9P8GB4C1S0+cYWTGs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629895441; 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=bwN5x0hc6MSvwWTGW25uqrRCWL0MaSJUbZCOiasUTLc=; b=ZRjLUX9tIX6pEH163PY0AQD8V53wUJQW1y4qGj5lA+dgzTE4dkQGgctDy1KTJLaEbzxKjK5LyJkEcHJ3Zuwfkbkhn6Hcjb+Ek1HmpvLR+pN3yI2uVmirWCyCgZWdI3abHF/+HnVztTbgvEhmXQYmXctBIfR5XVOB2LJ6pQhChnw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1629895441980171.5209696767721; Wed, 25 Aug 2021 05:44:01 -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-530-djb7UeZHNdmpC92xFShrpA-1; Wed, 25 Aug 2021 08:43:59 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 51DFA100806B; Wed, 25 Aug 2021 12:43:54 +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 3074B1036D28; Wed, 25 Aug 2021 12:43:54 +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 ED0C7182188C; Wed, 25 Aug 2021 12:43:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17PChlPc013636 for ; Wed, 25 Aug 2021 08:43:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0B539669ED; Wed, 25 Aug 2021 12:43:47 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.192.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id C9C29188E4; Wed, 25 Aug 2021 12:43:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629895440; 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=bwN5x0hc6MSvwWTGW25uqrRCWL0MaSJUbZCOiasUTLc=; b=eqKWX+NTCM6Nat9DT56s9eVxfutfuAQUbw10J4GG57/DXSTMFIp468RlpHtGNIXfniRk03 8WWjbdVO53+gbj04WhI+mcLjrHUSY2/N4W1R1pt5NjW3SeU8fRg+y0y+tr+SeLlZqrVtWd RnF170pl9eBRdelpAG1NI+T2MhHXhoM= X-MC-Unique: djb7UeZHNdmpC92xFShrpA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 05/11] virthread: Introduce virLockGuard Date: Wed, 25 Aug 2021 14:43:24 +0200 Message-Id: <20210825124330.84282-6-twiederh@redhat.com> In-Reply-To: <20210825124330.84282-1-twiederh@redhat.com> References: <20210825124330.84282-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1629895443256100003 Content-Type: text/plain; charset="utf-8" Locks a virMutex on creation and unlocks it in its destructor. Typical usage: void function(virMutex *m) { vir_g_autoptr(virLockGuard) lock =3D virLockGuardNew(m); /* `m` is locked, and released automatically on scope exit */ ... while (expression) { vir_g_autoptr(virLockGuard) lock2 =3D virLockGuardNew(...); /* similar */ } } Signed-off-by: Tim Wiederhake --- src/libvirt_private.syms | 3 +++ src/util/virthread.c | 26 ++++++++++++++++++++++++++ src/util/virthread.h | 10 ++++++++++ 3 files changed, 39 insertions(+) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index fa11ee3df5..d8170a59af 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -3367,6 +3367,9 @@ virCondInit; virCondSignal; virCondWait; virCondWaitUntil; +virLockGuardFree; +virLockGuardNew; +virLockGuardUnlock; virMutexDestroy; virMutexInit; virMutexInitRecursive; diff --git a/src/util/virthread.c b/src/util/virthread.c index e89c1a09fb..a5a948985f 100644 --- a/src/util/virthread.c +++ b/src/util/virthread.c @@ -96,6 +96,32 @@ void virMutexUnlock(virMutex *m) pthread_mutex_unlock(&m->lock); } =20 +virLockGuard *virLockGuardNew(virMutex *m) +{ + virLockGuard *l =3D g_new0(virLockGuard, 1); + l->mutex =3D m; + + virMutexLock(l->mutex); + return l; +} + +void virLockGuardFree(virLockGuard *l) +{ + if (!l) + return; + + virLockGuardUnlock(l); + g_free(l); +} + +void virLockGuardUnlock(virLockGuard *l) +{ + if (!l) + return; + + virMutexUnlock(g_steal_pointer(&l->mutex)); +} + =20 int virRWLockInit(virRWLock *m) { diff --git a/src/util/virthread.h b/src/util/virthread.h index 55c8263ae6..b394dbd226 100644 --- a/src/util/virthread.h +++ b/src/util/virthread.h @@ -31,6 +31,11 @@ struct virMutex { pthread_mutex_t lock; }; =20 +typedef struct virLockGuard virLockGuard; +struct virLockGuard { + virMutex *mutex; +}; + typedef struct virRWLock virRWLock; struct virRWLock { pthread_rwlock_t lock; @@ -121,6 +126,11 @@ void virMutexLock(virMutex *m); void virMutexUnlock(virMutex *m); =20 =20 +virLockGuard *virLockGuardNew(virMutex *m); +void virLockGuardFree(virLockGuard *l); +void virLockGuardUnlock(virLockGuard *l); +G_DEFINE_AUTOPTR_CLEANUP_FUNC(virLockGuard, virLockGuardFree); + int virRWLockInit(virRWLock *m) G_GNUC_WARN_UNUSED_RESULT; void virRWLockDestroy(virRWLock *m); =20 --=20 2.31.1 From nobody Sun May 5 05:28:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1629895445; cv=none; d=zohomail.com; s=zohoarc; b=aTqKt/7BdEma1gjXLkqbjgJI3fcjJsct5gfPqyeA6zM7oaFXdJiI8CgIUKnX2/fRVhrY8vkbOkLXv1KtYPof25UydiVz6ldge9qD3t44jWvY2AHtX0AEzbuJ7HjK53BDo450nNKNn4lXrY9EOnKpn2FSBq3wRR7q6egmKbAWGIA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629895445; 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=d9TCad/8l1/EqPPMODfmptBftNe9z8KgpyTFGercY/g=; b=XV5gkfzDz37orx4I4Q3eHaMNithe7WkipfMRxzGI3BW7OIY5rVxPQW+zGlCmiNV7AdyDkC/k83l1mCKGDw4JKV8+usdauZPEtG6+o2x/KDuu7BN0Uscznf2CAC5zmSSEZrtYELrwfkSb1XdWjf+mP85UBg7fvCRmcCjvWpDNZT4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1629895445237579.052354340711; Wed, 25 Aug 2021 05:44:05 -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-181--4ilCJaCPdKV__YSj0vWJQ-1; Wed, 25 Aug 2021 08:44:02 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 692521008068; Wed, 25 Aug 2021 12:43:57 +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 4416710013D6; Wed, 25 Aug 2021 12:43:57 +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 0E0104A707; Wed, 25 Aug 2021 12:43:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17PChpTA013657 for ; Wed, 25 Aug 2021 08:43:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6C0901ABD2; Wed, 25 Aug 2021 12:43:51 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.192.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7E0D069323; Wed, 25 Aug 2021 12:43:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629895444; 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=d9TCad/8l1/EqPPMODfmptBftNe9z8KgpyTFGercY/g=; b=O0trRgLg0Xk6m/lF9aW2UfIx0qQPo/LhNyWBqSDt/dR4y9groXXbmr5gktz5FHCcR/kRWl VJgYDM7pfQOAAptlz1dQpG9+jYnuogHfSqKNB2Du0yYz+OIrijhHkt19kV5k7WEwt3B80Z YLkmaozvDuiMrRA0LTrt+wdwx4C60BI= X-MC-Unique: -4ilCJaCPdKV__YSj0vWJQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 06/11] virthread: Introduce WITH_VIR_MUTEX_LOCK_GUARD Date: Wed, 25 Aug 2021 14:43:25 +0200 Message-Id: <20210825124330.84282-7-twiederh@redhat.com> In-Reply-To: <20210825124330.84282-1-twiederh@redhat.com> References: <20210825124330.84282-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1629895447727100001 Content-Type: text/plain; charset="utf-8" Modeled after "WITH_QEMU_LOCK_GUARD" (see qemu's include/qemu/lockable.h). Uses "__LINE__" instead of "__COUNTER__", as the latter is a GNU extension. See comment for typical usage. Signed-off-by: Tim Wiederhake --- src/util/virthread.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/util/virthread.h b/src/util/virthread.h index b394dbd226..00a9987a79 100644 --- a/src/util/virthread.h +++ b/src/util/virthread.h @@ -209,3 +209,23 @@ int virThreadLocalSet(virThreadLocal *l, void*) G_GNUC= _WARN_UNUSED_RESULT; return 0; \ } \ struct classname ## EatSemicolon + +/** + * WITH_VIR_MUTEX_LOCK_GUARD: + * + * This macro defines a lock scope such that entering the scope takes the = lock + * and leaving the scope releases the lock. Return statements are allowed + * within the scope and release the lock. Break and continue statements le= ave + * the scope early and release the lock. + * + * virMutex *mutex =3D ...; + * + * WITH_VIR_MUTEX_LOCK_GUARD(mutex) { + * // `mutex` is locked, and released automatically on scope exit + * ... + * } + */ +#define WITH_VIR_MUTEX_LOCK_GUARD(m) \ + for (g_autoptr(virLockGuard) CONCAT(var, __LINE__) =3D virLockGuardNew= (m); \ + CONCAT(var, __LINE__); \ + CONCAT(var, __LINE__) =3D (virLockGuardFree(CONCAT(var, __LINE__)= ), NULL)) --=20 2.31.1 From nobody Sun May 5 05:28:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1629895447; cv=none; d=zohomail.com; s=zohoarc; b=hljuGoRNF+RF9/Lf5iNw8O8bKnLA6ddAl/IeDf92WC1IpOWS/p8K5JdCMQr/Eq3t5n1NRrqTwrIMK3Im/m5IB1rebxQEzRMHgCMPaVCesTe47QxobAG8a+eMWAAP7jyzfhoSJWGff0J2dbcflPVZ6lgGwDJ89KtUsNIBX6hO7JM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629895447; 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=1IaItymcXrLJI0THCaJcwlV0wer6jxm8XMgyKAl7PnI=; b=gKEqg4OhCo6uDSDF0AlYWqtFqPR6ayN2LQTszUqaonoTsm2sfC9u91BE58nr2oI178ha8k1TfqEVVm7WcFPH7n/doP29fM7NPe+oOd4WFg0ktwWrlsXbH7MrvfEdPdG9Np2MwxL846VQ40SzcDSswTly8vLGBpTeRqBCwnRGRoA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1629895447256131.2975201954888; Wed, 25 Aug 2021 05:44:07 -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-132--NrH63qYN-etb7zAOVTYlg-1; Wed, 25 Aug 2021 08:44:03 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A085C1082921; Wed, 25 Aug 2021 12:43:58 +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 85B0110013D6; Wed, 25 Aug 2021 12:43:58 +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 53F201821892; Wed, 25 Aug 2021 12:43:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17PChvvj013670 for ; Wed, 25 Aug 2021 08:43:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id 30636669ED; Wed, 25 Aug 2021 12:43:57 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.192.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C8A71ABD2; Wed, 25 Aug 2021 12:43:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629895446; 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=1IaItymcXrLJI0THCaJcwlV0wer6jxm8XMgyKAl7PnI=; b=aUEsT9IiC2HmfL5BUX5tSm9gnNfU40VOOZ8IFarUdiaddrFb04EmpxcELhtw516s2D+z1G kgtiH33Uo3K/k45m6mblss9oZqj7Y+k8+k9yZBLh+nutlIGi0cm4NPnySVtkKc7bmliEaD tP3+2OAroJP+CK2PRyiOqmjHPkbJdqQ= X-MC-Unique: -NrH63qYN-etb7zAOVTYlg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 07/11] virChrdevFDStreamCloseCb: Use virLockGuard Date: Wed, 25 Aug 2021 14:43:26 +0200 Message-Id: <20210825124330.84282-8-twiederh@redhat.com> In-Reply-To: <20210825124330.84282-1-twiederh@redhat.com> References: <20210825124330.84282-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1629895449782100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake --- src/conf/virchrdev.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/conf/virchrdev.c b/src/conf/virchrdev.c index 5d6de68427..8ca1c1062c 100644 --- a/src/conf/virchrdev.c +++ b/src/conf/virchrdev.c @@ -237,12 +237,10 @@ static void virChrdevFDStreamCloseCb(virStreamPtr st = G_GNUC_UNUSED, void *opaque) { virChrdevStreamInfo *priv =3D opaque; - virMutexLock(&priv->devs->lock); + vir_g_autoptr(virLockGuard) lock =3D virLockGuardNew(&priv->devs->lock= ); =20 /* remove entry from hash */ virHashRemoveEntry(priv->devs->hash, priv->path); - - virMutexUnlock(&priv->devs->lock); } =20 /** --=20 2.31.1 From nobody Sun May 5 05:28:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1629895516; cv=none; d=zohomail.com; s=zohoarc; b=P8a3x+6sCRtPahqDux+TZzF7AzE0rnF2+4oMpyRkX6K0rJnsHSynxzi38QTYRlPN9TbG3A78RleM2BdY2AZFvJPejFGDXCyNnJ23cIEqvIhKxX0ERAGqazt+KEojMXtzU689ITYV7+t5Y7Y0LoWy7w65foiU/ZJZrHFnjk3WTMU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629895516; 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=EX21yDvDdisVXa29Wuh2+RR4O3wKOlPb/Q91Zyip1cY=; b=DZq+4Q58jNzdHAZaYmDaMurO7YmBdKu7d92Nn/l3peGBRsrxV2EvTK1XGOFJvWJdUlxuLR4EdLdUr6X1lceqoprnBYHGQpq1xYN4cNoycDS2VTHNQ9U9obYdDAI02tWailm21yR6ivvDXY2qJYHU0vNQyk3eod4jNTi/Gvuq4Y8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1629895516343110.53688102518538; Wed, 25 Aug 2021 05:45:16 -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-374-hSw5RVEANKCf0MyknTqIyQ-1; Wed, 25 Aug 2021 08:44:06 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 57594108292F; Wed, 25 Aug 2021 12:44:01 +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 3634E1036D15; Wed, 25 Aug 2021 12:44:01 +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 E56731821896; Wed, 25 Aug 2021 12:44:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17PChwoG013678 for ; Wed, 25 Aug 2021 08:43:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id 916D25D741; Wed, 25 Aug 2021 12:43:58 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.192.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 87D6869320; Wed, 25 Aug 2021 12:43:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629895515; 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=EX21yDvDdisVXa29Wuh2+RR4O3wKOlPb/Q91Zyip1cY=; b=CX6/1UAaxZvNCQD/4u9KOQRmRWx3jYl4aXjbW2M/aj5DTtjjK8v7WHTb/BaAObGklqudGH uK7eopruqAByELORhr+hqLDj31irIPjCOUMM0THlrsrrxNI0+fNBMd36mZr1dKabEyoQtV D4iiDGHtrDN4F9IDIt2BqPh7ElXX1Es= X-MC-Unique: hSw5RVEANKCf0MyknTqIyQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 08/11] virChrdevFree: Use virLockGuard Date: Wed, 25 Aug 2021 14:43:27 +0200 Message-Id: <20210825124330.84282-9-twiederh@redhat.com> In-Reply-To: <20210825124330.84282-1-twiederh@redhat.com> References: <20210825124330.84282-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1629895518448100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake --- src/conf/virchrdev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/conf/virchrdev.c b/src/conf/virchrdev.c index 8ca1c1062c..a95b8976ac 100644 --- a/src/conf/virchrdev.c +++ b/src/conf/virchrdev.c @@ -291,10 +291,10 @@ void virChrdevFree(virChrdevs *devs) if (!devs) return; =20 - virMutexLock(&devs->lock); - virHashForEachSafe(devs->hash, virChrdevFreeClearCallbacks, NULL); - virHashFree(devs->hash); - virMutexUnlock(&devs->lock); + WITH_VIR_MUTEX_LOCK_GUARD(&devs->lock) { + virHashForEachSafe(devs->hash, virChrdevFreeClearCallbacks, NULL); + virHashFree(devs->hash); + } virMutexDestroy(&devs->lock); =20 g_free(devs); --=20 2.31.1 From nobody Sun May 5 05:28:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1629895449; cv=none; d=zohomail.com; s=zohoarc; b=Ac4tAe7QGekyvW5DIRDPQM+fqfzOUU29nE4UvxtBwXtUI2NESDzQznS0DXRjTK9X92fK10H6jUGTRWwvtfUJcqZ8QERiqmi2wLRVMISOt6a564932R6W6E2/00LmfogSOnA+gNG/ruRVYgmv/j9UtR/9sijUWZ+1sciOwIg1gjE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629895449; 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=zv8Ejh3JtmIYuihyXbo5vTjceHeQRMQujJfI/pa/Q4A=; b=NIENd4gn3kWXkMA+xMhNHfIJP8YtNgn57MFIrWTaAj9n87np1g1tLw4LE62+go3Aa0X8L9GOzzCF7CAVeepMfarJPWX//0tH+XdEJZQbYClM+RUU5wyK0IZnbw/7fOUwpUCSLirXYeYQGkIV8bOvS+oe1Wdn6MMjZbcMUht1jXY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1629895449605361.326396098498; Wed, 25 Aug 2021 05:44:09 -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-176-J2ylOkz_MQe8iRzT9r9kkQ-1; Wed, 25 Aug 2021 08:44:06 -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 98B6D87D543; Wed, 25 Aug 2021 12:44:01 +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 76F4C28559; Wed, 25 Aug 2021 12:44:01 +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 3D97C1821898; Wed, 25 Aug 2021 12:44:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17PChxDt013693 for ; Wed, 25 Aug 2021 08:44:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id F08B91ABDF; Wed, 25 Aug 2021 12:43:59 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.192.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 05DE15D741; Wed, 25 Aug 2021 12:43:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629895448; 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=zv8Ejh3JtmIYuihyXbo5vTjceHeQRMQujJfI/pa/Q4A=; b=W3gfoSpUpo8Z1YEfLEWa04uRYqTz/aRs8Pfr1KuIvlCSPn36uGYsvjQpEtHbbZ0fJG+cRh EMpPpBEyur39ar9fi/L7exsSMyPNZG0NRrUyzkalSLmTUHF9I/dp0LMY6EaSACwIDieF/G GfTa31KkJCYT8xftFY75WGlZ09V3FNk= X-MC-Unique: J2ylOkz_MQe8iRzT9r9kkQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 09/11] virChrdevOpen: Use virLockGuard Date: Wed, 25 Aug 2021 14:43:28 +0200 Message-Id: <20210825124330.84282-10-twiederh@redhat.com> In-Reply-To: <20210825124330.84282-1-twiederh@redhat.com> References: <20210825124330.84282-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1629895451978100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake --- src/conf/virchrdev.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/conf/virchrdev.c b/src/conf/virchrdev.c index a95b8976ac..7acbfd7f6a 100644 --- a/src/conf/virchrdev.c +++ b/src/conf/virchrdev.c @@ -326,6 +326,7 @@ int virChrdevOpen(virChrdevs *devs, char *path; int ret; bool added =3D false; + vir_g_autoptr(virLockGuard) lock =3D NULL; =20 switch (source->type) { case VIR_DOMAIN_CHR_TYPE_PTY: @@ -346,12 +347,11 @@ int virChrdevOpen(virChrdevs *devs, return -1; } =20 - virMutexLock(&devs->lock); + lock =3D virLockGuardNew(&devs->lock); =20 if ((ent =3D virHashLookup(devs->hash, path))) { if (!force) { /* entry found, device is busy */ - virMutexUnlock(&devs->lock); return 1; } else { /* terminate existing connection */ @@ -369,16 +369,12 @@ int virChrdevOpen(virChrdevs *devs, } =20 /* create the lock file */ - if ((ret =3D virChrdevLockFileCreate(path)) < 0) { - virMutexUnlock(&devs->lock); + if ((ret =3D virChrdevLockFileCreate(path)) < 0) return ret; - } =20 /* obtain a reference to the stream */ - if (virStreamRef(st) < 0) { - virMutexUnlock(&devs->lock); + if (virStreamRef(st) < 0) return -1; - } =20 cbdata =3D g_new0(virChrdevStreamInfo, 1); ent =3D g_new0(virChrdevHashEntry, 1); @@ -417,7 +413,6 @@ int virChrdevOpen(virChrdevs *devs, cbdata, virChrdevFDStreamCloseCbFree); =20 - virMutexUnlock(&devs->lock); return 0; =20 error: @@ -429,7 +424,6 @@ int virChrdevOpen(virChrdevs *devs, if (cbdata) VIR_FREE(cbdata->path); VIR_FREE(cbdata); - virMutexUnlock(&devs->lock); virChrdevHashEntryFree(ent); return -1; } --=20 2.31.1 From nobody Sun May 5 05:28:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1629895455; cv=none; d=zohomail.com; s=zohoarc; b=ZivYU9b/Gw1cLqIiw2yEuNFRHnr4if14iScmk1s+1H+WhyZ0CoOjsEFx2iKPQe8ZsN54z0sAAn4GcoCNR95g09S95lKmapR+EBMCp30IwksjHriPV6UcfDzVP3zPQRnrlXOzSwemgvvZbId9DJgLKc5gHyi1uzLvP+OOUlTyAcQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629895455; 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=yQNKsVYvOJG1Pu5lB8qgie39pXznWwCBm5hVFq7IwSo=; b=hfiHpz0nMN63LYWbnPVwH0f51cn87wu5BGAhfCPuHWidPGwFo3MduAgZ335IdNwTF6DUh76Qf8YA3RftfGTe/08BiFfYHRJZndbX3TJ1Tc3SnNwi9P//6vYdDae1VJLTJMW/wctpgtX1Z3UO/PHIyEuFde13k/daX0mO3QI4ado= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1629895455208924.5745911943555; Wed, 25 Aug 2021 05:44:15 -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-138-LxKkqC_KOhem4XvjV36foA-1; Wed, 25 Aug 2021 08:44:11 -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 34E4980292A; Wed, 25 Aug 2021 12:44:04 +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 111C89D62; Wed, 25 Aug 2021 12:44:04 +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 CE13A182189D; Wed, 25 Aug 2021 12:44:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17PCi1LD013701 for ; Wed, 25 Aug 2021 08:44:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3B1C15D741; Wed, 25 Aug 2021 12:44:01 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.192.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 65C55669ED; Wed, 25 Aug 2021 12:44:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629895454; 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=yQNKsVYvOJG1Pu5lB8qgie39pXznWwCBm5hVFq7IwSo=; b=BD4v9lDpXYHc+KQmlL6Rbr3vAGWuZtjJFG4AzhNO9o4fbqUvnUHWD8JWekuOXNdQQpxr3n Br3cow0RjXYKkLXmFBu260VSwkFHaTxHffOkqTFA4XYc/cTh5YPUhQCEXs5rnVsSFyr5Fl SA1Wi5Yh42pzl2BYznEOZCRtQgAXzxY= X-MC-Unique: LxKkqC_KOhem4XvjV36foA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 10/11] networkBridgeNameValidate: Use virLockGuard Date: Wed, 25 Aug 2021 14:43:29 +0200 Message-Id: <20210825124330.84282-11-twiederh@redhat.com> In-Reply-To: <20210825124330.84282-1-twiederh@redhat.com> References: <20210825124330.84282-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1629895456585100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake --- src/network/bridge_driver.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index e8b9ffa1fc..5ccc3817d4 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -3143,7 +3143,7 @@ static int networkBridgeNameValidate(virNetworkObjList *nets, virNetworkDef *def) { - virMutexLock(&bridgeNameValidateMutex); + vir_g_autoptr(virLockGuard) lock =3D virLockGuardNew(&bridgeNameValida= teMutex); =20 if (def->bridge && !strstr(def->bridge, "%d")) { if (virNetworkObjBridgeInUse(nets, def->bridge, def->name)) { @@ -3158,11 +3158,9 @@ networkBridgeNameValidate(virNetworkObjList *nets, goto error; } =20 - virMutexUnlock(&bridgeNameValidateMutex); return 0; =20 error: - virMutexUnlock(&bridgeNameValidateMutex); return -1; } =20 --=20 2.31.1 From nobody Sun May 5 05:28:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1629895452; cv=none; d=zohomail.com; s=zohoarc; b=ixbTdiRr4NkqSI5zghaScnVXwb+ykmXQyP/5vOvTqY68J17hsVdPAPGx5eiSI4c/qgjnjyWJpnlZX+7yhOyQ/Cg0pAWU4XSgNnLto/XzY+3Vmp3re0jh1dtAqpRZS+fm/BbvMIsz+KfjzbhgsqeweHcdLimMbVkyLGVh130+zX8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629895452; 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=1CeNnv8KHfZ1ci4uYPLfF45DoYqXC5d9suhFrxizjHE=; b=fPkkoAIR9RKjb0ZM0Jg1aRbQ8HN8h+4wnBl5eY6UD06ZUFkXWsZaP2gZaEEkT16G3+DIkRPisRXnLY53qxs/Qf5HFm9QIF5SvRO0Z+0o+HN6wwWW0jM0rLdhMYQjuyeLUZbBqLakgV1bb1M/fMURTCwygyKhvDabyAsKwRx2oGk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1629895452518373.59581838839597; Wed, 25 Aug 2021 05:44:12 -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-412-svMDTULZOqGVNJ7Pr1ZD0A-1; Wed, 25 Aug 2021 08:44:09 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8A2BE1936B6C; Wed, 25 Aug 2021 12:44:04 +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 6CF4D60657; Wed, 25 Aug 2021 12:44:04 +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 331264A709; Wed, 25 Aug 2021 12:44:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17PCi2ch013714 for ; Wed, 25 Aug 2021 08:44:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id 91ED769320; Wed, 25 Aug 2021 12:44:02 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.192.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id A71455D741; Wed, 25 Aug 2021 12:44:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629895451; 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=1CeNnv8KHfZ1ci4uYPLfF45DoYqXC5d9suhFrxizjHE=; b=CjDc/03W56SeFLwzEP657BSLMZmgwcoLthjA9VmbcgRxvGEA+PNbBz8SVuxWO5QkMWsWSH I6TKGfzZNPJcyqAYcueKG8A+E4ym3L1i7yHqw9k7zb1k1BMXZdJZOKUt+bTAmyFVm0QpME 4p5vPWTp8lF6ca6dHJvnQkswDK3smFw= X-MC-Unique: svMDTULZOqGVNJ7Pr1ZD0A-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 11/11] networkBridgeNameValidate: Cleanup Date: Wed, 25 Aug 2021 14:43:30 +0200 Message-Id: <20210825124330.84282-12-twiederh@redhat.com> In-Reply-To: <20210825124330.84282-1-twiederh@redhat.com> References: <20210825124330.84282-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1629895454310100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake --- src/network/bridge_driver.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 5ccc3817d4..7c46a65c72 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -3150,18 +3150,15 @@ networkBridgeNameValidate(virNetworkObjList *nets, virReportError(VIR_ERR_INTERNAL_ERROR, _("bridge name '%s' already in use."), def->bridge); - goto error; + return -1; } } else { /* Allocate a bridge name */ if (networkFindUnusedBridgeName(nets, def) < 0) - goto error; + return -1; } =20 return 0; - - error: - return -1; } =20 =20 --=20 2.31.1