Separate it from qemuDomainDefNamespaceFormatXML.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_domain.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index ee8c9397e0..864071220b 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3232,15 +3232,15 @@ qemuDomainDefNamespaceParse(xmlDocPtr xml ATTRIBUTE_UNUSED,
return ret;
}
-static int
-qemuDomainDefNamespaceFormatXML(virBufferPtr buf,
- void *nsdata)
+
+static void
+qemuDomainDefNamespaceFormatXMLCommandline(virBufferPtr buf,
+ qemuDomainXmlNsDefPtr cmd)
{
- qemuDomainXmlNsDefPtr cmd = nsdata;
size_t i;
if (!cmd->num_args && !cmd->num_env)
- return 0;
+ return;
virBufferAddLit(buf, "<qemu:commandline>\n");
virBufferAdjustIndent(buf, 2);
@@ -3257,6 +3257,17 @@ qemuDomainDefNamespaceFormatXML(virBufferPtr buf,
virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</qemu:commandline>\n");
+}
+
+
+static int
+qemuDomainDefNamespaceFormatXML(virBufferPtr buf,
+ void *nsdata)
+{
+ qemuDomainXmlNsDefPtr cmd = nsdata;
+
+ qemuDomainDefNamespaceFormatXMLCommandline(buf, cmd);
+
return 0;
}
--
2.21.0