提交 d804bde8 编写于 作者: J Ján Tomko

qemuBuildSmpCommandLine: use virCommandAddArgBuffer directly

Instead of getting the string then passing it to virCommand.
Signed-off-by: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 6e61843d
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册