[libvirt] [PATCH 13/19] qemuBuildSmpCommandLine: use virCommandAddArgBuffer directly

Ján Tomko jtomko at redhat.com
Tue Aug 20 12:59:12 UTC 2019


Instead of getting the string then passing it to virCommand.

Signed-off-by: Ján Tomko <jtomko at redhat.com>
---
 src/qemu/qemu_command.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 67de0fc35e..cc589a70b2 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -7606,7 +7606,6 @@ static int
 qemuBuildSmpCommandLine(virCommandPtr cmd,
                         virDomainDefPtr def)
 {
-    char *smp = NULL;
     VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
     unsigned int maxvcpus = virDomainDefGetVcpusMax(def);
     unsigned int nvcpus = 0;
@@ -7642,10 +7641,7 @@ qemuBuildSmpCommandLine(virCommandPtr cmd,
     if (virBufferCheckError(&buf) < 0)
         return -1;
 
-    smp = virBufferContentAndReset(&buf);
-    virCommandAddArg(cmd, smp);
-    VIR_FREE(smp);
-
+    virCommandAddArgBuffer(cmd, &buf);
     return 0;
 }
 
-- 
2.19.2




More information about the libvir-list mailing list