mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06: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:
parent
5c4fc07d1a
commit
369199d1a9
@ -4536,14 +4536,12 @@ qemuDomainDefCopy(virQEMUDriverPtr driver,
|
|||||||
virDomainDefPtr src,
|
virDomainDefPtr src,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
|
||||||
virDomainDefPtr ret = NULL;
|
virDomainDefPtr ret = NULL;
|
||||||
char *xml = NULL;
|
char *xml;
|
||||||
|
|
||||||
if (qemuDomainDefFormatBuf(driver, src, flags, &buf) < 0)
|
if (!(xml = qemuDomainDefFormatXML(driver, src, flags)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
xml = virBufferContentAndReset(&buf);
|
|
||||||
ret = qemuDomainDefFromXML(driver, xml);
|
ret = qemuDomainDefFromXML(driver, xml);
|
||||||
|
|
||||||
VIR_FREE(xml);
|
VIR_FREE(xml);
|
||||||
|
Loading…
Reference in New Issue
Block a user