From: Ján Tomko Date: Tue, 20 Aug 2019 22:03:15 +0000 (+0200) Subject: xml: virXMLNamespace: add prefix X-Git-Tag: v5.7.0-rc1~150 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e2710caffccf85e65353022fb6815d4eb23299e;p=thirdparty%2Flibvirt.git xml: virXMLNamespace: add prefix 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án Tomko Reviewed-by: Jiri Denemark --- diff --git a/src/util/virxml.h b/src/util/virxml.h index c0012d691d..61520968ae 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;