qemuBuildSmpCommandLine: use virCommandAddArgBuffer directly

Instead of getting the string then passing it to virCommand.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Ján Tomko 2019-08-20 13:23:36 +02:00
parent 6e61843d07
commit d804bde82b

View File

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