1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-21 10:50:24 +03:00

qemu: Use qemuDomainDefFormatXML in qemuDomainDefCopy

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@redhat.com>
This commit is contained in:
Jiri Denemark 2017-09-15 16:32:00 +02:00
parent 5c4fc07d1a
commit 369199d1a9

View File

@ -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);