[PATCH 2/2] qemu: Use qemuDomainDefFormatXML in qemuDomainDefCopy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux