From f1ded974c3771cc424b2e0786bd4064940411835 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 17 Jun 2019 16:45:06 +0200 Subject: [PATCH] qemu: domain: Split out commandline namespace data formatting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Separate it from qemuDomainDefNamespaceFormatXML. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- 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 4fe84253bc..0144ec61fd 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3228,15 +3228,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, "\n"); virBufferAdjustIndent(buf, 2); @@ -3253,6 +3253,17 @@ qemuDomainDefNamespaceFormatXML(virBufferPtr buf, virBufferAdjustIndent(buf, -2); virBufferAddLit(buf, "\n"); +} + + +static int +qemuDomainDefNamespaceFormatXML(virBufferPtr buf, + void *nsdata) +{ + qemuDomainXmlNsDefPtr cmd = nsdata; + + qemuDomainDefNamespaceFormatXMLCommandline(buf, cmd); + return 0; } -- GitLab