From nobody Sun May 5 09:50:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1566342964; cv=none; d=zoho.com; s=zohoarc; b=Lpf6/AimsXExIjdy9lRn5vZfTMJFEj6E3DBQzHyH+Yi1jnxXQmkyJF+J/IvlzGraxapiEgMZiDbfsHj4/70ZPHoljjmjS0CN12YWkmSqk5YtqL99NEmDTxTiUAJQ9oRkncTx8vfukI5bAZ2MwllZfWCmKbP7VWpiG7oImwwdLK8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566342964; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=HjzwI+WiKEd9mHbbALlZThnACvKgmyngAvEiirHVDQg=; b=mhripEbhMcSNcPwxmQ7uhCZCV67OqxGU3PKn9ERryT5gyLetb+Bo9FFjAOu+gnC0VQN91w2rlzfPcQesnZESictUszltfCK0QH4EMXz8BfA5piD55wnwRG1p6sWC5uCZcjv1WEgkTY7r2RgqGedvdV9snTtOzNWN8h73svVxjds= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566342964990442.93996077862687; Tue, 20 Aug 2019 16:16:04 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9AA5510F23F1; Tue, 20 Aug 2019 23:16:03 +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 717519CC9; Tue, 20 Aug 2019 23:16:03 +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 37A79180BA99; Tue, 20 Aug 2019 23:16:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7KNFner013549 for ; Tue, 20 Aug 2019 19:15:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id BF43C60605; Tue, 20 Aug 2019 23:15:49 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 486292C8DC for ; Tue, 20 Aug 2019 23:15:49 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 21 Aug 2019 01:15:23 +0200 Message-Id: <18bf2b21f3d14466ed001ccc9788d4e13128ab0f.1566342869.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 01/21] virDomainDefNamespaceParse: remove unused attributes 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Tue, 20 Aug 2019 23:16:04 +0000 (UTC) Neither the xmlDocPtr nor the root xmlNode (also passed in the XPathContext) are interesting to the callees. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Jiri Denemark --- src/bhyve/bhyve_domain.c | 4 +--- src/conf/capabilities.h | 3 +-- src/conf/domain_conf.c | 4 ++-- src/lxc/lxc_domain.c | 4 +--- src/qemu/qemu_domain.c | 4 +--- src/test/test_driver.c | 4 +--- 6 files changed, 7 insertions(+), 16 deletions(-) diff --git a/src/bhyve/bhyve_domain.c b/src/bhyve/bhyve_domain.c index 67cd6cc039..51366f8e26 100644 --- a/src/bhyve/bhyve_domain.c +++ b/src/bhyve/bhyve_domain.c @@ -196,9 +196,7 @@ bhyveDomainDefNamespaceFree(void *nsdata) } =20 static int -bhyveDomainDefNamespaceParse(xmlDocPtr xml ATTRIBUTE_UNUSED, - xmlNodePtr root ATTRIBUTE_UNUSED, - xmlXPathContextPtr ctxt, +bhyveDomainDefNamespaceParse(xmlXPathContextPtr ctxt, void **data) { bhyveDomainCmdlineDefPtr cmd =3D NULL; diff --git a/src/conf/capabilities.h b/src/conf/capabilities.h index 28b398891a..41c81ceeb1 100644 --- a/src/conf/capabilities.h +++ b/src/conf/capabilities.h @@ -182,8 +182,7 @@ struct _virCapsStoragePool { }; =20 =20 -typedef int (*virDomainDefNamespaceParse)(xmlDocPtr, xmlNodePtr, - xmlXPathContextPtr, void **); +typedef int (*virDomainDefNamespaceParse)(xmlXPathContextPtr, void **); typedef void (*virDomainDefNamespaceFree)(void *); typedef int (*virDomainDefNamespaceXMLFormat)(virBufferPtr, void *); typedef const char *(*virDomainDefNamespaceHref)(void); diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 604e006dab..40b5f9b801 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -19643,7 +19643,7 @@ virDomainMemorytuneDefParse(virDomainDefPtr def, =20 static virDomainDefPtr virDomainDefParseXML(xmlDocPtr xml, - xmlNodePtr root, + xmlNodePtr root ATTRIBUTE_UNUSED, xmlXPathContextPtr ctxt, virCapsPtr caps, virDomainXMLOptionPtr xmlopt, @@ -21345,7 +21345,7 @@ virDomainDefParseXML(xmlDocPtr xml, def->ns =3D xmlopt->ns; =20 if (def->ns.parse && - (def->ns.parse)(xml, root, ctxt, &def->namespaceData) < 0) + (def->ns.parse)(ctxt, &def->namespaceData) < 0) goto error; =20 return def; diff --git a/src/lxc/lxc_domain.c b/src/lxc/lxc_domain.c index 51a9fd36eb..87f3c7bd63 100644 --- a/src/lxc/lxc_domain.c +++ b/src/lxc/lxc_domain.c @@ -207,9 +207,7 @@ lxcDomainDefNamespaceFree(void *nsdata) } =20 static int -lxcDomainDefNamespaceParse(xmlDocPtr xml ATTRIBUTE_UNUSED, - xmlNodePtr root ATTRIBUTE_UNUSED, - xmlXPathContextPtr ctxt, +lxcDomainDefNamespaceParse(xmlXPathContextPtr ctxt, void **data) { lxcDomainDefPtr lxcDef =3D NULL; diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index a06672333c..880307f215 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3626,9 +3626,7 @@ qemuDomainDefNamespaceParseCaps(qemuDomainXmlNsDefPtr= nsdef, =20 =20 static int -qemuDomainDefNamespaceParse(xmlDocPtr xml ATTRIBUTE_UNUSED, - xmlNodePtr root ATTRIBUTE_UNUSED, - xmlXPathContextPtr ctxt, +qemuDomainDefNamespaceParse(xmlXPathContextPtr ctxt, void **data) { qemuDomainXmlNsDefPtr nsdata =3D NULL; diff --git a/src/test/test_driver.c b/src/test/test_driver.c index c39eef2d4b..a59984051d 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -198,9 +198,7 @@ testDomainDefNamespaceFree(void *data) } =20 static int -testDomainDefNamespaceParse(xmlDocPtr xml ATTRIBUTE_UNUSED, - xmlNodePtr root ATTRIBUTE_UNUSED, - xmlXPathContextPtr ctxt, +testDomainDefNamespaceParse(xmlXPathContextPtr ctxt, void **data) { testDomainNamespaceDefPtr nsdata =3D NULL; --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 09:50:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1566342956; cv=none; d=zoho.com; s=zohoarc; b=WygUVClDnl5AKlK9sJb6CSAagk4cvqMmyzg0kMB7L0WGgcY50BMI2kGQYmnWnNypZx0njigoLMLHWiVDq4QNGN7XwsGgojuMfrKveeI4ZZv5u37Wd/7XufCOMnfimNFs1ObPSFBc4LVMoecj1QTtKkJl0raohMVeOHxBR0InMJY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566342956; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=TD5tuRYod4y4GF8F8Vtr7NhiWU26EsCj2oHJPGT9kbg=; b=DxQQ19RpGfQ+g3j/QCaYWgfvgDGVEcc64u6anQD58IwTvrwMK4onVP4qslRpmIZ0Ey6tTMGdw9HRhBpIFgN3p654q+aYQhfVweS+GVFckuEtwG9enGUIk9HDDWDBV8I7KuqmfxwOVRhxtP9ZdXxgOnSNl2/aBe/c69d9omUNv1g= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566342956175595.8215265064476; Tue, 20 Aug 2019 16:15:56 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 7EE81195D837; Tue, 20 Aug 2019 23:15:54 +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 57FFD183A1; Tue, 20 Aug 2019 23:15:54 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 5351F2551B; Tue, 20 Aug 2019 23:15:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7KNFo3U013556 for ; Tue, 20 Aug 2019 19:15:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8E3662C8DC; Tue, 20 Aug 2019 23:15:50 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 17BA360605 for ; Tue, 20 Aug 2019 23:15:49 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 21 Aug 2019 01:15:24 +0200 Message-Id: <43eda1b5d305d901c5225e61d1066266015b4dac.1566342869.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 02/21] virDomainDefParseXML: remove unused parameter 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.62]); Tue, 20 Aug 2019 23:15:54 +0000 (UTC) We do not need to pass the root node, since it's already included in the XPathContext. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Jiri Denemark --- src/conf/domain_conf.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 40b5f9b801..1f2a91c710 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -19643,7 +19643,6 @@ virDomainMemorytuneDefParse(virDomainDefPtr def, =20 static virDomainDefPtr virDomainDefParseXML(xmlDocPtr xml, - xmlNodePtr root ATTRIBUTE_UNUSED, xmlXPathContextPtr ctxt, virCapsPtr caps, virDomainXMLOptionPtr xmlopt, @@ -21386,7 +21385,7 @@ virDomainObjParseXML(xmlDocPtr xml, =20 oldnode =3D ctxt->node; ctxt->node =3D config; - obj->def =3D virDomainDefParseXML(xml, config, ctxt, caps, xmlopt, fla= gs); + obj->def =3D virDomainDefParseXML(xml, ctxt, caps, xmlopt, flags); ctxt->node =3D oldnode; if (!obj->def) goto error; @@ -21531,7 +21530,7 @@ virDomainDefParseNode(xmlDocPtr xml, =20 ctxt->node =3D root; =20 - if (!(def =3D virDomainDefParseXML(xml, root, ctxt, caps, xmlopt, flag= s))) + if (!(def =3D virDomainDefParseXML(xml, ctxt, caps, xmlopt, flags))) goto cleanup; =20 /* callback to fill driver specific domain aspects */ --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 09:50:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1566342968; cv=none; d=zoho.com; s=zohoarc; b=VnSdXLFzrgy9yZzBHeNFsxfxRgzG888XGxumZT/C0eVzO/R0GQ04o5szyK+HkMSbby+1H7H5EUzfeTQrrNPWpwZcjAGSxpj85WfJGoJUI4JYJi9f+ghOjB/KTGl6827eobfzHw+ZRQRNJzNOAFcY4/mJa4+be8ep0568HPf5WN4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566342968; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=8KUig7Rvo9wb21mSOvhPOKIKqaj/m9CtDALFcf/KKmk=; b=Fslh351+jWxNZie0xxO4KzqZ9O379Nujxy7hHzOAfNqTqoMshCBzVTyG00Pv8Bun8ET4KK9Osg6M24ZWdZdZRMslfvCKrYga6tsJuMzqwG7OPcqHFP8Tvh5YKYhpqGnGLclSfCfFRb5ScCUvJEB1Nr7y6rI8OfEusRxCtqllbaQ= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566342968554132.46598639350555; Tue, 20 Aug 2019 16:16:08 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1E5C3307D930; Tue, 20 Aug 2019 23:16:07 +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 ECFC957A7; Tue, 20 Aug 2019 23:16:06 +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 B2DBA24FDE; Tue, 20 Aug 2019 23:16:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7KNFpsi013567 for ; Tue, 20 Aug 2019 19:15:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5E02660605; Tue, 20 Aug 2019 23:15:51 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id DB2C32C8EA for ; Tue, 20 Aug 2019 23:15:50 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 21 Aug 2019 01:15:25 +0200 Message-Id: <3f841b67e6c638fe810650b6f8a1d1b98255913d.1566342869.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 03/21] prepare: domain format if format not href 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Tue, 20 Aug 2019 23:16:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" --- src/conf/domain_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 1f2a91c710..f848483235 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -28312,7 +28312,7 @@ virDomainDefFormatInternal(virDomainDefPtr def, virBufferAsprintf(buf, "id); - if (def->namespaceData && def->ns.href) + if (def->namespaceData && def->ns.format) virBufferAsprintf(buf, " %s", (def->ns.href)()); virBufferAddLit(buf, ">\n"); virBufferAdjustIndent(buf, 2); --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 09:50:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1566342971; cv=none; d=zoho.com; s=zohoarc; b=Yg8V4gwRZp44mnKREjcGZ4finc8QgfB5zFjWqaazMtPwMfoZ+3Iqt3BUk3P7rBRYmS9bWpFXIDQViq4Zgy/QpFM1kAW4hk1AGWUFa44hGI8tLwBM8rUfq9R+ktghLNxL9zCsmn+WT3wScUAmPRgtE0v4MBHUh9ZJykQ5kUeI4i8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566342971; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=/SR67R4k8qqyVdP1ohQ0bMx4RllCwQncHIJ7F3ubstQ=; b=RT2HIZl59HRW0W3AdtEwWa8bdeWHwlrO6VqS6Xkr4fZGS7f1m5Xt3zhLw1KqlafYVknQEQ0ESxNmzGCpI2rsXwfrr1n8kDo9YNbpWOE6YqScsAPEaRpnq7vdEPj94uApONhJ7yKZi6k4HU19kyhDDH1n44ZUjt4WI2B9AeEtzlA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566342971670327.61363984161403; Tue, 20 Aug 2019 16:16:11 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 71E827F75D; Tue, 20 Aug 2019 23:16:10 +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 456222C8E4; Tue, 20 Aug 2019 23:16:10 +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 F3F08180BAA2; Tue, 20 Aug 2019 23:16:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7KNFqoC013574 for ; Tue, 20 Aug 2019 19:15:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2E50360605; Tue, 20 Aug 2019 23:15:52 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id AAEDF2C8DC for ; Tue, 20 Aug 2019 23:15:51 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 21 Aug 2019 01:15:26 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 04/21] conf: ns.parse: decouple call from condition 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Tue, 20 Aug 2019 23:16:10 +0000 (UTC) In the future we will perform more actions if ns.parse is present. Decouple the condition from the actual call. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Jiri Denemark --- src/conf/domain_conf.c | 7 ++++--- src/conf/network_conf.c | 7 ++++--- src/conf/storage_conf.c | 7 ++++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index f848483235..c8c304d2a2 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -21343,9 +21343,10 @@ virDomainDefParseXML(xmlDocPtr xml, */ def->ns =3D xmlopt->ns; =20 - if (def->ns.parse && - (def->ns.parse)(ctxt, &def->namespaceData) < 0) - goto error; + if (def->ns.parse) { + if ((def->ns.parse)(ctxt, &def->namespaceData) < 0) + goto error; + } =20 return def; =20 diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index c5a243684a..f55b9e5409 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -2050,9 +2050,10 @@ virNetworkDefParseXML(xmlXPathContextPtr ctxt, =20 if (xmlopt) def->ns =3D xmlopt->ns; - if (def->ns.parse && - (def->ns.parse)(ctxt, &def->namespaceData) < 0) - goto error; + if (def->ns.parse) { + if ((def->ns.parse)(ctxt, &def->namespaceData) < 0) + goto error; + } =20 ctxt->node =3D save; return def; diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 05055cdc29..a2b977989f 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -997,9 +997,10 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt) /* Make a copy of all the callback pointers here for easier use, * especially during the virStoragePoolSourceClear method */ def->ns =3D options->ns; - if (def->ns.parse && - (def->ns.parse)(ctxt, &def->namespaceData) < 0) - return NULL; + if (def->ns.parse) { + if ((def->ns.parse)(ctxt, &def->namespaceData) < 0) + return NULL; + } =20 VIR_STEAL_PTR(ret, def); return ret; --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 09:50:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1566342974; cv=none; d=zoho.com; s=zohoarc; b=f/BEwbr14oia0bOECYoQahxSs1png0aeoKNCWFEKBnDLkwCqSXSr1FVQ4K4KcmyChYWauAVTBkE1SfDNkbw6XsKjSQucExt+R1ry8CEOR8BCAMSX2mLCxoERgRcMemnhxTCuNqBPShjSZPkAVnKvdto+YJjkfyORtr8UOP6PqMg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566342974; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=5a1sgCTYrSYesiWCwNXkOebcGRyaBLSXd+oa3DKKv/U=; b=Db7+X9qbLq4GLgnhB0l6AkC2LvnXtfmyuTby2uKFjjkZAoHW/LEHoonvnb7bvTGQJXUZcGVeiS8SAfqJoYXN5M/XEwsHmGa4SdAiLS5xuMTaI/pYyJongEeNHpgZ2oFcpnqGlkOtPOCUqHQpZ+/6FOpFFfBv7PhfUkvD1PsJytA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566342974962448.716143903995; Tue, 20 Aug 2019 16:16:14 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id B67C13092775; Tue, 20 Aug 2019 23:16:13 +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 875C02C8E2; Tue, 20 Aug 2019 23:16:13 +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 47581180BAA6; Tue, 20 Aug 2019 23:16:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7KNFqLl013582 for ; Tue, 20 Aug 2019 19:15:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id F01932C8DC; Tue, 20 Aug 2019 23:15:52 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7A4F960605 for ; Tue, 20 Aug 2019 23:15:52 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 21 Aug 2019 01:15:27 +0200 Message-Id: <6c3913c0203ab21876f44dfcd2da880062a4c829.1566342869.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 05/21] util: introduce virXMLNamespace 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Tue, 20 Aug 2019 23:16:14 +0000 (UTC) For various XMLs, we allow a custom namespace for passing unsupported configurations. Introduce a single structure to hold all the driver-specific functions to remove duplication. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Jiri Denemark --- src/util/virxml.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/util/virxml.h b/src/util/virxml.h index 6208977dd1..5b209bb040 100644 --- a/src/util/virxml.h +++ b/src/util/virxml.h @@ -246,3 +246,17 @@ VIR_DEFINE_AUTOCLEAN_FUNC(virXPathContextNodeSave, vir= XPathContextNodeRestore); =20 VIR_DEFINE_AUTOPTR_FUNC(xmlDoc, xmlFreeDoc); VIR_DEFINE_AUTOPTR_FUNC(xmlXPathContext, xmlXPathFreeContext); + +typedef int (*virXMLNamespaceParse)(xmlXPathContextPtr, void **); +typedef void (*virXMLNamespaceFree)(void *); +typedef int (*virXMLNamespaceFormat)(virBufferPtr, void *); +typedef const char *(*virXMLNamespaceHref)(void); + +struct _virXMLNamespace { + virXMLNamespaceParse parse; + virXMLNamespaceFree free; + virXMLNamespaceFormat format; + virXMLNamespaceHref href; +}; +typedef struct _virXMLNamespace virXMLNamespace; +typedef virXMLNamespace *virXMLNamespacePtr; --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 09:50:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1566342965; cv=none; d=zoho.com; s=zohoarc; b=euUMzgxkCtvQtuEpCJfQNjB3ImHmhtkQS4J7aPccqKnvPRzZgRgKI+L6EAxhIPvzHuJj6dgTsDyIO3H6xf/a2lX0Z841rHzppEKZDDueV4srgqFzI1gPmVZEQd2HkHVKk94cdJE6jEMXM0FJzPsoTlkjNugsGN9Oly5PX9V1kZg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566342965; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=tfiNFP47WBt8Zxz5HoQEBIcUShT/3ml3RZjHKVq41kE=; b=XUfNswdekFrr2zo99uhY3Dl6+oF8WoRThFyQv+pbou6BpDMj9rCFQyIiRwT3sZ0YIR47DydIC8IACXKwudTOU0FChVOcWKi5+LBtHq1P4O6CW/iMKOre7FkszljedWBVwozpZ3jE2aZhIQTXzjkbjAf4wBmSjRjbhyNXsnqhjAM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 156634296575123.392239954040065; Tue, 20 Aug 2019 16:16:05 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8636110F23F2; Tue, 20 Aug 2019 23:16:04 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5E8195B82F; Tue, 20 Aug 2019 23:16:04 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 133FC2551F; Tue, 20 Aug 2019 23:16:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7KNFrPe013593 for ; Tue, 20 Aug 2019 19:15:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id C185B60605; Tue, 20 Aug 2019 23:15:53 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4AA592C8DC for ; Tue, 20 Aug 2019 23:15:53 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 21 Aug 2019 01:15:28 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 06/21] conf: network: use generic XML namespace types 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Tue, 20 Aug 2019 23:16:05 +0000 (UTC) There is no need to copy and paste the same types pointing to void all over the place. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Jiri Denemark --- src/conf/network_conf.c | 2 +- src/conf/network_conf.h | 25 ++++--------------------- src/network/bridge_driver.c | 2 +- src/network/bridge_driver.h | 2 +- 4 files changed, 7 insertions(+), 24 deletions(-) diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index f55b9e5409..2c3a11fb10 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -93,7 +93,7 @@ virNetworkXMLOnceInit(void) VIR_ONCE_GLOBAL_INIT(virNetworkXML); =20 virNetworkXMLOptionPtr -virNetworkXMLOptionNew(virNetworkXMLNamespacePtr xmlns) +virNetworkXMLOptionNew(virXMLNamespacePtr xmlns) { virNetworkXMLOptionPtr xmlopt; =20 diff --git a/src/conf/network_conf.h b/src/conf/network_conf.h index b167b57e85..d5dd8480db 100644 --- a/src/conf/network_conf.h +++ b/src/conf/network_conf.h @@ -23,10 +23,6 @@ =20 #define DNS_RECORD_LENGTH_SRV (512 - 30) /* Limit minus overhead as ment= ioned in RFC-2782 */ =20 -#include -#include -#include - #include "internal.h" #include "virthread.h" #include "virsocketaddr.h" @@ -40,25 +36,12 @@ #include "virobject.h" #include "virmacmap.h" #include "virenum.h" - -typedef int (*virNetworkDefNamespaceParse)(xmlXPathContextPtr, void **); -typedef void (*virNetworkDefNamespaceFree)(void *); -typedef int (*virNetworkDefNamespaceXMLFormat)(virBufferPtr, void *); -typedef const char *(*virNetworkDefNamespaceHref)(void); - -typedef struct _virNetworkXMLNamespace virNetworkXMLNamespace; -typedef virNetworkXMLNamespace *virNetworkXMLNamespacePtr; -struct _virNetworkXMLNamespace { - virNetworkDefNamespaceParse parse; - virNetworkDefNamespaceFree free; - virNetworkDefNamespaceXMLFormat format; - virNetworkDefNamespaceHref href; -}; +#include "virxml.h" =20 struct _virNetworkXMLOption { virObject parent; =20 - virNetworkXMLNamespace ns; + virXMLNamespace ns; }; typedef struct _virNetworkXMLOption virNetworkXMLOption; typedef virNetworkXMLOption *virNetworkXMLOptionPtr; @@ -295,7 +278,7 @@ struct _virNetworkDef { =20 /* Network specific XML namespace data */ void *namespaceData; - virNetworkXMLNamespace ns; + virXMLNamespace ns; }; =20 typedef enum { @@ -317,7 +300,7 @@ enum { }; =20 virNetworkXMLOptionPtr -virNetworkXMLOptionNew(virNetworkXMLNamespacePtr xmlns); +virNetworkXMLOptionNew(virXMLNamespacePtr xmlns); =20 virNetworkDefPtr virNetworkDefCopy(virNetworkDefPtr def, diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 9059296e55..b34b742bfa 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -248,7 +248,7 @@ networkDnsmasqDefNamespaceHref(void) } =20 =20 -virNetworkXMLNamespace networkDnsmasqXMLNamespace =3D { +virXMLNamespace networkDnsmasqXMLNamespace =3D { .parse =3D networkDnsmasqDefNamespaceParse, .free =3D networkDnsmasqDefNamespaceFree, .format =3D networkDnsmasqDefNamespaceFormatXML, diff --git a/src/network/bridge_driver.h b/src/network/bridge_driver.h index b095388a0b..d35850d293 100644 --- a/src/network/bridge_driver.h +++ b/src/network/bridge_driver.h @@ -27,7 +27,7 @@ #include "virdnsmasq.h" #include "virnetworkobj.h" =20 -extern virNetworkXMLNamespace networkDnsmasqXMLNamespace; +extern virXMLNamespace networkDnsmasqXMLNamespace; =20 typedef struct _networkDnsmasqXmlNsDef networkDnsmasqXmlNsDef; typedef networkDnsmasqXmlNsDef *networkDnsmasqXmlNsDefPtr; --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 09:50:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1566342978; cv=none; d=zoho.com; s=zohoarc; b=dxwhxMcNHIKvA+yk2vjT3kINRbslrEdum/Zh6+9rrJUntG3O+T/fBRDE9j8ugCE6+rKwr1ZooYIBAnWmkV6WIcsyyFQQP3RqANN/j2eRL+/C8mx3Maj13e0oqdDGmbJsVlinn1ZnaWT/3+m8mWJiyfr2es3rVihYqUo0MFo33TA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566342978; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=82yTJ1CDhCQY2ezhPiLzg2gxXC1L1t9s1TOsKXb+a2U=; b=m6r6feaBS1/iVLMOJL5DoeaY+ZqK85gJq/ij3qzyZYmINpfxRksrgChD8uRn1Ia5rWX3m2lSrulohqvxnnIDZOuNtf1MMHzCSvS0swXOLQ5jXVDNeuCtLLCtlxyFRwJnCCJcgHT7ipsEeKIIBTalGt+8DHd9rbmZ9bRsw6b/ju0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566342978685793.9527256453301; Tue, 20 Aug 2019 16:16:18 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 3E106308FBB1; Tue, 20 Aug 2019 23:16:17 +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 135992C8E3; Tue, 20 Aug 2019 23:16:17 +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 D3146180BAB9; Tue, 20 Aug 2019 23:16:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7KNFsQu013601 for ; Tue, 20 Aug 2019 19:15:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id 923E42C8DC; Tue, 20 Aug 2019 23:15:54 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1B5F760605 for ; Tue, 20 Aug 2019 23:15:53 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 21 Aug 2019 01:15:29 +0200 Message-Id: <5988d35c785de2f9732285517d2f9e54100a2c01.1566342869.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 07/21] conf: storage: use generic XML namespace types 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Tue, 20 Aug 2019 23:16:17 +0000 (UTC) There is no need to copy and paste the same types pointing to void all over the place. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Jiri Denemark --- src/conf/storage_conf.c | 4 ++-- src/conf/storage_conf.h | 23 ++++------------------- src/storage/storage_backend_fs.c | 2 +- src/storage/storage_backend_rbd.c | 2 +- src/storage/storage_util.c | 2 +- src/storage/storage_util.h | 2 +- 6 files changed, 10 insertions(+), 25 deletions(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index a2b977989f..fb8a16a119 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -140,7 +140,7 @@ struct _virStoragePoolOptions { int defaultFormat; int lastFormat; =20 - virStoragePoolXMLNamespace ns; + virXMLNamespace ns; =20 virStoragePoolFormatToString formatToString; virStoragePoolFormatFromString formatFromString; @@ -341,7 +341,7 @@ virStoragePoolOptionsForPoolType(int type) */ int virStoragePoolOptionsPoolTypeSetXMLNamespace(int type, - virStoragePoolXMLNamespacePtr= ns) + virXMLNamespacePtr ns) { int ret =3D -1; virStoragePoolTypeInfoPtr backend =3D virStoragePoolTypeInfoLookup(typ= e); diff --git a/src/conf/storage_conf.h b/src/conf/storage_conf.h index f399ac6192..1f62803a9d 100644 --- a/src/conf/storage_conf.h +++ b/src/conf/storage_conf.h @@ -31,28 +31,13 @@ #include "storage_adapter_conf.h" #include "virautoclean.h" #include "virenum.h" +#include "virxml.h" + =20 -#include - -/* Various callbacks needed to parse/create Storage Pool XML's using - * a private namespace */ -typedef int (*virStoragePoolDefNamespaceParse)(xmlXPathContextPtr, void **= ); -typedef void (*virStoragePoolDefNamespaceFree)(void *); -typedef int (*virStoragePoolDefNamespaceXMLFormat)(virBufferPtr, void *); -typedef const char *(*virStoragePoolDefNamespaceHref)(void); - -typedef struct _virStoragePoolXMLNamespace virStoragePoolXMLNamespace; -typedef virStoragePoolXMLNamespace *virStoragePoolXMLNamespacePtr; -struct _virStoragePoolXMLNamespace { - virStoragePoolDefNamespaceParse parse; - virStoragePoolDefNamespaceFree free; - virStoragePoolDefNamespaceXMLFormat format; - virStoragePoolDefNamespaceHref href; -}; =20 int virStoragePoolOptionsPoolTypeSetXMLNamespace(int type, - virStoragePoolXMLNamespacePtr= ns); + virXMLNamespacePtr ns); =20 int virStoragePoolOptionsFormatPool(virBufferPtr buf, @@ -277,7 +262,7 @@ struct _virStoragePoolDef { =20 /* Pool backend specific XML namespace data */ void *namespaceData; - virStoragePoolXMLNamespace ns; + virXMLNamespace ns; }; =20 typedef struct _virStoragePoolSourceList virStoragePoolSourceList; diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend= _fs.c index ae4e9a03a3..d575b75449 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -701,7 +701,7 @@ virStorageBackend virStorageBackendNetFileSystem =3D { .wipeVol =3D virStorageBackendVolWipeLocal, }; =20 -static virStoragePoolXMLNamespace virStoragePoolFSXMLNamespace =3D { +static virXMLNamespace virStoragePoolFSXMLNamespace =3D { .parse =3D virStoragePoolDefFSNamespaceParse, .free =3D virStoragePoolDefFSNamespaceFree, .format =3D virStoragePoolDefFSNamespaceFormatXML, diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backen= d_rbd.c index f3104ba310..e490c690f5 100644 --- a/src/storage/storage_backend_rbd.c +++ b/src/storage/storage_backend_rbd.c @@ -1542,7 +1542,7 @@ virStorageBackend virStorageBackendRBD =3D { }; =20 =20 -static virStoragePoolXMLNamespace virStoragePoolRBDXMLNamespace =3D { +static virXMLNamespace virStoragePoolRBDXMLNamespace =3D { .parse =3D virStoragePoolDefRBDNamespaceParse, .free =3D virStoragePoolDefRBDNamespaceFree, .format =3D virStoragePoolDefRBDNamespaceFormatXML, diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index 62f857f9ea..3dc5ad2969 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -92,7 +92,7 @@ VIR_LOG_INIT("storage.storage_util"); */ int virStorageBackendNamespaceInit(int poolType, - virStoragePoolXMLNamespacePtr xmlns) + virXMLNamespacePtr xmlns) { return virStoragePoolOptionsPoolTypeSetXMLNamespace(poolType, xmlns); } diff --git a/src/storage/storage_util.h b/src/storage/storage_util.h index 6df5928d9b..705e23631d 100644 --- a/src/storage/storage_util.h +++ b/src/storage/storage_util.h @@ -36,7 +36,7 @@ struct _virStoragePoolFSMountOptionsDef { =20 int virStorageBackendNamespaceInit(int poolType, - virStoragePoolXMLNamespacePtr xmlns); + virXMLNamespacePtr xmlns); =20 =20 /* File creation/cloning functions used for cloning between backends */ --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 09:50:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1566342982; cv=none; d=zoho.com; s=zohoarc; b=GyBuHVgdvO5xJ+1Cs3/dDlExEjE16av0bkOp7IPvoQKqj/OUOkgZsBYTM5s7xqe/Gng+n8aki6tq3zUGnw+ydHq50OJxtdckRyt2yiNTUatB4XP0ILbNUaLMapX1DB3lmVfJAbVozurV8Cj1QTskRROh5WruAaGAaOUzFm/OkVo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566342982; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=XW8AklJOvSwj/QUqcuhMYNtaT5ilG49zQVnpXVzGqks=; b=gdzYNA2k9pw1oYRgSUzE1vEpDwcXWoHuTllLfrf+JIP1wYRiLmoYZ8QZWVUE3dkG0+VmuFm9yLX/+xg0xYzCqK/bHNjly7BsNRi59qM3N4VvZsNRcv7ZHgMauLXqlH7rFsnrIXHC4jUHlo9crjyaHI6jz0BTqGzTLKnhI4amNzA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566342982218718.1139618757899; Tue, 20 Aug 2019 16:16:22 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 87294881343; Tue, 20 Aug 2019 23:16:20 +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 58A1A1877F; Tue, 20 Aug 2019 23:16:20 +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 1C6FA244FB; Tue, 20 Aug 2019 23:16:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7KNFtOC013609 for ; Tue, 20 Aug 2019 19:15:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 61AB260605; Tue, 20 Aug 2019 23:15:55 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id DF9C42C8DC for ; Tue, 20 Aug 2019 23:15:54 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 21 Aug 2019 01:15:30 +0200 Message-Id: <01b25774abe16594de1db53246fd227304ea14e0.1566342869.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 08/21] conf: domain: use generic XML namespace types 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.69]); Tue, 20 Aug 2019 23:16:21 +0000 (UTC) Now that virDomainXMLNamespace matches virXMLNamespace, we no longer need to keep both around. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Jiri Denemark --- src/bhyve/bhyve_domain.c | 2 +- src/bhyve/bhyve_domain.h | 2 +- src/conf/capabilities.h | 12 ------------ src/conf/domain_conf.c | 6 +++--- src/conf/domain_conf.h | 6 +++--- src/conf/virconftypes.h | 3 --- src/lxc/lxc_domain.c | 2 +- src/lxc/lxc_domain.h | 2 +- src/qemu/qemu_domain.c | 2 +- src/qemu/qemu_domain.h | 2 +- src/test/test_driver.c | 2 +- src/vmx/vmx.c | 2 +- 12 files changed, 14 insertions(+), 29 deletions(-) diff --git a/src/bhyve/bhyve_domain.c b/src/bhyve/bhyve_domain.c index 51366f8e26..4924766030 100644 --- a/src/bhyve/bhyve_domain.c +++ b/src/bhyve/bhyve_domain.c @@ -273,7 +273,7 @@ bhyveDomainDefNamespaceHref(void) return "xmlns:bhyve=3D'" BHYVE_NAMESPACE_HREF "'"; } =20 -virDomainXMLNamespace virBhyveDriverDomainXMLNamespace =3D { +virXMLNamespace virBhyveDriverDomainXMLNamespace =3D { .parse =3D bhyveDomainDefNamespaceParse, .free =3D bhyveDomainDefNamespaceFree, .format =3D bhyveDomainDefNamespaceFormatXML, diff --git a/src/bhyve/bhyve_domain.h b/src/bhyve/bhyve_domain.h index 17cb283e54..e985278041 100644 --- a/src/bhyve/bhyve_domain.h +++ b/src/bhyve/bhyve_domain.h @@ -38,6 +38,6 @@ virDomainXMLOptionPtr virBhyveDriverCreateXMLConf(bhyveCo= nnPtr); =20 extern virDomainXMLPrivateDataCallbacks virBhyveDriverPrivateDataCallbacks; extern virDomainDefParserConfig virBhyveDriverDomainDefParserConfig; -extern virDomainXMLNamespace virBhyveDriverDomainXMLNamespace; +extern virXMLNamespace virBhyveDriverDomainXMLNamespace; =20 bool bhyveDomainDefNeedsISAController(virDomainDefPtr def); diff --git a/src/conf/capabilities.h b/src/conf/capabilities.h index 41c81ceeb1..d6a4e79d77 100644 --- a/src/conf/capabilities.h +++ b/src/conf/capabilities.h @@ -182,18 +182,6 @@ struct _virCapsStoragePool { }; =20 =20 -typedef int (*virDomainDefNamespaceParse)(xmlXPathContextPtr, void **); -typedef void (*virDomainDefNamespaceFree)(void *); -typedef int (*virDomainDefNamespaceXMLFormat)(virBufferPtr, void *); -typedef const char *(*virDomainDefNamespaceHref)(void); - -struct _virDomainXMLNamespace { - virDomainDefNamespaceParse parse; - virDomainDefNamespaceFree free; - virDomainDefNamespaceXMLFormat format; - virDomainDefNamespaceHref href; -}; - struct _virCaps { virObject parent; =20 diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index c8c304d2a2..3a1f7c9709 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -79,7 +79,7 @@ struct _virDomainXMLOption { virDomainXMLPrivateDataCallbacks privateData; =20 /* XML namespace callbacks */ - virDomainXMLNamespace ns; + virXMLNamespace ns; =20 /* ABI stability callbacks */ virDomainABIStability abi; @@ -1385,7 +1385,7 @@ virDomainKeyWrapDefParseXML(virDomainDefPtr def, xmlX= PathContextPtr ctxt) virDomainXMLOptionPtr virDomainXMLOptionNew(virDomainDefParserConfigPtr config, virDomainXMLPrivateDataCallbacksPtr priv, - virDomainXMLNamespacePtr xmlns, + virXMLNamespacePtr xmlns, virDomainABIStabilityPtr abi, virSaveCookieCallbacksPtr saveCookie) { @@ -1435,7 +1435,7 @@ virDomainXMLOptionNew(virDomainDefParserConfigPtr con= fig, * Returns a pointer to the stored namespace structure. * The lifetime of the pointer is equal to @xmlopt; */ -virDomainXMLNamespacePtr +virXMLNamespacePtr virDomainXMLOptionGetNamespace(virDomainXMLOptionPtr xmlopt) { return &xmlopt->ns; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index cbe7b61170..33cef5b75c 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2491,7 +2491,7 @@ struct _virDomainDef { virDomainVsockDefPtr vsock; =20 void *namespaceData; - virDomainXMLNamespace ns; + virXMLNamespace ns; =20 virDomainKeyWrapDefPtr keywrap; =20 @@ -2731,7 +2731,7 @@ struct _virDomainABIStability { =20 virDomainXMLOptionPtr virDomainXMLOptionNew(virDomainDefParserConfigPtr co= nfig, virDomainXMLPrivateDataCallbac= ksPtr priv, - virDomainXMLNamespacePtr xmlns, + virXMLNamespacePtr xmlns, virDomainABIStabilityPtr abi, virSaveCookieCallbacksPtr save= Cookie); =20 @@ -2747,7 +2747,7 @@ int virDomainXMLOptionRunMomentPostParse(virDomainXML= OptionPtr xmlopt, =20 void virDomainNetGenerateMAC(virDomainXMLOptionPtr xmlopt, virMacAddrPtr m= ac); =20 -virDomainXMLNamespacePtr +virXMLNamespacePtr virDomainXMLOptionGetNamespace(virDomainXMLOptionPtr xmlopt) ATTRIBUTE_NONNULL(1); =20 diff --git a/src/conf/virconftypes.h b/src/conf/virconftypes.h index e8e9b6c314..a15cfb5f9e 100644 --- a/src/conf/virconftypes.h +++ b/src/conf/virconftypes.h @@ -342,9 +342,6 @@ typedef virDomainVsockDef *virDomainVsockDefPtr; typedef struct _virDomainWatchdogDef virDomainWatchdogDef; typedef virDomainWatchdogDef *virDomainWatchdogDefPtr; =20 -typedef struct _virDomainXMLNamespace virDomainXMLNamespace; -typedef virDomainXMLNamespace *virDomainXMLNamespacePtr; - typedef struct _virDomainXMLOption virDomainXMLOption; typedef virDomainXMLOption *virDomainXMLOptionPtr; =20 diff --git a/src/lxc/lxc_domain.c b/src/lxc/lxc_domain.c index 87f3c7bd63..df847b4fca 100644 --- a/src/lxc/lxc_domain.c +++ b/src/lxc/lxc_domain.c @@ -317,7 +317,7 @@ lxcDomainDefNamespaceHref(void) } =20 =20 -virDomainXMLNamespace virLXCDriverDomainXMLNamespace =3D { +virXMLNamespace virLXCDriverDomainXMLNamespace =3D { .parse =3D lxcDomainDefNamespaceParse, .free =3D lxcDomainDefNamespaceFree, .format =3D lxcDomainDefNamespaceFormatXML, diff --git a/src/lxc/lxc_domain.h b/src/lxc/lxc_domain.h index 92ed4ac594..9cb7090b5b 100644 --- a/src/lxc/lxc_domain.h +++ b/src/lxc/lxc_domain.h @@ -91,7 +91,7 @@ struct _virLXCDomainObjPrivate { struct virLXCDomainJobObj job; }; =20 -extern virDomainXMLNamespace virLXCDriverDomainXMLNamespace; +extern virXMLNamespace virLXCDriverDomainXMLNamespace; extern virDomainXMLPrivateDataCallbacks virLXCDriverPrivateDataCallbacks; extern virDomainDefParserConfig virLXCDriverDomainDefParserConfig; =20 diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 880307f215..f92b483bcf 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3728,7 +3728,7 @@ qemuDomainDefNamespaceHref(void) } =20 =20 -virDomainXMLNamespace virQEMUDriverDomainXMLNamespace =3D { +virXMLNamespace virQEMUDriverDomainXMLNamespace =3D { .parse =3D qemuDomainDefNamespaceParse, .free =3D qemuDomainDefNamespaceFree, .format =3D qemuDomainDefNamespaceFormatXML, diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 2ba51929db..37a00323a7 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -854,7 +854,7 @@ void qemuDomainCleanupRun(virQEMUDriverPtr driver, void qemuDomainObjPrivateDataClear(qemuDomainObjPrivatePtr priv); =20 extern virDomainXMLPrivateDataCallbacks virQEMUDriverPrivateDataCallbacks; -extern virDomainXMLNamespace virQEMUDriverDomainXMLNamespace; +extern virXMLNamespace virQEMUDriverDomainXMLNamespace; extern virDomainDefParserConfig virQEMUDriverDomainDefParserConfig; extern virDomainABIStability virQEMUDriverDomainABIStability; extern virSaveCookieCallbacks virQEMUDriverDomainSaveCookie; diff --git a/src/test/test_driver.c b/src/test/test_driver.c index a59984051d..6dbd76d449 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -426,7 +426,7 @@ testDomainObjPrivateFree(void *data) static testDriverPtr testDriverNew(void) { - virDomainXMLNamespace ns =3D { + virXMLNamespace ns =3D { .parse =3D testDomainDefNamespaceParse, .free =3D testDomainDefNamespaceFree, }; diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 7bb5eb956d..0f7c2d5f20 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -603,7 +603,7 @@ virVMXDomainDefNamespaceHref(void) return "xmlns:vmware=3D'http://libvirt.org/schemas/domain/vmware/1.0'"; } =20 -static virDomainXMLNamespace virVMXDomainXMLNamespace =3D { +static virXMLNamespace virVMXDomainXMLNamespace =3D { .parse =3D NULL, .free =3D virVMXDomainDefNamespaceFree, .format =3D virVMXDomainDefNamespaceFormatXML, --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 09:50:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1566342969; cv=none; d=zoho.com; s=zohoarc; b=fX+srnC0NH2adjQdFIESVQI04K7wi081UNpxJ5hze+fdioN/6awSJDlusfsWO9ZUvrSW3JgDmNJXbUwyJoe7LDyZ+Fn9JXM6FZLXHBCwg4xHD0ijv5Qkf/F3NwYOvOTfumdFCoTDrlC/Rrf8oiH7XHu7++kNRZQ8LwnDdqchOSc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566342969; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=2u6/LKAuNROQgaX4gXVcbLewAMop7cfPL4J7Jdup2Mw=; b=ntCstKhIAKC0ymA8RXSTP77vz2dNkRqRJAvvf5GzZ3gK6X2rCRTxVayYuyYc4qypFIkCEPgoveydni3XOl454HJ6o9LokLVMYD4beFDXYkWf9Y5OjHTjKDhOMkB2TjrKr0mDL+5rlLNu4uRP1pjxID6ignBfVN6fsw0WtdqT8ec= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566342969007159.7842392355991; Tue, 20 Aug 2019 16:16:09 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id D4371195D84F; Tue, 20 Aug 2019 23:16:07 +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 AB7C9100195C; Tue, 20 Aug 2019 23:16: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 70896180BA9F; Tue, 20 Aug 2019 23:16:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7KNFuKY013619 for ; Tue, 20 Aug 2019 19:15:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3005C2C8DC; Tue, 20 Aug 2019 23:15:56 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id AE54360605 for ; Tue, 20 Aug 2019 23:15:55 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 21 Aug 2019 01:15:31 +0200 Message-Id: <87f4b177cd6d92843302ad5842ecf5c8fc584168.1566342869.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 09/21] xml: virXMLNamespace: add prefix 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.62]); Tue, 20 Aug 2019 23:16:08 +0000 (UTC) We have hardcoded the namespace prefix in various places: 1) the xmlns string stored in the 'href' function 2) the xmlXPathRegisterNs call in each parser 3) all the parsing and formatting code actually dealing with these elements While eliminating the third one is probably a job for an actual XML-aware formatter, let's store the prefix separately here in the virXMLNamespace structure so that future patches can get rid of the first two bullets. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Jiri Denemark --- src/util/virxml.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util/virxml.h b/src/util/virxml.h index 5b209bb040..ea0c3d3ab3 100644 --- a/src/util/virxml.h +++ b/src/util/virxml.h @@ -256,6 +256,7 @@ struct _virXMLNamespace { virXMLNamespaceParse parse; virXMLNamespaceFree free; virXMLNamespaceFormat format; + const char *prefix; virXMLNamespaceHref href; }; typedef struct _virXMLNamespace virXMLNamespace; --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 09:50:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1566342959; cv=none; d=zoho.com; s=zohoarc; b=OzY1hSy2pkKa3Q2JfTTJqygl5opIepoCmPABnDCNhuFyqVPTcxO97tZLaa7uEJdWNNesJt0eK+vVpnhvKWcxGxu5YlYrxYmMi5aOkBHY4e9S3JofwMfkCEZLLCrHSIDosOAaB9PT+ZxS1VzASvN6E5FWsw4PvH8sO30UqyV3kEE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566342959; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=3PehJ9KscfxCc55oNDVtr9uG2NLIJqKpCHSFH4Pi7gI=; b=fAyf4LcNOuDDccorJmoEZ/9NY9tND8ux8J5Im+h9ygVpcIAYNPT/aRZ2NHcsmZKRALkPTLyQSkVE/XPbPp2YwKPtAWBMnejO5JwCBQnX0L1/4N/oDlO4J/vHiveej5ErQq/TaY7MTaqW5BtbfmMJp3NMMdl62YyGw+ResWrHzcw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566342959187374.50236751063244; Tue, 20 Aug 2019 16:15:59 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CCC763086213; Tue, 20 Aug 2019 23:15:57 +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 AC1321D2; Tue, 20 Aug 2019 23:15:57 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 70A4418005C7; Tue, 20 Aug 2019 23:15:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7KNFvVB013631 for ; Tue, 20 Aug 2019 19:15:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0000A60605; Tue, 20 Aug 2019 23:15:57 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7CE982C8DC for ; Tue, 20 Aug 2019 23:15:56 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 21 Aug 2019 01:15:32 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 10/21] conf: network: store namespace prefix 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Tue, 20 Aug 2019 23:15:58 +0000 (UTC) Signed-off-by: J=C3=A1n Tomko Reviewed-by: Jiri Denemark --- src/network/bridge_driver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index b34b742bfa..b0ada0132a 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -252,6 +252,7 @@ virXMLNamespace networkDnsmasqXMLNamespace =3D { .parse =3D networkDnsmasqDefNamespaceParse, .free =3D networkDnsmasqDefNamespaceFree, .format =3D networkDnsmasqDefNamespaceFormatXML, + .prefix =3D "dnsmasq", .href =3D networkDnsmasqDefNamespaceHref, }; =20 --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 09:50:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1566342985; cv=none; d=zoho.com; s=zohoarc; b=e7vu7oP3L77sggonTJMC3QoHgrEZwwUXxiwHBYma4Z1af3Gn4X73Ttf5LTPY3viauJGGCQcbs4lAX1yNJen70wH1KvwlmXaSQWsZ08v3RICi0zQnoWekP7/fP91MUrTYQJowyxd8DOptbAsakAQt9Nz7w8Mt78WiK02VN4UzzCY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566342985; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=ax6K10EmDW4Hz+lPX4IZY1L8pZ9sm8vxdokpUSksmko=; b=H7QSubefqhG1XrgE7mqlzkBBqX5Lx4A/PZ2byhTCtjseEWVKnDt9+2Oh+oTw4LGamL3HWF84UH5A+qZ4NarbSgkwlJi1yQv41dCzLFTTc/4dwdeoXCCbR5SxFnv4wsvgo7qK9Xf99DaSWv0GICLfw+obW1cuGTx24Ju1+++96HU= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566342985363276.06498629648763; Tue, 20 Aug 2019 16:16:25 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4869B307D853; Tue, 20 Aug 2019 23:16: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 215B852FF; Tue, 20 Aug 2019 23:16: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 C0CFE206CF; Tue, 20 Aug 2019 23:16:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7KNFv0F013636 for ; Tue, 20 Aug 2019 19:15:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id C38FF2C8DC; Tue, 20 Aug 2019 23:15:57 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4D09960605 for ; Tue, 20 Aug 2019 23:15:57 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 21 Aug 2019 01:15:33 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 11/21] conf: domain: store namespace prefix 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Tue, 20 Aug 2019 23:16:24 +0000 (UTC) Signed-off-by: J=C3=A1n Tomko Reviewed-by: Jiri Denemark --- src/bhyve/bhyve_domain.c | 1 + src/lxc/lxc_domain.c | 1 + src/qemu/qemu_domain.c | 1 + src/test/test_driver.c | 1 + src/vmx/vmx.c | 1 + 5 files changed, 5 insertions(+) diff --git a/src/bhyve/bhyve_domain.c b/src/bhyve/bhyve_domain.c index 4924766030..9a21cde452 100644 --- a/src/bhyve/bhyve_domain.c +++ b/src/bhyve/bhyve_domain.c @@ -277,5 +277,6 @@ virXMLNamespace virBhyveDriverDomainXMLNamespace =3D { .parse =3D bhyveDomainDefNamespaceParse, .free =3D bhyveDomainDefNamespaceFree, .format =3D bhyveDomainDefNamespaceFormatXML, + .prefix =3D "bhyve", .href =3D bhyveDomainDefNamespaceHref, }; diff --git a/src/lxc/lxc_domain.c b/src/lxc/lxc_domain.c index df847b4fca..b61c172804 100644 --- a/src/lxc/lxc_domain.c +++ b/src/lxc/lxc_domain.c @@ -321,6 +321,7 @@ virXMLNamespace virLXCDriverDomainXMLNamespace =3D { .parse =3D lxcDomainDefNamespaceParse, .free =3D lxcDomainDefNamespaceFree, .format =3D lxcDomainDefNamespaceFormatXML, + .prefix =3D "lxc", .href =3D lxcDomainDefNamespaceHref, }; =20 diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index f92b483bcf..bd124b824c 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3732,6 +3732,7 @@ virXMLNamespace virQEMUDriverDomainXMLNamespace =3D { .parse =3D qemuDomainDefNamespaceParse, .free =3D qemuDomainDefNamespaceFree, .format =3D qemuDomainDefNamespaceFormatXML, + .prefix =3D "qemu", .href =3D qemuDomainDefNamespaceHref, }; =20 diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 6dbd76d449..adda3ac4c0 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -429,6 +429,7 @@ testDriverNew(void) virXMLNamespace ns =3D { .parse =3D testDomainDefNamespaceParse, .free =3D testDomainDefNamespaceFree, + .prefix =3D "test", }; virDomainDefParserConfig config =3D { .features =3D VIR_DOMAIN_DEF_FEATURE_MEMORY_HOTPLUG | diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 0f7c2d5f20..ac24e765d4 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -607,6 +607,7 @@ static virXMLNamespace virVMXDomainXMLNamespace =3D { .parse =3D NULL, .free =3D virVMXDomainDefNamespaceFree, .format =3D virVMXDomainDefNamespaceFormatXML, + .prefix =3D "vmware", .href =3D virVMXDomainDefNamespaceHref, }; =20 --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 09:50:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1566342965; cv=none; d=zoho.com; s=zohoarc; b=VyntiRmazEf5/k6aGvAFB4JfIBVDSj7oLZU8OEE0IYTu+ppaj+NEUsHOg+ulXbmPl/6AE2uGA+rZ2m2oW8BYXb0ZHGJKb898AWfIBf6Jgw8rZQxiYBGuD5GF0rQRSld5qa/LkJDqtjanBU1QLkxeBL7U2VqbH7nyQFyGhIhJGwA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566342965; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=noqUsLQ/ATy8chu+lfky34iTy/PlZUYIVOeYXDE5bWs=; b=EV7fB0cAShiIWYWMbeS8pL1qwk+BmrPhbnf28OZMMdwcTmCYifA9MCzrLczLn28Y/5bXdyUhMnhPGWck4RG6HkrpnEIvNTl4iulNmaxYpgMcmH6J/rKT/DF7TmO3dQerXjccWfW8z1sRqoQhpxd/Fxp6F8iSJrGyEGoRlZi8E2M= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566342965199557.1543354403724; Tue, 20 Aug 2019 16:16:05 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9EF592F366C; Tue, 20 Aug 2019 23:16:03 +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 71B7C5D9DC; Tue, 20 Aug 2019 23:16:03 +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 36B00180BA98; Tue, 20 Aug 2019 23:16:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7KNFw9N013647 for ; Tue, 20 Aug 2019 19:15:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9188760605; Tue, 20 Aug 2019 23:15:58 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1B9D52C8DC for ; Tue, 20 Aug 2019 23:15:57 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 21 Aug 2019 01:15:34 +0200 Message-Id: <472c4b9ca4e96a5fdfa3fa0cfe00173e24268f31.1566342869.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 12/21] conf: storage: store namespace prefix 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 20 Aug 2019 23:16:04 +0000 (UTC) Signed-off-by: J=C3=A1n Tomko Reviewed-by: Jiri Denemark --- src/storage/storage_backend_fs.c | 1 + src/storage/storage_backend_rbd.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend= _fs.c index d575b75449..c2d0d7bd1f 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -705,6 +705,7 @@ static virXMLNamespace virStoragePoolFSXMLNamespace =3D= { .parse =3D virStoragePoolDefFSNamespaceParse, .free =3D virStoragePoolDefFSNamespaceFree, .format =3D virStoragePoolDefFSNamespaceFormatXML, + .prefix =3D "fs", .href =3D virStoragePoolDefFSNamespaceHref, }; #endif /* WITH_STORAGE_FS */ diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backen= d_rbd.c index e490c690f5..f86df9a2fa 100644 --- a/src/storage/storage_backend_rbd.c +++ b/src/storage/storage_backend_rbd.c @@ -1546,6 +1546,7 @@ static virXMLNamespace virStoragePoolRBDXMLNamespace = =3D { .parse =3D virStoragePoolDefRBDNamespaceParse, .free =3D virStoragePoolDefRBDNamespaceFree, .format =3D virStoragePoolDefRBDNamespaceFormatXML, + .prefix =3D "rbd", .href =3D virStoragePoolDefRBDNamespaceHref, }; =20 --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 09:50:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1566342972; cv=none; d=zoho.com; s=zohoarc; b=gShUkcIyT9ytQQvzbF/HT7Pay+4N33AdXbYm4on2T2+ndCTmK6aEeykkQX0GD4H+ETJjwMfhU5//fG6W+5Hbg+FuWF9g0JR2CqMRdvif6gdP9mEFxeK3ZOjkwoYzgc1yivFCX1gyJjHJMIPNRe2z/s8ienHjtKgm3YjlU/IqTgc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566342972; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=MkHIzqnW2IWbRZhMuGB86WspdVqaWHIpiydIoomMcgc=; b=aEGCt4fdZAhCjOxFvEhlN+ngkyt0sdwFLmwLcOsQ77WjF00OgIxOqeuyNrLC2Oo14ZVRtlHiHPPx7Zcy+QD3loQa0a/z0KbygrLwh/x/2GDZSLqYwASjxp4QOO+O1OSv8EN3XZTko46kVprEt5HzaIQj/ZRJN5tYuEn6VsRnt0Q= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566342972412898.8784496931113; Tue, 20 Aug 2019 16:16:12 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 3A3CA2F366E; Tue, 20 Aug 2019 23:16:11 +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 191E418387; Tue, 20 Aug 2019 23:16:11 +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 CEE5424F37; Tue, 20 Aug 2019 23:16:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7KNFx3L013659 for ; Tue, 20 Aug 2019 19:15:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id 60A3B2C8DC; Tue, 20 Aug 2019 23:15:59 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id DDF5860605 for ; Tue, 20 Aug 2019 23:15:58 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 21 Aug 2019 01:15:35 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 13/21] conf: test: store namespace href 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 20 Aug 2019 23:16:11 +0000 (UTC) Unlike all the other occurrences, only store the actual URL instead of the whole xmlns:=3D'' header. The rest will be converted before this string is used. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Jiri Denemark --- src/test/test_driver.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index adda3ac4c0..3bdeb6c00a 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -181,6 +181,12 @@ struct _testDomainNamespaceDef { xmlNodePtr *snap_nodes; }; =20 +static const char* +testDomainDefNamespaceHref(void) +{ + return TEST_NAMESPACE_HREF; +} + static void testDomainDefNamespaceFree(void *data) { @@ -430,6 +436,7 @@ testDriverNew(void) .parse =3D testDomainDefNamespaceParse, .free =3D testDomainDefNamespaceFree, .prefix =3D "test", + .href =3D testDomainDefNamespaceHref, }; virDomainDefParserConfig config =3D { .features =3D VIR_DOMAIN_DEF_FEATURE_MEMORY_HOTPLUG | --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 09:50:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1566342988; cv=none; d=zoho.com; s=zohoarc; b=FW3pYqLkRsPMX1ddc3TMe3VxHaC9QV7DMTIMSMclBlKXmOsWtg+MiKEAZMAZkqG97ftobnTuNl/v1KljfZkw/1IkCa0EKHpN2uWIXrI3hV80paeo5YFjYzCjrT83Lo0Mnt5uRazD9I3KFIMlXRsRBNrNckoIYcPZmcjAKnQxvZY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566342988; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=Pp1KtEt7t9fLUOmcuxVY+BTG4FxiZfJ+hmZ5XpIGegc=; b=YGq4KFAvBtuUNvGRdlDSIhz7jMyja6ery8ytmtxQqbwxG1wnsHp/G4NiZlZQ/DTa+ZVO7CDwPKXb3xN4puH1J/BUhCHslC6UpsoQlO7HKhUw8Ac5dXW9sMFAv8QOf5FRKz0EnxLfxi1MYOvaZk5uxeDMFSEuYpq84SfpzXCPtqo= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 156634298873297.21654647209607; Tue, 20 Aug 2019 16:16:28 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id A635410C051D; Tue, 20 Aug 2019 23:16:27 +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 7A4FE1B5B0; Tue, 20 Aug 2019 23:16:27 +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 3DF431804762; Tue, 20 Aug 2019 23:16:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7KNG0mw013670 for ; Tue, 20 Aug 2019 19:16:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2E92460605; Tue, 20 Aug 2019 23:16:00 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id AC91D2C8DC for ; Tue, 20 Aug 2019 23:15:59 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 21 Aug 2019 01:15:36 +0200 Message-Id: <50dd77da23b5a5f553be688b640d46e8f9b21929.1566342869.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 14/21] util: introduce virXMLNamespaceFormatNS 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.65]); Tue, 20 Aug 2019 23:16:28 +0000 (UTC) A function to automatically format the xmlns:=3D'' attribute for per-driver namespaces. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Jiri Denemark --- src/util/virxml.c | 7 +++++++ src/util/virxml.h | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/src/util/virxml.c b/src/util/virxml.c index f55b9a362c..11b6031b09 100644 --- a/src/util/virxml.c +++ b/src/util/virxml.c @@ -1408,3 +1408,10 @@ virXPathContextNodeRestore(virXPathContextNodeSavePt= r save) =20 save->ctxt->node =3D save->node; } + +void +virXMLNamespaceFormatNS(virBufferPtr buf, + virXMLNamespace const *ns) +{ + virBufferAsprintf(buf, " xmlns:%s=3D'%s'", ns->prefix, ns->href()); +} diff --git a/src/util/virxml.h b/src/util/virxml.h index ea0c3d3ab3..bcc10647b5 100644 --- a/src/util/virxml.h +++ b/src/util/virxml.h @@ -261,3 +261,7 @@ struct _virXMLNamespace { }; typedef struct _virXMLNamespace virXMLNamespace; typedef virXMLNamespace *virXMLNamespacePtr; + +void +virXMLNamespaceFormatNS(virBufferPtr buf, + virXMLNamespace const *ns); --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 09:50:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1566342975; cv=none; d=zoho.com; s=zohoarc; b=NBuReM9owEyk+b742RyIt/kfF2Pk7NB0H/CDhPNUzZw+Cf1lmeCExnQyL5LGa5taztnQ5Lkknr0v/50n4ARk9aGpHuKC757wKQrwpPSR1RtRLtXSzV+vfMOAU+z9DTgISvb1Tl5JSDTfvdG8ZZZKqBo89sZwufQeiJNNAxyKwl0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566342975; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=e7cG8LpqxeTuBpjfbJQgFRv9UfXMQUggBorRy/mvtdg=; b=FiCGqxsFAiFawTx9dIoYPVzMLRofTZaWaTBmN8Z2Gb+oSibxz/XlQvHuUUbHkFUlR9/857e9oNZ2sdo1IkilbtfU11aFkrKvH+mFvND5HtlprnXSKRzNM0HMWR9OiiGMNeLhyVvQmqzS1lTjq2VFH7RTk0JeiiR/X52tw5bxh2k= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566342975881655.6333685453442; Tue, 20 Aug 2019 16:16:15 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id AA926309B686; Tue, 20 Aug 2019 23:16:14 +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 841EA5C21F; Tue, 20 Aug 2019 23:16:14 +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 415CB180BAA8; Tue, 20 Aug 2019 23:16:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7KNG1vh013677 for ; Tue, 20 Aug 2019 19:16:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 01CAF2C8DC; Tue, 20 Aug 2019 23:16:01 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7B4B060605 for ; Tue, 20 Aug 2019 23:16:00 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 21 Aug 2019 01:15:37 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 15/21] conf: network: use virXMLNamespaceFormatNS 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Tue, 20 Aug 2019 23:16:15 +0000 (UTC) Signed-off-by: J=C3=A1n Tomko Reviewed-by: Jiri Denemark --- src/conf/network_conf.c | 2 +- src/network/bridge_driver.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index 2c3a11fb10..7eba9eacbf 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -2435,7 +2435,7 @@ virNetworkDefFormatBuf(virBufferPtr buf, =20 virBufferAddLit(buf, "namespaceData && def->ns.href) - virBufferAsprintf(buf, " %s", (def->ns.href)()); + virXMLNamespaceFormatNS(buf, &def->ns); if (!(flags & VIR_NETWORK_XML_INACTIVE) && (def->connections > 0)) virBufferAsprintf(buf, " connections=3D'%d'", def->connections); if (def->ipv6nogw) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index b0ada0132a..a3f7ae337a 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -244,7 +244,7 @@ networkDnsmasqDefNamespaceFormatXML(virBufferPtr buf, static const char * networkDnsmasqDefNamespaceHref(void) { - return "xmlns:dnsmasq=3D'" DNSMASQ_NAMESPACE_HREF "'"; + return DNSMASQ_NAMESPACE_HREF; } =20 =20 --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 09:50:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1566342968; cv=none; d=zoho.com; s=zohoarc; b=mcDWVdZePem6UNWkR+eEbTVHbcld4P8daP9m7dUeZcSUw3qhRCv5Jum2UpkmFJY9JDd2wHOa61ewQKFPPKFfghKVzmv0AoA0Jcd65cZkqszIJo8c1rNEownYjNaD+Uq5gXxXtEkMm3C47/ZjeBjdEUfXZjXlLkQZF69ilY93g5A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566342968; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=JXw5UyQnicjfy5ZEZHEaBaMGHflwgMm8MxDIOqwhU8E=; b=iZ5iU5PIktGfeqzZOQJocOpuAv7qe6idIh31GfCjQ5qogkT4DIZHYCU3+5EKdcwSxHfjkNJ/l/FtrTss62ubE/IPugCykWjN7Jls+xXl1CN+f0SKu33bhcy7wFeqwmLI4pq4BvYlez+ZR9LA92rycZw9+DiBaZ3WwP2q859DF9M= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566342968268138.0334161501902; Tue, 20 Aug 2019 16:16:08 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 33F4730821EC; Tue, 20 Aug 2019 23:16:07 +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 088D267625; Tue, 20 Aug 2019 23:16: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 C51DB24F68; Tue, 20 Aug 2019 23:16:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7KNG1Rw013682 for ; Tue, 20 Aug 2019 19:16:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id C6DBE60605; Tue, 20 Aug 2019 23:16:01 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4F2E12C8E4 for ; Tue, 20 Aug 2019 23:16:01 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 21 Aug 2019 01:15:38 +0200 Message-Id: <2db04ebf5174a2a3f84448ade9f82bf9901f6072.1566342869.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 16/21] conf: storage: use virXMLNamespaceFormatNS 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Tue, 20 Aug 2019 23:16:07 +0000 (UTC) Signed-off-by: J=C3=A1n Tomko Reviewed-by: Jiri Denemark --- src/conf/storage_conf.c | 2 +- src/storage/storage_backend_fs.c | 2 +- src/storage/storage_backend_rbd.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index fb8a16a119..6588d5c8ef 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -1172,7 +1172,7 @@ virStoragePoolDefFormatBuf(virBufferPtr buf, } virBufferAsprintf(buf, "namespaceData && def->ns.href) - virBufferAsprintf(buf, " %s", (def->ns.href)()); + virXMLNamespaceFormatNS(buf, &def->ns); virBufferAddLit(buf, ">\n"); virBufferAdjustIndent(buf, 2); virBufferEscapeString(buf, "%s\n", def->name); diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend= _fs.c index c2d0d7bd1f..4bed6df0bb 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -636,7 +636,7 @@ virStoragePoolDefFSNamespaceFormatXML(virBufferPtr buf, static const char * virStoragePoolDefFSNamespaceHref(void) { - return "xmlns:fs=3D'" STORAGE_POOL_FS_NAMESPACE_HREF "'"; + return STORAGE_POOL_FS_NAMESPACE_HREF; } =20 #endif /* WITH_STORAGE_FS */ diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backen= d_rbd.c index f86df9a2fa..2d6c51de35 100644 --- a/src/storage/storage_backend_rbd.c +++ b/src/storage/storage_backend_rbd.c @@ -178,7 +178,7 @@ virStoragePoolDefRBDNamespaceFormatXML(virBufferPtr buf, static const char * virStoragePoolDefRBDNamespaceHref(void) { - return "xmlns:rbd=3D'" STORAGE_POOL_RBD_NAMESPACE_HREF "'"; + return STORAGE_POOL_RBD_NAMESPACE_HREF; } =20 =20 --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 09:50:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1566342981; cv=none; d=zoho.com; s=zohoarc; b=GJm2vfVsx1+kb0gcimRlOCZAD9k11FPWp2bzGn3EzSN7dS0xMhEOTE/D4OsB3yFizPfcBYmqyaEFMHzLdu6XpOwhYO69CyF4FWbqx1hXQrKrAi7WwrZ4HH+OxZYJzNgx4Kh8YN/kC0Ag4xE98VF14YG1sU/D50cUDP55FMngX5A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566342981; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=rwNjYLUK5Avsblwc0nmCzDWmiuqM/sFCCZAlJladp1k=; b=mme7sNOemZCLQPCwen0o2K7wesRPkZ+U773aCdUEfP+Sqns7tKiT+83C2QJSLWpadsJ2Ug02q53G5Y2Bx1FyO/5VtpxqXsW87QmW9+PyOb8x7uqvgggxxzb0Vb8/avLFWNbQNqhTyNqXbZ6W5Y2bLte8ejWucMRLQI7pw1ybbxE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 156634298117897.84940799722301; Tue, 20 Aug 2019 16:16:21 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 02BE23090FC4; Tue, 20 Aug 2019 23:16:20 +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 D269B5C221; Tue, 20 Aug 2019 23:16:19 +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 915DA246A3; Tue, 20 Aug 2019 23:16:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7KNG2rY013687 for ; Tue, 20 Aug 2019 19:16:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id 95D962C8E4; Tue, 20 Aug 2019 23:16:02 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1F1C160605 for ; Tue, 20 Aug 2019 23:16:01 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 21 Aug 2019 01:15:39 +0200 Message-Id: <074c5dd44213d97313e822800d74562a6ce08597.1566342869.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 17/21] conf: domain: use virXMLNamespaceFormatNS 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Tue, 20 Aug 2019 23:16:20 +0000 (UTC) Signed-off-by: J=C3=A1n Tomko Reviewed-by: Jiri Denemark --- src/bhyve/bhyve_domain.c | 2 +- src/conf/domain_conf.c | 2 +- src/lxc/lxc_domain.c | 2 +- src/qemu/qemu_domain.c | 2 +- src/vmx/vmx.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bhyve/bhyve_domain.c b/src/bhyve/bhyve_domain.c index 9a21cde452..631fb50db9 100644 --- a/src/bhyve/bhyve_domain.c +++ b/src/bhyve/bhyve_domain.c @@ -270,7 +270,7 @@ bhyveDomainDefNamespaceFormatXML(virBufferPtr buf, static const char * bhyveDomainDefNamespaceHref(void) { - return "xmlns:bhyve=3D'" BHYVE_NAMESPACE_HREF "'"; + return BHYVE_NAMESPACE_HREF; } =20 virXMLNamespace virBhyveDriverDomainXMLNamespace =3D { diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 3a1f7c9709..a39f5f845d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -28314,7 +28314,7 @@ virDomainDefFormatInternal(virDomainDefPtr def, if (!(flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE)) virBufferAsprintf(buf, " id=3D'%d'", def->id); if (def->namespaceData && def->ns.format) - virBufferAsprintf(buf, " %s", (def->ns.href)()); + virXMLNamespaceFormatNS(buf, &def->ns); virBufferAddLit(buf, ">\n"); virBufferAdjustIndent(buf, 2); =20 diff --git a/src/lxc/lxc_domain.c b/src/lxc/lxc_domain.c index b61c172804..022e3c6f6a 100644 --- a/src/lxc/lxc_domain.c +++ b/src/lxc/lxc_domain.c @@ -313,7 +313,7 @@ lxcDomainDefNamespaceFormatXML(virBufferPtr buf, static const char * lxcDomainDefNamespaceHref(void) { - return "xmlns:lxc=3D'" LXC_NAMESPACE_HREF "'"; + return LXC_NAMESPACE_HREF; } =20 =20 diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index bd124b824c..0b2065b52c 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3724,7 +3724,7 @@ qemuDomainDefNamespaceFormatXML(virBufferPtr buf, static const char * qemuDomainDefNamespaceHref(void) { - return "xmlns:qemu=3D'" QEMU_NAMESPACE_HREF "'"; + return QEMU_NAMESPACE_HREF; } =20 =20 diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index ac24e765d4..c4e90537f8 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -600,7 +600,7 @@ virVMXDomainDefNamespaceFormatXML(virBufferPtr buf, voi= d *nsdata) static const char * virVMXDomainDefNamespaceHref(void) { - return "xmlns:vmware=3D'http://libvirt.org/schemas/domain/vmware/1.0'"; + return "http://libvirt.org/schemas/domain/vmware/1.0"; } =20 static virXMLNamespace virVMXDomainXMLNamespace =3D { --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 09:50:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1566342984; cv=none; d=zoho.com; s=zohoarc; b=F9+v6cpAnfGVfeLoAOgFaNQmsDM5IGKC4pY/SvaW31VUH4+8lGV7PEozuj4JtTHDnDE6gI/N8buJOxsjvGKyIBouhCcP5UPwdgzqegb80MeYftqiQnts07Nxu3Bm11m1ctOLxCTixzcPJf5M2OFOPq6NHnpb7off76dKoIOJ2SQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566342984; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=0rs/GKValJYmvQ2otyxHnGcemEJgBAEDmXxprYJvQ44=; b=F1XPq+pQjVgf4iYw/NxJMG0nLE9T8KbZtzRgWFE2eCYwUZZlFPgm5dlO/SDfUWtB+lk1pG8vpDVuwcvtMl8sXgfuL1+sgkalEH66GsBLIJ1E6JaibgDPvR0YDB10j1aqLW8LDSSBh1UXhN9P9E3/awi1odB3D8+IlQ85/jal3CE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566342984248220.4638419364561; Tue, 20 Aug 2019 16:16:24 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1FF1D2F3666; Tue, 20 Aug 2019 23:16:23 +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 F19246D0A6; Tue, 20 Aug 2019 23:16:22 +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 BA9C31806B09; Tue, 20 Aug 2019 23:16:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7KNG3Ce013692 for ; Tue, 20 Aug 2019 19:16:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6501460605; Tue, 20 Aug 2019 23:16:03 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id E1E682C8E4 for ; Tue, 20 Aug 2019 23:16:02 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 21 Aug 2019 01:15:40 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 18/21] util: xml: introduce virXMLNamespaceRegister 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 20 Aug 2019 23:16:23 +0000 (UTC) A wrapper around xmlXPathRegisterNs that will save us from having to include xpathInternals.h everywhere we want to use a custom namespace and open-coding the strings already contained in virXMLNamespace. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Jiri Denemark --- src/util/virxml.c | 20 ++++++++++++++++++++ src/util/virxml.h | 3 +++ 2 files changed, 23 insertions(+) diff --git a/src/util/virxml.c b/src/util/virxml.c index 11b6031b09..84b824f432 100644 --- a/src/util/virxml.c +++ b/src/util/virxml.c @@ -24,6 +24,8 @@ #include /* for isnan() */ #include =20 +#include + #include "virerror.h" #include "virxml.h" #include "virbuffer.h" @@ -1409,9 +1411,27 @@ virXPathContextNodeRestore(virXPathContextNodeSavePt= r save) save->ctxt->node =3D save->node; } =20 + void virXMLNamespaceFormatNS(virBufferPtr buf, virXMLNamespace const *ns) { virBufferAsprintf(buf, " xmlns:%s=3D'%s'", ns->prefix, ns->href()); } + + +int +virXMLNamespaceRegister(xmlXPathContextPtr ctxt, + virXMLNamespace const *ns) +{ + if (xmlXPathRegisterNs(ctxt, + BAD_CAST ns->prefix, + BAD_CAST ns->href()) < 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Failed to register xml namespace '%s'"), + ns->href()); + return -1; + } + + return 0; +} diff --git a/src/util/virxml.h b/src/util/virxml.h index bcc10647b5..dfa20b3edb 100644 --- a/src/util/virxml.h +++ b/src/util/virxml.h @@ -265,3 +265,6 @@ typedef virXMLNamespace *virXMLNamespacePtr; void virXMLNamespaceFormatNS(virBufferPtr buf, virXMLNamespace const *ns); +int +virXMLNamespaceRegister(xmlXPathContextPtr ctxt, + virXMLNamespace const *ns); --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 09:50:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1566342988; cv=none; d=zoho.com; s=zohoarc; b=TXNM6Nble0C/CMYzElMs5YZ2KPGYNFS6qwgWe3qoWzIbU0DvevzI7Zhfz8pNlsKW0Rp8bQMx3WtLVk9P5dTjyIliPo7kkrNe+bTn9KiPrYT2pGMlCxmrKDpUt+yVg8nKfB9oW/d0aI7fL3aGSl86NYCpDEHVe42iWiDKcjOoIiU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566342988; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=s5l2A9lu90AxZro1+HQGMVBDZNySyCmkMRUBOOryME0=; b=N5xh/M8E6xFS0o2J2irpzL6uXP/Nu8AEqvTNmEICaAv2a21XO4zgl/aw8mixByrY194KrQU0ad3dsFvxq79cbNrXNwvve47aWtCP8LnWfev6SfsacNhFQhW4MX8n+P8Q3LMwIrKY0pdi3zDyTTy/2aO7zDS81kaUStgBOF83Z/U= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 156634298897589.9064551577178; Tue, 20 Aug 2019 16:16:28 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id D7445881355; Tue, 20 Aug 2019 23:16:26 +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 B095B1001947; Tue, 20 Aug 2019 23:16:26 +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 6C9FB149F6; Tue, 20 Aug 2019 23:16:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7KNG4qU013706 for ; Tue, 20 Aug 2019 19:16:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id 344A92C8D4; Tue, 20 Aug 2019 23:16:04 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id B1BE160605 for ; Tue, 20 Aug 2019 23:16:03 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 21 Aug 2019 01:15:41 +0200 Message-Id: <039f5bf1c67a4e1f9ec88842117bcfaaabfefed3.1566342870.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 19/21] conf: network: use virXMLNamespaceRegister 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.69]); Tue, 20 Aug 2019 23:16:28 +0000 (UTC) Signed-off-by: J=C3=A1n Tomko Reviewed-by: Jiri Denemark --- src/conf/network_conf.c | 2 ++ src/network/bridge_driver.c | 10 ---------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index 7eba9eacbf..8db041bd2c 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -2051,6 +2051,8 @@ virNetworkDefParseXML(xmlXPathContextPtr ctxt, if (xmlopt) def->ns =3D xmlopt->ns; if (def->ns.parse) { + if (virXMLNamespaceRegister(ctxt, &def->ns) < 0) + goto error; if ((def->ns.parse)(ctxt, &def->namespaceData) < 0) goto error; } diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index a3f7ae337a..dd4f111cc0 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -69,8 +69,6 @@ #include "virjson.h" #include "virnetworkportdef.h" =20 -#include - #define VIR_FROM_THIS VIR_FROM_NETWORK #define MAX_BRIDGE_ID 256 =20 @@ -191,14 +189,6 @@ networkDnsmasqDefNamespaceParse(xmlXPathContextPtr ctx= t, networkDnsmasqXmlNsDefPtr nsdata =3D NULL; int ret =3D -1; =20 - if (xmlXPathRegisterNs(ctxt, BAD_CAST "dnsmasq", - BAD_CAST DNSMASQ_NAMESPACE_HREF) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to register xml namespace '%s'"), - DNSMASQ_NAMESPACE_HREF); - return -1; - } - if (VIR_ALLOC(nsdata) < 0) return -1; =20 --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 09:50:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1566342971; cv=none; d=zoho.com; s=zohoarc; b=T3/NBVpDWwxZyNyhDCeCx5YkNQ9RTrHSEyzsP4nH9tw1gK0yuPG0QBhk3UQ+6gbZkS1knNIQfq2NKHfKCR3Db9mlnBLGl2ER/3azQSDLdXTrggqGazalf471pz+NizbmrNTtPV8qzClJQI9XUE92ikS9ZFECSWeN6itSte7Hw6E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566342971; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=JHnSd/YRZD1+vcjMj8zxtmW0toehhID6p4WPl6hrJbU=; b=HDw1jH1QSAy3mTCznHVQNmFiVNZOjFiTKpHTcBsg6RpUZ9A9GsNPeOXuuc55zEBcoyW3Wote23mSPu2e77Fnywc9dvuMJbXHDVcm85KZmo5LXigOuLUW9jHaSW9ZFtDFU7wTZd3XF814vlChHV2KtFTMpgT2PDJG1S9acbpvskQ= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566342971647857.8849897532555; Tue, 20 Aug 2019 16:16:11 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 7FAC66404E; Tue, 20 Aug 2019 23:16:10 +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 508B82C8E9; Tue, 20 Aug 2019 23:16:10 +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 0E6CA24F36; Tue, 20 Aug 2019 23:16:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7KNG7Bu013736 for ; Tue, 20 Aug 2019 19:16:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id ABA152C8E2; Tue, 20 Aug 2019 23:16:07 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 349DC2C8E8 for ; Tue, 20 Aug 2019 23:16:04 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 21 Aug 2019 01:15:42 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 20/21] conf: storage: use virXMLNamespaceRegister 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 20 Aug 2019 23:16:11 +0000 (UTC) Signed-off-by: J=C3=A1n Tomko Reviewed-by: Jiri Denemark --- src/conf/storage_conf.c | 2 ++ src/storage/storage_backend_fs.c | 9 --------- src/storage/storage_backend_rbd.c | 9 --------- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 6588d5c8ef..b5451e447f 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -998,6 +998,8 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt) * especially during the virStoragePoolSourceClear method */ def->ns =3D options->ns; if (def->ns.parse) { + if (virXMLNamespaceRegister(ctxt, &def->ns) < 0) + return NULL; if ((def->ns.parse)(ctxt, &def->namespaceData) < 0) return NULL; } diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend= _fs.c index 4bed6df0bb..d947beac2c 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -41,7 +41,6 @@ VIR_LOG_INIT("storage.storage_backend_fs"); =20 #if WITH_STORAGE_FS =20 -# include # include =20 struct _virNetfsDiscoverState { @@ -571,14 +570,6 @@ virStoragePoolDefFSNamespaceParse(xmlXPathContextPtr c= txt, int ret =3D -1; VIR_AUTOFREE(xmlNodePtr *)nodes =3D NULL; =20 - if (xmlXPathRegisterNs(ctxt, BAD_CAST "fs", - BAD_CAST STORAGE_POOL_FS_NAMESPACE_HREF) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to register xml namespace '%s'"), - STORAGE_POOL_FS_NAMESPACE_HREF); - return -1; - } - nnodes =3D virXPathNodeSet("./fs:mount_opts/fs:option", ctxt, &nodes); if (nnodes < 0) return -1; diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backen= d_rbd.c index 2d6c51de35..22caa189d7 100644 --- a/src/storage/storage_backend_rbd.c +++ b/src/storage/storage_backend_rbd.c @@ -36,7 +36,6 @@ #include "rbd/librbd.h" #include "secret_util.h" #include "storage_util.h" -#include =20 #define VIR_FROM_THIS VIR_FROM_STORAGE =20 @@ -91,14 +90,6 @@ virStoragePoolDefRBDNamespaceParse(xmlXPathContextPtr ct= xt, int ret =3D -1; VIR_AUTOFREE(xmlNodePtr *)nodes =3D NULL; =20 - if (xmlXPathRegisterNs(ctxt, BAD_CAST "rbd", - BAD_CAST STORAGE_POOL_RBD_NAMESPACE_HREF) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to register xml namespace '%s'"), - STORAGE_POOL_RBD_NAMESPACE_HREF); - return -1; - } - nnodes =3D virXPathNodeSet("./rbd:config_opts/rbd:option", ctxt, &node= s); if (nnodes < 0) return -1; --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 09:50:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1566342975; cv=none; d=zoho.com; s=zohoarc; b=TmgDByHx7gzxr0O+QhLGZToZ+rlQetUJSQEXbibYIFDBJNAyXENtKxuQydJxoC21tYJ6E5yrPOQAdR5OnWfKmHkkIYFazMYgNjwVAghXY5ZLA9Mom7G3TegiLu/XH7PVaV1PScHyVjDtTgRHkKE0CKCIdiHjnthOUF1OFg3jz0Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566342975; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=YPcyUCJTJG+5jBTX7JY/oZu8Xm/kMThlQoBEmgghxno=; b=XyYRJUAEeUn8S668gc4aRz4P85j0of/OSoFc2Dsm0DOGpow+a4fLhcsYWcO5rbKHKaYGZKScwwquo/YKs9I7Bi84vsmaAWsNID3Wtf3mLJmFSmNcQIQ+B52+VWbzM6WUezG4beL5mhbx7w+3lvG67XjJpvvQB6arP0TXUqpUFEQ= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566342975154541.525969595474; Tue, 20 Aug 2019 16:16:15 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id C38523175299; Tue, 20 Aug 2019 23:16:13 +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 932E85C221; Tue, 20 Aug 2019 23:16:13 +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 59F6B24E68; Tue, 20 Aug 2019 23:16:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7KNGAmu013758 for ; Tue, 20 Aug 2019 19:16:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id C26EF1B5B0; Tue, 20 Aug 2019 23:16:10 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4B1952C8E7 for ; Tue, 20 Aug 2019 23:16:07 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 21 Aug 2019 01:15:43 +0200 Message-Id: <129b16fb40239a7b87421b868c03ebf2c004d624.1566342870.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 21/21] conf: domain: use virXMLNamespaceRegister 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Tue, 20 Aug 2019 23:16:14 +0000 (UTC) Signed-off-by: J=C3=A1n Tomko Reviewed-by: Jiri Denemark --- src/bhyve/bhyve_domain.c | 9 --------- src/conf/domain_conf.c | 2 ++ src/lxc/lxc_domain.c | 8 -------- src/qemu/qemu_domain.c | 8 -------- src/test/test_driver.c | 9 --------- 5 files changed, 2 insertions(+), 34 deletions(-) diff --git a/src/bhyve/bhyve_domain.c b/src/bhyve/bhyve_domain.c index 631fb50db9..ea4bd54969 100644 --- a/src/bhyve/bhyve_domain.c +++ b/src/bhyve/bhyve_domain.c @@ -27,8 +27,6 @@ #include "viralloc.h" #include "virlog.h" =20 -#include - #define VIR_FROM_THIS VIR_FROM_BHYVE =20 VIR_LOG_INIT("bhyve.bhyve_domain"); @@ -205,13 +203,6 @@ bhyveDomainDefNamespaceParse(xmlXPathContextPtr ctxt, size_t i; int ret =3D -1; =20 - if (xmlXPathRegisterNs(ctxt, BAD_CAST "bhyve", BAD_CAST BHYVE_NAMESPAC= E_HREF) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to register xml namespace '%s'"), - BHYVE_NAMESPACE_HREF); - return -1; - } - if (VIR_ALLOC(cmd) < 0) return -1; =20 diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index a39f5f845d..b7a342bb91 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -21344,6 +21344,8 @@ virDomainDefParseXML(xmlDocPtr xml, def->ns =3D xmlopt->ns; =20 if (def->ns.parse) { + if (virXMLNamespaceRegister(ctxt, &def->ns) < 0) + goto error; if ((def->ns.parse)(ctxt, &def->namespaceData) < 0) goto error; } diff --git a/src/lxc/lxc_domain.c b/src/lxc/lxc_domain.c index 022e3c6f6a..00362e4c7f 100644 --- a/src/lxc/lxc_domain.c +++ b/src/lxc/lxc_domain.c @@ -26,7 +26,6 @@ #include "viralloc.h" #include "virlog.h" #include "virerror.h" -#include #include "virstring.h" #include "virutil.h" #include "virfile.h" @@ -219,13 +218,6 @@ lxcDomainDefNamespaceParse(xmlXPathContextPtr ctxt, char *tmp =3D NULL; size_t i; =20 - if (xmlXPathRegisterNs(ctxt, BAD_CAST "lxc", BAD_CAST LXC_NAMESPACE_HR= EF) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to register xml namespace '%s'"), - LXC_NAMESPACE_HREF); - return -1; - } - if (VIR_ALLOC(lxcDef) < 0) return -1; =20 diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 0b2065b52c..6d770d3c13 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -73,7 +73,6 @@ # include #endif =20 -#include #include "dosname.h" =20 #define QEMU_QXL_VGAMEM_DEFAULT 16 * 1024 @@ -3632,13 +3631,6 @@ qemuDomainDefNamespaceParse(xmlXPathContextPtr ctxt, qemuDomainXmlNsDefPtr nsdata =3D NULL; int ret =3D -1; =20 - if (xmlXPathRegisterNs(ctxt, BAD_CAST "qemu", BAD_CAST QEMU_NAMESPACE_= HREF) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to register xml namespace '%s'"), - QEMU_NAMESPACE_HREF); - return -1; - } - if (VIR_ALLOC(nsdata) < 0) return -1; =20 diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 3bdeb6c00a..57d54c05b3 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -26,7 +26,6 @@ #include #include #include -#include =20 =20 #include "virerror.h" @@ -213,14 +212,6 @@ testDomainDefNamespaceParse(xmlXPathContextPtr ctxt, unsigned int tmpuint; VIR_AUTOFREE(xmlNodePtr *) nodes =3D NULL; =20 - if (xmlXPathRegisterNs(ctxt, BAD_CAST "test", - BAD_CAST TEST_NAMESPACE_HREF) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to register xml namespace '%s'"), - TEST_NAMESPACE_HREF); - return -1; - } - if (VIR_ALLOC(nsdata) < 0) return -1; =20 --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list