Because qemuDomainDefCopy needs a string representation of a domain
definition, there's no reason for calling the lower level
qemuDomainDefFormatBuf API.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_domain.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 689dbdb043..3325300da8 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -4536,14 +4536,12 @@ qemuDomainDefCopy(virQEMUDriverPtr driver,
virDomainDefPtr src,
unsigned int flags)
{
- virBuffer buf = VIR_BUFFER_INITIALIZER;
virDomainDefPtr ret = NULL;
- char *xml = NULL;
+ char *xml;
- if (qemuDomainDefFormatBuf(driver, src, flags, &buf) < 0)
+ if (!(xml = qemuDomainDefFormatXML(driver, src, flags)))
return NULL;
- xml = virBufferContentAndReset(&buf);
ret = qemuDomainDefFromXML(driver, xml);
VIR_FREE(xml);
--
2.14.1