From d804bde82b407d4d2f4b2d4dd1a84bf66eb65153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Tue, 20 Aug 2019 13:23:36 +0200 Subject: [PATCH] qemuBuildSmpCommandLine: use virCommandAddArgBuffer directly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of getting the string then passing it to virCommand. Signed-off-by: Ján Tomko Reviewed-by: Michal Privoznik --- 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 4c0856274f..7dc385f0d4 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7556,7 +7556,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; @@ -7592,10 +7591,7 @@ qemuBuildSmpCommandLine(virCommandPtr cmd, if (virBufferCheckError(&buf) < 0) return -1; - smp = virBufferContentAndReset(&buf); - virCommandAddArg(cmd, smp); - VIR_FREE(smp); - + virCommandAddArgBuffer(cmd, &buf); return 0; } -- GitLab