mirror of
https://github.com/libvirt/libvirt.git
synced 2026-09-03 20:53:04 -05:00
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: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
committed by
Michal Privoznik
parent
9378713f56
commit
1bd17918b6
+7
-5
@@ -239,12 +239,14 @@ virQEMUBuildObjectCommandlineFromJSONInternal(virBufferPtr buf,
|
||||
return -1;
|
||||
}
|
||||
|
||||
virBufferAsprintf(buf, "%s,id=%s,", type, alias);
|
||||
virBufferAsprintf(buf, "%s,id=%s", type, alias);
|
||||
|
||||
if (props &&
|
||||
virQEMUBuildCommandLineJSON(props, buf,
|
||||
virQEMUBuildCommandLineJSONArrayBitmap) < 0)
|
||||
return -1;
|
||||
if (props) {
|
||||
virBufferAddLit(buf, ",");
|
||||
if (virQEMUBuildCommandLineJSON(props, buf,
|
||||
virQEMUBuildCommandLineJSONArrayBitmap) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user