From nobody Sat Apr 20 14:53:42 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=1631270835; cv=none; d=zohomail.com; s=zohoarc; b=I/Ztmu417QEgYex26YYp7QErJEXzRakxYpUppF6cPnJEqpewOi0fa2eOqJISymBxHLs7BR9hO+9Bct7dYlD7iYh1O0KFsLrRlCkPJr4DT6fyv/2KhK3+u5nkffKt6AX6/X5iqW5eboxNYhsaw3Hyhbrhj5f6MjNinxLoB2NJsTM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631270835; 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=iMTsu6a0N3+/NhCAaOHbGcwaviVzXin8DraYNC8E54U=; b=g+YiOWf/OFWJgBwNvZx5KY1OYa2CLnJWJ+jz1j2Th4hLWwkwjatCUrUR/uwPTQ40m4l3MhhNScVr6K8ZJeOjY3hu3Xo4oX+JLfq+qyrvNVP2I94cEynyXVZku8GyF2vKYhEoTEGJ3DyZjyc8ckiGVdRmBGuZwF8VnomhKwweSJY= 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 1631270835992897.3713497961268; Fri, 10 Sep 2021 03:47: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-207-IpNxH9lRPeaEZqkQ0B5VPA-1; Fri, 10 Sep 2021 06:47:13 -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 09E6A1006AA2; Fri, 10 Sep 2021 10:47:08 +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 78C8C10074E5; Fri, 10 Sep 2021 10:47:07 +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 8C5804EA2A; Fri, 10 Sep 2021 10:47:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 18AAk1xJ004707 for ; Fri, 10 Sep 2021 06:46:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 07B781981F; Fri, 10 Sep 2021 10:46:01 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.193.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4B2785B826; Fri, 10 Sep 2021 10:46:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631270834; 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=iMTsu6a0N3+/NhCAaOHbGcwaviVzXin8DraYNC8E54U=; b=TOkpyDEaYjIOR6RTN5o7WWIVhiM2PfPQpAfFGQZe2WhRvsaAe98D8TmcJRHWvi12vHYQGe Ij6hyJ8/VFWmnf3nFQaAzZs5jpZcoENupFqZ/IFe0wmUT/kRclWiHxtih/dcCWPpQ7zOsu 5lZ/OM14OdkUBTCXFocmNmPMSHCcvKk= X-MC-Unique: IpNxH9lRPeaEZqkQ0B5VPA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 01/12] glibcompat: Add G_GNUC_UNUSED to g_auto* definitions for clang Date: Fri, 10 Sep 2021 12:45:43 +0200 Message-Id: <20210910104554.21040-2-twiederh@redhat.com> In-Reply-To: <20210910104554.21040-1-twiederh@redhat.com> References: <20210910104554.21040-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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: 1631270837495100001 Content-Type: text/plain; charset="utf-8" Workaround for a bug in clang. Clang emits an unused-variable warning if the variable is only accessed on scope exit by a destructor function. Note that gcc does not exhibit this behavior. See https://bugs.llvm.org/show_bug.cgi?id=3D3888 and https://bugs.llvm.org/show_bug.cgi?id=3D43482. Signed-off-by: Tim Wiederhake --- src/util/glibcompat.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/util/glibcompat.h b/src/util/glibcompat.h index 697687b967..ea486e32d5 100644 --- a/src/util/glibcompat.h +++ b/src/util/glibcompat.h @@ -86,3 +86,22 @@ 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); + +/* + * Workaround for a bug in clang. Clang emits an unused-variable warning i= f the + * variable is only accessed on scope exit by a destructor function. See + * https://bugs.llvm.org/show_bug.cgi?id=3D3888 and + * https://bugs.llvm.org/show_bug.cgi?id=3D43482. + */ +#if defined(__clang__) +# undef g_autoptr +# define g_autoptr(TypeName) _GLIB_CLEANUP(_GLIB_AUTOPTR_FUNC_NAME(TypeNam= e)) _GLIB_AUTOPTR_TYPENAME(TypeName) G_GNUC_UNUSED +# undef g_autolist +# define g_autolist(TypeName) _GLIB_CLEANUP(_GLIB_AUTOPTR_LIST_FUNC_NAME(T= ypeName)) _GLIB_AUTOPTR_LIST_TYPENAME(TypeName) G_GNUC_UNUSED +# undef g_autoslist +# define g_autoslist(TypeName) _GLIB_CLEANUP(_GLIB_AUTOPTR_SLIST_FUNC_NAME= (TypeName)) _GLIB_AUTOPTR_SLIST_TYPENAME(TypeName) G_GNUC_UNUSED +# undef g_autoqueue +# define g_autoqueue(TypeName) _GLIB_CLEANUP(_GLIB_AUTOPTR_QUEUE_FUNC_NAME= (TypeName)) _GLIB_AUTOPTR_QUEUE_TYPENAME(TypeName) G_GNUC_UNUSED +# undef g_auto +# define g_auto(TypeName) _GLIB_CLEANUP(_GLIB_AUTO_FUNC_NAME(TypeName)) Ty= peName G_GNUC_UNUSED +#endif /* __clang__ */ --=20 2.31.1 From nobody Sat Apr 20 14:53:42 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=1631271097; cv=none; d=zohomail.com; s=zohoarc; b=QAkcV/1vsSb5hLRaV3/A7TZGom1zaskrh5VrZqzuqxqjkskXiCNAaGavgC5AOye5k+/JEO5GNdjNcjbkRKOmVLhWmuRtDsrK0TVZGu3r4MJk9QO0vCRNwkdGFHh2kS+6Nn41ip5Pnd0gg37cG4ul9hLwddqshzWTRXs9bHIQ710= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631271097; 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=Ba3sTiNd8115b3nu48/6bjwmNDJykhWoosW5em23R48=; b=jBnIf1G2f0Z6vbflxBx9g6MtQAgymxzpoAO6vZzifjRAM5jskubZWbXt7a57Vq1Da8iq+qNwyD7VXHS160aDaLJZ7HGwHL9rWUNR10H3AIVn8RvcLkZXwDjKzkQ9FaRz3VQH8JQHLHOqvridLwrzC1d1kzMloLk/hyRAxlgGwkA= 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 1631271097842405.71154420434095; Fri, 10 Sep 2021 03:51:37 -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-547-zzwJKZAwO4K1gUFNVz3N_g-1; Fri, 10 Sep 2021 06:51:34 -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 86AFC801E72; Fri, 10 Sep 2021 10:51:29 +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 3FE8860C82; Fri, 10 Sep 2021 10:51:29 +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 11BED4EA2F; Fri, 10 Sep 2021 10:51:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 18AAk2cO004712 for ; Fri, 10 Sep 2021 06:46:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id 18F491981F; Fri, 10 Sep 2021 10:46:02 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.193.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5CAFF5B826; Fri, 10 Sep 2021 10:46:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631271096; 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=Ba3sTiNd8115b3nu48/6bjwmNDJykhWoosW5em23R48=; b=Sj7KZ9ySkfJUMkAtjO897Gj1+dnSnBlMMo8Dz2MEpLQTGL2X7luVbuH90+y6TSOGaCezRf eu6P6FCLgMk24L/6ymd9jIxTUQGS1oIzF2fDHKhps5KOKpLd+GsxdXb61jzIEtqHYlH9tT X/ftYl8UWm5zP7F1DLLXjdGPUL0I0nM= X-MC-Unique: zzwJKZAwO4K1gUFNVz3N_g-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 02/12] virxml: Simplify VIR_XPATH_NODE_AUTORESTORE Date: Fri, 10 Sep 2021 12:45:44 +0200 Message-Id: <20210910104554.21040-3-twiederh@redhat.com> In-Reply-To: <20210910104554.21040-1-twiederh@redhat.com> References: <20210910104554.21040-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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: 1631271098375100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake --- src/util/virxml.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/util/virxml.h b/src/util/virxml.h index 06fb7aebd8..e69fd08ea6 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 + .node =3D _ctxt-= >node}; =20 G_DEFINE_AUTOPTR_CLEANUP_FUNC(xmlDoc, xmlFreeDoc); G_DEFINE_AUTOPTR_CLEANUP_FUNC(xmlXPathContext, xmlXPathFreeContext); --=20 2.31.1 From nobody Sat Apr 20 14:53:42 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=1631271048; cv=none; d=zohomail.com; s=zohoarc; b=jcP9Sf1ngjbtyNGDbMZp7mEfYBvmlihM9gjSfqsvDjNzhWUsC4pTLIHxfHjHWeyaRu7mgfROA3ZluBBCsu+cq/usz+2CNWoJNKeynNml3pspgDCkSR7mmZKCRs2M+JVPqNKqH9lqhdtTmI01PN7F4N35r+UGQ2mf6Blq2tSAJOM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631271048; 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=V9SeT9B8XHmod3IbHrnlyRDaOF5GWRKY8Ju7HHl1UAU=; b=iYOM5SXENDMvDkiBftyhHj5j2AYWLf7v2t+nNBXX5jKKTlop/CEQAl/dBejVhwzpDUI/CBIftcJnKwP3PATXmw9pTz2PQZVuH04mPGkkKlJC5NdlWRVfJ4enGyJwG59911CtHBcYAaSZvYtz/Pc72BiE5BP3JOx209HOAdE3hXQ= 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 1631271048935996.9857536022398; Fri, 10 Sep 2021 03:50:48 -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-269-5OMJiCA1MTe-BXzOVuel8A-1; Fri, 10 Sep 2021 06:50: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 453D11006AAD; Fri, 10 Sep 2021 10:50:41 +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 296697A8C3; Fri, 10 Sep 2021 10:50: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 E7E1F4EA2A; Fri, 10 Sep 2021 10:50:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 18AAk3q0004729 for ; Fri, 10 Sep 2021 06:46:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6B6C369FAE; Fri, 10 Sep 2021 10:46:03 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.193.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 72ACE53E08; Fri, 10 Sep 2021 10:46:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631271047; 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=V9SeT9B8XHmod3IbHrnlyRDaOF5GWRKY8Ju7HHl1UAU=; b=N5Fae7LXJRX8tlSQ+Q3jNoweRR577jZGldfBttojX6MolKJS8mJp4v9Eq0ofZs97siKG2K WpfZy5bm84e/cYC7jM+hocMpK1w6DeMAkP/Ktef96Tjsjis7nlAPDw4KG4KMPrL4cZPfiQ V1UcyQUvS4fjQ4zOpNJwE7Fbb36aj5Q= X-MC-Unique: 5OMJiCA1MTe-BXzOVuel8A-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 03/12] VIR_XPATH_NODE_AUTORESTORE: Require semicolon Date: Fri, 10 Sep 2021 12:45:45 +0200 Message-Id: <20210910104554.21040-4-twiederh@redhat.com> In-Reply-To: <20210910104554.21040-1-twiederh@redhat.com> References: <20210910104554.21040-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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: 1631271050952100001 Content-Type: text/plain; charset="utf-8" Use of semicolons after VIR_XPATH_NODE_AUTORESTORE was inconsistent. Make it 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 +- src/util/virxml.h | 2 +- 24 files changed, 133 insertions(+), 133 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 cb9e7218ff..f94ac128db 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 @@ -6650,7 +6650,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; @@ -6722,7 +6722,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 @@ -6824,7 +6824,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 @@ -6923,7 +6923,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 @@ -6968,7 +6968,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 @@ -7020,7 +7020,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 @@ -7510,7 +7510,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 @@ -7881,7 +7881,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; @@ -7978,7 +7978,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; @@ -8070,7 +8070,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); @@ -8161,7 +8161,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; @@ -8188,7 +8188,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; @@ -8424,7 +8424,7 @@ virDomainDiskSourcePRParse(xmlNodePtr node, xmlXPathContextPtr ctxt, virStoragePRDef **pr) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D node; =20 @@ -8477,7 +8477,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); @@ -8543,7 +8543,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; @@ -8625,7 +8625,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; @@ -8768,7 +8768,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; @@ -8873,7 +8873,7 @@ virDomainDiskDefDriverParseXML(virDomainDiskDef *def, xmlNodePtr cur, xmlXPathContextPtr ctxt) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 ctxt->node =3D cur; =20 @@ -8941,7 +8941,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 @@ -8974,7 +8974,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 || @@ -8997,7 +8997,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 @@ -9077,7 +9077,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; @@ -9434,7 +9434,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; @@ -9702,7 +9702,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; @@ -9962,7 +9962,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; @@ -10142,7 +10142,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; @@ -10209,7 +10209,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; @@ -11026,7 +11026,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 @@ -11295,7 +11295,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 @@ -11516,7 +11516,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 @@ -11593,7 +11593,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); @@ -11723,7 +11723,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; @@ -11866,7 +11866,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; @@ -12091,7 +12091,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; @@ -12421,7 +12421,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; @@ -12504,7 +12504,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; @@ -12574,7 +12574,7 @@ virDomainGraphicsDefParseXMLSDL(virDomainGraphicsDe= f *def, xmlNodePtr node, xmlXPathContextPtr ctxt) { - VIR_XPATH_NODE_AUTORESTORE(ctxt) + VIR_XPATH_NODE_AUTORESTORE(ctxt); xmlNodePtr glNode; virTristateBool fullscreen; =20 @@ -12671,7 +12671,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 @@ -12828,7 +12828,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; @@ -12956,7 +12956,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); @@ -13200,7 +13200,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); @@ -13388,7 +13388,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; @@ -13500,7 +13500,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; @@ -13576,7 +13576,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 @@ -13646,7 +13646,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 @@ -13708,7 +13708,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; @@ -13781,7 +13781,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; @@ -13830,7 +13830,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; @@ -13868,7 +13868,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 @@ -13952,7 +13952,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; @@ -14013,7 +14013,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; @@ -14171,7 +14171,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 @@ -14198,7 +14198,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; @@ -14297,7 +14297,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 @@ -14521,7 +14521,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 @@ -14643,7 +14643,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; @@ -14697,7 +14697,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; @@ -14789,7 +14789,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; @@ -14825,7 +14825,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; @@ -14890,7 +14890,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 @@ -14934,7 +14934,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 @@ -16906,7 +16906,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 @@ -17249,7 +17249,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; @@ -17284,7 +17284,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; @@ -18398,7 +18398,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; @@ -18509,7 +18509,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; @@ -18636,7 +18636,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; @@ -18964,7 +18964,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 @@ -18990,7 +18990,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 f27a621f8c..0af9a45d52 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3751,7 +3751,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 5de7461fb3..bf46fa594f 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 c7b010f0a0..add32c634d 100644 --- a/src/qemu/qemu_migration_cookie.c +++ b/src/qemu/qemu_migration_cookie.c @@ -948,7 +948,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, @@ -986,7 +986,7 @@ qemuMigrationCookieNBDXMLParse(xmlXPathContextPtr ctxt) 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) { @@ -1035,7 +1035,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; @@ -1206,7 +1206,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; diff --git a/src/util/virxml.h b/src/util/virxml.h index e69fd08ea6..6fef9ae28c 100644 --- a/src/util/virxml.h +++ b/src/util/virxml.h @@ -359,7 +359,7 @@ G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(virXPathContextNodeSav= e, virXPathContextNodeRes */ #define VIR_XPATH_NODE_AUTORESTORE(_ctxt) \ g_auto(virXPathContextNodeSave) _ctxt ## CtxtSave =3D { .ctxt =3D _ctx= t,\ - .node =3D _ctxt-= >node}; + .node =3D _ctxt-= >node} =20 G_DEFINE_AUTOPTR_CLEANUP_FUNC(xmlDoc, xmlFreeDoc); G_DEFINE_AUTOPTR_CLEANUP_FUNC(xmlXPathContext, xmlXPathFreeContext); --=20 2.31.1 From nobody Sat Apr 20 14:53:42 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=1631271063; cv=none; d=zohomail.com; s=zohoarc; b=bpzBM/8SZ9KZLvVjqH2y78QWiXF80P9Xtlu+sX5/PnH/ZkyEUD9qSAJ+gUMLVpnG9hjqGTXOL0zX+wEZE1TxLwKqA3MvHylPwpYNEJr+Z0vVWKW8+gZ+3UzOvOw7njSJtv5DFG5TDvrTDLrx2kMVAcJ/y/HrrKgTWxtk9s5Q3NY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631271063; 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=W0LiLoYKy2FdNBNSiEUcRKKXnjP9yi8fyrgCahuJaAWOC80poD97i6mYReGW+7DKb+bJyTFH7ppLFdYfEDJrM8GKKWPji1MWhrSy/z6TZWy0Lb+kviwYOTVoj9DDmcjgZrAnDXijSL8kibuNWFDAPcTg/HCVCTejUS0UQ84gnVw= 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 1631271063980527.7611734882121; Fri, 10 Sep 2021 03:51:03 -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-535-q9q1kCYvMAGGTrhabmITkA-1; Fri, 10 Sep 2021 06:50:50 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E13A61800D41; Fri, 10 Sep 2021 10:50:45 +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 C45567621A; Fri, 10 Sep 2021 10:50: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 9517E4EA37; Fri, 10 Sep 2021 10:50:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 18AAk4A9004738 for ; Fri, 10 Sep 2021 06:46:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7C8DF2C00F; Fri, 10 Sep 2021 10:46:04 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.193.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id C0F2F4180; Fri, 10 Sep 2021 10:46:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631271063; 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=cjer9vnmpvA+ExBViE4YY3q5mS3MsHjGFQt5Y3ur7PpBd6uVkfEr8LKgpuGfd9ODyrMXHG yeQnUxX38FxKnbXQef2HDJs5G507W+Od3dSe+OIVfh/bceMMyVRLFKWf1bP03mfiCT4q6d Wep/AI3IiJ5dl9U3oRKyQwZU9+xXucg= X-MC-Unique: q9q1kCYvMAGGTrhabmITkA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 04/12] internal: Add CONCAT macro Date: Fri, 10 Sep 2021 12:45:46 +0200 Message-Id: <20210910104554.21040-5-twiederh@redhat.com> In-Reply-To: <20210910104554.21040-1-twiederh@redhat.com> References: <20210910104554.21040-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.16 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: 1631271065873100001 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 Sat Apr 20 14:53:42 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=1631270847; cv=none; d=zohomail.com; s=zohoarc; b=KtNMO49bD7H5w/t9CYiJrb0KFSfWUDYu/xUQrgnU1a6U2ZsOkc5W/mtPDnwdow+ojZNMzgmJCbMtWlHlCaY/v92Fq+UyKEOwxjllKzysdxD3usRSa8tui8CUYva5jJ7hG2RjpJ0w6XpshRfeEWXIg7rfa3gasbxbemHk+p+mvnY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631270847; 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=iv9k3QbJ9ZlWtz0sUA0chfjjyDxy7PTV3nFnfAPGzRc=; b=aq7zB+nIcp4Lt/Vgv3PnFccE0RV2aP6fsYKCmx+oYWiPJcYDyDPokbDOYKxMN+y0XgEFeltkq8tTv2AG5h5vmXeGmrEofQhjItDOAzIuZwbKoTHkqVR6SV1QnPh3EcEfaPTc3htjEoBvghQ1mY9MD63wTeDZ9Q6Khy/UfEcr0zE= 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 1631270847615628.0906581838265; Fri, 10 Sep 2021 03:47:27 -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-91-f2wWKwQtN8iDFluOLJJYaA-1; Fri, 10 Sep 2021 06:47:23 -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 7E4C680006E; Fri, 10 Sep 2021 10:47:18 +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 39AC410013D7; Fri, 10 Sep 2021 10:47:18 +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 ED3991800B9E; Fri, 10 Sep 2021 10:47:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 18AAk5PF004745 for ; Fri, 10 Sep 2021 06:46:05 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8D02F1981F; Fri, 10 Sep 2021 10:46:05 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.193.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id D07235B826; Fri, 10 Sep 2021 10:46:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631270846; 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=iv9k3QbJ9ZlWtz0sUA0chfjjyDxy7PTV3nFnfAPGzRc=; b=Kbl5GQNoQAZqHoBvyf2xKHnKDB85yNhiVWmsu1R3jZsvF8qqp469VG0ZNF3U0nG7/sv9Fl 0JhOcXUkuBbutgiN6MWhr9ujKCmGdD4FE9G0GEpqf6Xh3kiH45YMoreh6/b3a3F6i9Zs43 qIjumadWrkUDU7ZednXnSyo8tu1PuD8= X-MC-Unique: f2wWKwQtN8iDFluOLJJYaA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 05/12] virthread: Introduce virLockGuard Date: Fri, 10 Sep 2021 12:45:47 +0200 Message-Id: <20210910104554.21040-6-twiederh@redhat.com> In-Reply-To: <20210910104554.21040-1-twiederh@redhat.com> References: <20210910104554.21040-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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: 1631270850142100001 Content-Type: text/plain; charset="utf-8" Locks a virMutex on creation and unlocks it in its destructor. Typical usage: void function(virMutex *m) { g_autoptr(virLockGuard) lock =3D virLockGuardNew(m); /* `m` is locked, and released automatically on scope exit */ ... while (expression) { 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 2778fe7f8f..5701ea98a8 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -3370,6 +3370,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 Sat Apr 20 14:53:42 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=1631270850; cv=none; d=zohomail.com; s=zohoarc; b=Xv/cHZn8Kr23HfiZfKgk0g0oZGQv7gBI+H8vg8peMBOPv2bNjq/uY48XJ+gT+4CMEBLOBcbKONOwKzXsEsuikA64d9Ul6hEm5hXZpSbxU1kPSiMJsYRbnaBh3u5uTo7MoCz9leENr70b53m02FckdpfsFbjsCPC8cdbLb0GVqtU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631270850; 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=VDgXpWfJl0+iL8zvWzXsLIZyPZ5cKPeeDlyEGU/LKrc=; b=AlAdllqyCRPbFmrA2NnJH+H48rsKbcU/6L18Y9+xzh8XuYY+4KBXSfj07y26welBlVU+AGa/YNTVbopdfRHFO+fVoHXMW5mKXgjnmbCqThGIiMCxE17CTzWTZZME7csH9C8huCj3/Kzml6jQ8MFcnpUiZq8GchzfqlBc16g9qTs= 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 1631270850953829.628081616291; Fri, 10 Sep 2021 03:47:30 -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-85-s66x53N_P-iMsHOhNppZdg-1; Fri, 10 Sep 2021 06:47:27 -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 7E823801A92; Fri, 10 Sep 2021 10:47:21 +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 63B7877BE7; Fri, 10 Sep 2021 10:47:21 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3632B1805986; Fri, 10 Sep 2021 10:47:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 18AAk6fm004761 for ; Fri, 10 Sep 2021 06:46:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9C1E31981F; Fri, 10 Sep 2021 10:46:06 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.193.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id E1FE35B826; Fri, 10 Sep 2021 10:46:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631270849; 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=VDgXpWfJl0+iL8zvWzXsLIZyPZ5cKPeeDlyEGU/LKrc=; b=IWUOKiYsp+npQt/7mmYOf0Gayxx4CB215UrKhbBIQDAm/y9ddCRc6vdELYtXP24Y1dHPmR D6DscFVNia0mKYkoyDeWyPQN+S4oBauZJqsrdAGFAp2MX0AFcTNlK7NcPYpjVyqCEJRKsx 3j9Vd52plAm2+xSxnE+MVeSBxw7D2O0= X-MC-Unique: s66x53N_P-iMsHOhNppZdg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 06/12] virthread: Introduce VIR_WITH_MUTEX_LOCK_GUARD Date: Fri, 10 Sep 2021 12:45:48 +0200 Message-Id: <20210910104554.21040-7-twiederh@redhat.com> In-Reply-To: <20210910104554.21040-1-twiederh@redhat.com> References: <20210910104554.21040-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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: 1631270852158100003 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..eaa64fa73e 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 + +/** + * VIR_WITH_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 ...; + * + * VIR_WITH_MUTEX_LOCK_GUARD(mutex) { + * // `mutex` is locked, and released automatically on scope exit + * ... + * } + */ +#define VIR_WITH_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 Sat Apr 20 14:53:42 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=1631271186; cv=none; d=zohomail.com; s=zohoarc; b=YXGcuIHSe8yZKHd1Lm2Bz9+GyjGlw4ZxSPif62Je739vSWxljI5xtIN2O+jxY9mxXCg1uRWxOElaEsdJsUzAt/8utxQqFgqF8LIHBbIQSFP/W0iJ9BWKSZZ0Ym+FoJDtGpZltQyGYyTJTjElo/cyVHZoHFR3qCJdLmw6y96mo/4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631271186; 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=XdiRfmEuRvUhrvba24+jbM6QfaUs5VbfTw/hJmGcZig=; b=NTfGTcMJUINazC6fl4fvYR0KOezwNmPZrK5dEWkMl9alX90VIViM/kCP8eJh4omcl62rXvwgby8Iy0Sqaeb25J49eMo6akJVuJwdW+LrQhnyfD2ugq0IZ61IJWzJXLQvoXHl++VK4uy+2Q2JBN5SvqTb2fY0X2ickK5OraRwbsg= 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 1631271186332354.4760587921322; Fri, 10 Sep 2021 03:53:06 -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-334-Ybz7PbiqNjWf5CczBmF1SA-1; Fri, 10 Sep 2021 06:51:37 -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 2D9D01808302; Fri, 10 Sep 2021 10:51:32 +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 14476781E8; Fri, 10 Sep 2021 10:51:32 +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 D8FA64EA38; Fri, 10 Sep 2021 10:51:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 18AAk7kG004770 for ; Fri, 10 Sep 2021 06:46:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id AB8471981F; Fri, 10 Sep 2021 10:46:07 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.193.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id F171F6D980; Fri, 10 Sep 2021 10:46:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631271185; 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=XdiRfmEuRvUhrvba24+jbM6QfaUs5VbfTw/hJmGcZig=; b=hZ58DMTzCtfVPehQwNxZR5uWcMWDciC+wWiPNyrHooecy3ZXztaBMVJVU8HX/ZxkGcRSsi b0MRJZla70CGUG4kH+ksKQSInJlY/ZMG3g7gg7e9K2DVuOWbOIhlRNuJXOOzAH3NDOqPgY 4jGcwM7/ksUHGj3ctS+Ibku+WkZiFv4= X-MC-Unique: Ybz7PbiqNjWf5CczBmF1SA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 07/12] virobject: Introduce virObjectLockGuard Date: Fri, 10 Sep 2021 12:45:49 +0200 Message-Id: <20210910104554.21040-8-twiederh@redhat.com> In-Reply-To: <20210910104554.21040-1-twiederh@redhat.com> References: <20210910104554.21040-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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: 1631271187746100001 Content-Type: text/plain; charset="utf-8" Typical usage: void foobar(virObjectLockable *obj) { g_autoptr(virLockGuard) lock =3D virObjectLockGuard(obj); /* `obj` is locked, and released automatically on scope exit */ ... } Signed-off-by: Tim Wiederhake --- src/libvirt_private.syms | 1 + src/util/virobject.c | 16 ++++++++++++++++ src/util/virobject.h | 4 ++++ 3 files changed, 21 insertions(+) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 5701ea98a8..e290f62a8a 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -2943,6 +2943,7 @@ virObjectListFree; virObjectListFreeCount; virObjectLock; virObjectLockableNew; +virObjectLockGuard; virObjectNew; virObjectRef; virObjectRWLockableNew; diff --git a/src/util/virobject.c b/src/util/virobject.c index 3412985b79..4812b79d56 100644 --- a/src/util/virobject.c +++ b/src/util/virobject.c @@ -426,6 +426,22 @@ virObjectGetRWLockableObj(void *anyobj) } =20 =20 +/** + * virObjectLockGuard: + * @anyobj: any instance of virObjectLockable + * + * Acquire a lock on @anyobj that will be managed by the virLockGuard obje= ct + * returned to the caller. + */ +virLockGuard * +virObjectLockGuard(void *anyobj) +{ + virObjectLockable *obj =3D virObjectGetLockableObj(anyobj); + + return virLockGuardNew(&obj->lock); +} + + /** * virObjectLock: * @anyobj: any instance of virObjectLockable diff --git a/src/util/virobject.h b/src/util/virobject.h index 1e34c77744..0c9cbea726 100644 --- a/src/util/virobject.h +++ b/src/util/virobject.h @@ -118,6 +118,10 @@ void * virObjectRWLockableNew(virClass *klass) ATTRIBUTE_NONNULL(1); =20 +virLockGuard * +virObjectLockGuard(void *lockableobj) + ATTRIBUTE_NONNULL(1); + void virObjectLock(void *lockableobj) ATTRIBUTE_NONNULL(1); --=20 2.31.1 From nobody Sat Apr 20 14:53:42 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=1631270851; cv=none; d=zohomail.com; s=zohoarc; b=b8isOttFjcFbUu/S0lqMqZoBbV1tT3lwRstvFI5s58l6qNKK/hO3BYJqVR1GRkQeq1oqJHl/V+HReV28JrbrGhOdc+jVVeCCN2PgluUKRVMU09tx64UXLkohV2Zh4xoWI8CoyuBD/568VzD/vqJmYnTmbZSFvdOgqPUtg4qgN2E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631270851; 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=qaisCUo2jE+O6YLh3N9Rh5nWfT5Y7BfqnVHJPRr3hk8=; b=VA8TikAyF0o+joVzUQqFWka1HnURQWZP+FuYam+QoNR4FlGD3xYr1lXovbdrwuarCSD5GALIp1BvxGVhjZ8SibElq/Ai2ye9ku0W3SI7CTdQEsQITo1kQWjMTKXVHt3sGru2z3GfUgg73lPD63oyvd4RycBj8UcTenNjN35CS40= 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 1631270851347710.3716801190845; Fri, 10 Sep 2021 03:47:31 -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-256-qfCGyvIbMdCnjyCHFg2gXw-1; Fri, 10 Sep 2021 06:47:29 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2A66680292A; Fri, 10 Sep 2021 10:47:24 +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 0D39A6B556; Fri, 10 Sep 2021 10:47:24 +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 D295D4EA30; Fri, 10 Sep 2021 10:47:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 18AAk8Lu004778 for ; Fri, 10 Sep 2021 06:46:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id BB8F54180; Fri, 10 Sep 2021 10:46:08 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.193.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0D0BD5B826; Fri, 10 Sep 2021 10:46:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631270850; 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=qaisCUo2jE+O6YLh3N9Rh5nWfT5Y7BfqnVHJPRr3hk8=; b=iwzNf3IVDhEZBjImlMEmb9utuzXISrp1/mL9dAiFwlDySKyq1uwnqT4tAgi7Bb2s7g+Ror Drz7ZENF1+ksiMI9QEWcQOPNdCW52/baVf8hWFMP32rCbH2f86XJF8DAsoUnS0lxx2Pjvh rDV+QZNkVjLjW/rN9fd2w+ahEo7lRiI= X-MC-Unique: qfCGyvIbMdCnjyCHFg2gXw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 08/12] virobject: Introduce VIR_WITH_OBJECT_LOCK_GUARD Date: Fri, 10 Sep 2021 12:45:50 +0200 Message-Id: <20210910104554.21040-9-twiederh@redhat.com> In-Reply-To: <20210910104554.21040-1-twiederh@redhat.com> References: <20210910104554.21040-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.15 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: 1631270852264100005 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/virobject.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/util/virobject.h b/src/util/virobject.h index 0c9cbea726..a95985b69a 100644 --- a/src/util/virobject.h +++ b/src/util/virobject.h @@ -148,3 +148,23 @@ virObjectListFree(void *list); void virObjectListFreeCount(void *list, size_t count); + +/** + * VIR_WITH_OBJECT_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. + * + * virObjectLockable *lockable =3D ...; + * + * VIR_WITH_OBJECT_LOCK_GUARD(lockable) { + * // `lockable` is locked, and released automatically on scope ex= it + * ... + * } + */ +#define VIR_WITH_OBJECT_LOCK_GUARD(o) \ + for (g_autoptr(virLockGuard) CONCAT(var, __LINE__) =3D virObjectLockGu= ard(o); \ + CONCAT(var, __LINE__); \ + CONCAT(var, __LINE__) =3D (virLockGuardFree(CONCAT(var, __LINE__)= ), NULL)) --=20 2.31.1 From nobody Sat Apr 20 14:53:42 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=1631271056; cv=none; d=zohomail.com; s=zohoarc; b=CHv6BSHMMextQfXlnMViNzL4PbxZybtSlC6ndED4L4WRqUThml88pskGQ8Pfj1mSlkeHpbyH2woH8et+QhbSO7AkiCoEz2s+tkzZn9aSh489cy7inapZTlIOXfAS5/Spi61uqNy/flQMSvadsXv3GeqFRNOk+/C9wRUGuqNGOaw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631271056; 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=GuyxKvD+L0jW2I4zBPrJ8tQGr67KdfirHt6YLk+vkHY=; b=lV/vB3LIzmWVWjPA2eZGe/Ic77hxFr72FVaLkx25bpULWdHLaW/+1RKaIlVqbSPpuF36plPjPrQ4ODq769kDEalox9BdMaG8BkK0BpWReyCgmBfkNlWBMdHBgTkLVB24iNmBd2Rw/FmYyeyTOAxqj6UPByJoMSAA+XEuds9zwZQ= 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 1631271056938563.2949283879136; Fri, 10 Sep 2021 03:50: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-419-sS38OfISNOmRknW6urzkdA-1; Fri, 10 Sep 2021 06:50:54 -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 89BFF802934; Fri, 10 Sep 2021 10:50:49 +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 45B1977F29; Fri, 10 Sep 2021 10:50:49 +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 17DA11803B30; Fri, 10 Sep 2021 10:50:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 18AAk9ff004794 for ; Fri, 10 Sep 2021 06:46:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id CFCF82C00F; Fri, 10 Sep 2021 10:46:09 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.193.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1DD8A4180; Fri, 10 Sep 2021 10:46:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631271056; 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=GuyxKvD+L0jW2I4zBPrJ8tQGr67KdfirHt6YLk+vkHY=; b=OQRLmBqb/33LiDKkhol0MdSOt05iOxLQX6f8kOqrCJSKGhm6qwFe9xH8upVdOhtjaGHVaE JVbnAcf7x2TP0RrOixxyRECY/BPJ7OUW7lkFUwawzmWXkQNhEjgJyB50Q0PtcblMqdodCT XkQKgfh04QZfMkPMgIWAHv/NgrF1JZw= X-MC-Unique: sS38OfISNOmRknW6urzkdA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 09/12] virChrdevFDStreamCloseCb: Use virLockGuardNew Date: Fri, 10 Sep 2021 12:45:51 +0200 Message-Id: <20210910104554.21040-10-twiederh@redhat.com> In-Reply-To: <20210910104554.21040-1-twiederh@redhat.com> References: <20210910104554.21040-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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: 1631271057569100003 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..fe11e10437 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); + 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 Sat Apr 20 14:53:42 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=1631271126; cv=none; d=zohomail.com; s=zohoarc; b=VD+kNF9BcAf9iZx9W6ZPxCfhCbEowQrqQLiJCCrysTDcYAWSMB4x+yR5w5zGJCE+jHhaRKrWlKzX5gz695DGrHq9bokBKFn9Z6rJr31qILiOG6/O15ieuKHz+A3t9ZxrhIi++2DALhUCCpob2VYFXThzsZI4WjmXafS/w1Fy2mY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631271126; 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=cF7KUrIvMhPJeyGBHizpzBsPPQ5b4zMRptEcFTjlsn0=; b=Y4Md5PAYmuUqQ1E4pz7aBH6NDNRZcX6qjNEq2ozdPK12SiaGtvgQ2OSxyHOeCrBPbwGBHS0Ls2Q9cVTJK1V2Ojtao0OMGo07caps4X8tyZNqUTBKdwIqIdNm+51reDie521kkCZCK79KbS4JRrqJ9xFGAG6SA1cNRVxTNJsAZGY= 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 1631271126035211.10918395376802; Fri, 10 Sep 2021 03:52:06 -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-370-BTTki1kMOeG1mfN_O_R6rg-1; Fri, 10 Sep 2021 06:51:40 -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 0C847835DE1; Fri, 10 Sep 2021 10:51:35 +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 BF10110013D7; Fri, 10 Sep 2021 10:51:34 +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 9107D1805989; Fri, 10 Sep 2021 10:51:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 18AAkA6A004799 for ; Fri, 10 Sep 2021 06:46:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id E38F54180; Fri, 10 Sep 2021 10:46:10 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.193.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 31E9C5B826; Fri, 10 Sep 2021 10:46:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631271125; 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=cF7KUrIvMhPJeyGBHizpzBsPPQ5b4zMRptEcFTjlsn0=; b=CQhbiiI/6OaCviiMsOiGxgRJkHHmZeJ6CRBqumlrREPg0G/ph3SIzrX4mQN+R965d2LM68 xkvMThSekCKk2VewVrQqroc7GEyuKOnQoGre+ONwxMHgx8FRopb7BXJSif8ZIk5EK+oRUA PRttUh+JL1T2uKFTN9h5xJp9jiUhyBg= X-MC-Unique: BTTki1kMOeG1mfN_O_R6rg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 10/12] virChrdevFree: Use VIR_WITH_MUTEX_LOCK Date: Fri, 10 Sep 2021 12:45:52 +0200 Message-Id: <20210910104554.21040-11-twiederh@redhat.com> In-Reply-To: <20210910104554.21040-1-twiederh@redhat.com> References: <20210910104554.21040-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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: 1631271126252100001 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 fe11e10437..58e3c84aad 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); + VIR_WITH_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 Sat Apr 20 14:53:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1631271059; cv=none; d=zohomail.com; s=zohoarc; b=BW/s9F4rFySzIoULSkR5T4j+yO08ZUzayyBAx3WHvA2DmGAn5RkPsKDeCCz776ran+dYPv4pKGB+pVg639ubWeNosSotklT8q6fHqyugtjrr4bkNsfnChMaRZq5a0xTuomttn/glaa4/pDix1aF/Zpqc4FeO5SSwSf/ZtbkLQkc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631271059; 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=zuWhMRoaLtw1kSMIfAaCUUKfkpsyI2DbclYQFzBDUhk=; b=H6zSqsC4jGf/UL/ylnD6QCwhSMlwQ27xot4to0LxgFTfXgo8sKLSO8crchOidG1rQtibcnX6kWh/tGYkUfyW5RvqGNfQydCrovKH6qeNGvxaElOSj5c4tr1E5edw840UoX/UFmoKo+0dysJgSiXBm/J5yE+RVkZFQ4Q/u2Zj0x8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1631271059454131.07889550152026; Fri, 10 Sep 2021 03:50:59 -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-33-hhrwWQ_cPjCUk-51Xl2hJw-1; Fri, 10 Sep 2021 06:50:57 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 12BA51006AA8; Fri, 10 Sep 2021 10:50:52 +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 E91465C25D; Fri, 10 Sep 2021 10:50:51 +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 BCAA91805989; Fri, 10 Sep 2021 10:50:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 18AAkCbV004807 for ; Fri, 10 Sep 2021 06:46:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id 018132C00F; Fri, 10 Sep 2021 10:46:12 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.193.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 45CE44180; Fri, 10 Sep 2021 10:46:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631271058; 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=zuWhMRoaLtw1kSMIfAaCUUKfkpsyI2DbclYQFzBDUhk=; b=Ii2QDWLkkiqmvQDFObskM99MEQ3G0xlP+5xp6ThXFVEmdIj+OTNZK3QsaGYaC6KzallJsM gXvBEgvvxfkzCCpoc+ruXyZOeZJWzwWTTpbDHqpXAgQtnejmCVBCPw1uRalvV40XfyoO8l Hu30NpqYlHuajRwrLIJBUAD56LjSq/I= X-MC-Unique: hhrwWQ_cPjCUk-51Xl2hJw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 11/12] bhyveAutostartDomain: Use virObjectLockGuard Date: Fri, 10 Sep 2021 12:45:53 +0200 Message-Id: <20210910104554.21040-12-twiederh@redhat.com> In-Reply-To: <20210910104554.21040-1-twiederh@redhat.com> References: <20210910104554.21040-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.16 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: 1631271059643100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake --- src/bhyve/bhyve_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c index 516490f6cd..cdd833f896 100644 --- a/src/bhyve/bhyve_driver.c +++ b/src/bhyve/bhyve_driver.c @@ -87,7 +87,8 @@ bhyveAutostartDomain(virDomainObj *vm, void *opaque) { const struct bhyveAutostartData *data =3D opaque; int ret =3D 0; - virObjectLock(vm); + g_autoptr(virLockGuard) lock =3D virObjectLockGuard(vm); + if (vm->autostart && !virDomainObjIsActive(vm)) { virResetLastError(); ret =3D virBhyveProcessStart(data->conn, vm, @@ -98,7 +99,6 @@ bhyveAutostartDomain(virDomainObj *vm, void *opaque) vm->def->name, virGetLastErrorMessage()); } } - virObjectUnlock(vm); return ret; } =20 --=20 2.31.1 From nobody Sat Apr 20 14:53:42 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=1631271105; cv=none; d=zohomail.com; s=zohoarc; b=g2JnhQGVAvwny93MVmsf5Q+qj7bJQANa0ri8w18uYHnB/mWqiVQb7uAAM2u+RlCYDRz3hpwz11g2jod07Sth22MA8d6nJE8lcMY4iUW3RdOWZViYnTv5AcIFtc2hgcK1M3Ril4BNdvhwJ0pItTxGJWdIEYYICr+UmZPRpwyeNqg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631271105; 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=KgMRrtQofiRmzgzeeJPAqzDYZm0uw6TKrxh6PpEqAbY=; b=WbvkN5xnc9HIneLUd4S5jA7DiT4eJRFDPnxR9TTVqK0Zngd5r68iBe/RURH+iKDgqLuiCSqyvN77YKY9Fjavrtr2V4/Prvw/8oEAD1VCIaZDUwWsE58SFk2K7uT5eAdCHtRWaYifbau7zLqe8IcZX4O74Z3UyYS/heYnEBm/zwU= 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 1631271105467538.3389059169518; Fri, 10 Sep 2021 03:51:45 -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-89-2zbHOrH8MB-xYd9seK-2Ig-1; Fri, 10 Sep 2021 06:51:42 -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 9D6471808305; Fri, 10 Sep 2021 10:51:37 +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 8084B10013D7; Fri, 10 Sep 2021 10:51:37 +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 53B7A1806D01; Fri, 10 Sep 2021 10:51:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 18AAkDdC004824 for ; Fri, 10 Sep 2021 06:46:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2B27F4180; Fri, 10 Sep 2021 10:46:13 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.193.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6F6B269FAE; Fri, 10 Sep 2021 10:46:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631271104; 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=KgMRrtQofiRmzgzeeJPAqzDYZm0uw6TKrxh6PpEqAbY=; b=Xiql9tWD3hKdzF5GQgVDYuSY+c41RetqxKuuDKt+prJAK14/dexUPKhqa5VKr8XlZCz7hp Wb7Dk5l2n9RYLM+fHAOfT00/a5LCCgM8Ny2N9qWQEEfuvM4FhdMVfJDVaEQH9LHVu1Lfqd tf+F8e0XWdX/gnLJMDoRgt8z0kQaplY= X-MC-Unique: 2zbHOrH8MB-xYd9seK-2Ig-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 12/12] lxcDomainDetachDeviceHostdevUSBLive: Use VIR_WITH_OBJECT_LOCK_GUARD Date: Fri, 10 Sep 2021 12:45:54 +0200 Message-Id: <20210910104554.21040-13-twiederh@redhat.com> In-Reply-To: <20210910104554.21040-1-twiederh@redhat.com> References: <20210910104554.21040-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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: 1631271106790100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake --- src/lxc/lxc_driver.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index e2720a6f89..528af5d164 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -4079,9 +4079,9 @@ lxcDomainDetachDeviceHostdevUSBLive(virLXCDriver *dri= ver, VIR_WARN("cannot deny device %s for domain %s: %s", dst, vm->def->name, virGetLastErrorMessage()); =20 - virObjectLock(hostdev_mgr->activeUSBHostdevs); - virUSBDeviceListDel(hostdev_mgr->activeUSBHostdevs, usb); - virObjectUnlock(hostdev_mgr->activeUSBHostdevs); + VIR_WITH_OBJECT_LOCK_GUARD(hostdev_mgr->activeUSBHostdevs) { + virUSBDeviceListDel(hostdev_mgr->activeUSBHostdevs, usb); + } =20 virDomainHostdevRemove(vm->def, idx); virDomainHostdevDefFree(def); --=20 2.31.1