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>
qemuBuildSmpCommandLine(virCommandPtr cmd,
virDomainDefPtr def)
{
- char *smp = NULL;
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
unsigned int maxvcpus = virDomainDefGetVcpusMax(def);
unsigned int nvcpus = 0;
if (virBufferCheckError(&buf) < 0)
return -1;
- smp = virBufferContentAndReset(&buf);
- virCommandAddArg(cmd, smp);
- VIR_FREE(smp);
-
+ virCommandAddArgBuffer(cmd, &buf);
return 0;
}