提交 1bd17918 编写于 作者: H Han Han 提交者: Michal Privoznik

util: Do not assume comma after object id

For qemu object like rng-builtin, there are no properties after id
property. We should always set comma after object id. Otherwise it will
cause trailing comma on object:
    -object rng-builtin,id=ID,
Signed-off-by: NHan Han <hhan@redhat.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 9378713f
...@@ -239,12 +239,14 @@ virQEMUBuildObjectCommandlineFromJSONInternal(virBufferPtr buf, ...@@ -239,12 +239,14 @@ virQEMUBuildObjectCommandlineFromJSONInternal(virBufferPtr buf,
return -1; return -1;
} }
virBufferAsprintf(buf, "%s,id=%s,", type, alias); virBufferAsprintf(buf, "%s,id=%s", type, alias);
if (props && if (props) {
virQEMUBuildCommandLineJSON(props, buf, virBufferAddLit(buf, ",");
if (virQEMUBuildCommandLineJSON(props, buf,
virQEMUBuildCommandLineJSONArrayBitmap) < 0) virQEMUBuildCommandLineJSONArrayBitmap) < 0)
return -1; return -1;
}
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册