提交 56ecb331 编写于 作者: J Ján Tomko

conf: domain: use virXMLNamespaceFormatNS

Signed-off-by: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
上级 ff94298f
...@@ -270,7 +270,7 @@ bhyveDomainDefNamespaceFormatXML(virBufferPtr buf, ...@@ -270,7 +270,7 @@ bhyveDomainDefNamespaceFormatXML(virBufferPtr buf,
static const char * static const char *
bhyveDomainDefNamespaceHref(void) bhyveDomainDefNamespaceHref(void)
{ {
return "xmlns:bhyve='" BHYVE_NAMESPACE_HREF "'"; return BHYVE_NAMESPACE_HREF;
} }
virXMLNamespace virBhyveDriverDomainXMLNamespace = { virXMLNamespace virBhyveDriverDomainXMLNamespace = {
......
...@@ -28313,8 +28313,8 @@ virDomainDefFormatInternal(virDomainDefPtr def, ...@@ -28313,8 +28313,8 @@ virDomainDefFormatInternal(virDomainDefPtr def,
virBufferAsprintf(buf, "<domain type='%s'", type); virBufferAsprintf(buf, "<domain type='%s'", type);
if (!(flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE)) if (!(flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE))
virBufferAsprintf(buf, " id='%d'", def->id); virBufferAsprintf(buf, " id='%d'", def->id);
if (def->namespaceData && def->ns.href) if (def->namespaceData && def->ns.format)
virBufferAsprintf(buf, " %s", (def->ns.href)()); virXMLNamespaceFormatNS(buf, &def->ns);
virBufferAddLit(buf, ">\n"); virBufferAddLit(buf, ">\n");
virBufferAdjustIndent(buf, 2); virBufferAdjustIndent(buf, 2);
......
...@@ -313,7 +313,7 @@ lxcDomainDefNamespaceFormatXML(virBufferPtr buf, ...@@ -313,7 +313,7 @@ lxcDomainDefNamespaceFormatXML(virBufferPtr buf,
static const char * static const char *
lxcDomainDefNamespaceHref(void) lxcDomainDefNamespaceHref(void)
{ {
return "xmlns:lxc='" LXC_NAMESPACE_HREF "'"; return LXC_NAMESPACE_HREF;
} }
......
...@@ -3724,7 +3724,7 @@ qemuDomainDefNamespaceFormatXML(virBufferPtr buf, ...@@ -3724,7 +3724,7 @@ qemuDomainDefNamespaceFormatXML(virBufferPtr buf,
static const char * static const char *
qemuDomainDefNamespaceHref(void) qemuDomainDefNamespaceHref(void)
{ {
return "xmlns:qemu='" QEMU_NAMESPACE_HREF "'"; return QEMU_NAMESPACE_HREF;
} }
......
...@@ -181,6 +181,12 @@ struct _testDomainNamespaceDef { ...@@ -181,6 +181,12 @@ struct _testDomainNamespaceDef {
xmlNodePtr *snap_nodes; xmlNodePtr *snap_nodes;
}; };
static const char*
testDomainDefNamespaceHref(void)
{
return TEST_NAMESPACE_HREF;
}
static void static void
testDomainDefNamespaceFree(void *data) testDomainDefNamespaceFree(void *data)
{ {
...@@ -430,6 +436,7 @@ testDriverNew(void) ...@@ -430,6 +436,7 @@ testDriverNew(void)
.parse = testDomainDefNamespaceParse, .parse = testDomainDefNamespaceParse,
.free = testDomainDefNamespaceFree, .free = testDomainDefNamespaceFree,
.prefix = "test", .prefix = "test",
.href = testDomainDefNamespaceHref,
}; };
virDomainDefParserConfig config = { virDomainDefParserConfig config = {
.features = VIR_DOMAIN_DEF_FEATURE_MEMORY_HOTPLUG | .features = VIR_DOMAIN_DEF_FEATURE_MEMORY_HOTPLUG |
......
...@@ -600,7 +600,7 @@ virVMXDomainDefNamespaceFormatXML(virBufferPtr buf, void *nsdata) ...@@ -600,7 +600,7 @@ virVMXDomainDefNamespaceFormatXML(virBufferPtr buf, void *nsdata)
static const char * static const char *
virVMXDomainDefNamespaceHref(void) virVMXDomainDefNamespaceHref(void)
{ {
return "xmlns:vmware='http://libvirt.org/schemas/domain/vmware/1.0'"; return "http://libvirt.org/schemas/domain/vmware/1.0";
} }
static virXMLNamespace virVMXDomainXMLNamespace = { static virXMLNamespace virVMXDomainXMLNamespace = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册