mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 06:50:22 +03:00
qemuBuildObjectCommandlineFromJSON: Assume all qemus support QEMU_CAPS_OBJECT_JSON
'-object' was qapified (meaning it supports JSON props) in qemu-6.0, thus now that we require qemu-6.2 we can drop the compatibility code. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
554a5e508a
commit
51f7b35612
@ -185,25 +185,12 @@ qemuOnOffAuto(virTristateSwitch s)
|
||||
static int
|
||||
qemuBuildObjectCommandlineFromJSON(virCommand *cmd,
|
||||
virJSONValue *props,
|
||||
virQEMUCaps *qemuCaps)
|
||||
virQEMUCaps *qemuCaps G_GNUC_UNUSED)
|
||||
{
|
||||
g_autofree char *arg = NULL;
|
||||
|
||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_JSON)) {
|
||||
if (!(arg = virJSONValueToString(props, false)))
|
||||
return -1;
|
||||
} else {
|
||||
const char *type = virJSONValueObjectGetString(props, "qom-type");
|
||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||
|
||||
virBufferAsprintf(&buf, "%s,", type);
|
||||
|
||||
if (virQEMUBuildCommandLineJSON(props, &buf, "qom-type",
|
||||
virQEMUBuildCommandLineJSONArrayBitmap) < 0)
|
||||
return -1;
|
||||
|
||||
arg = virBufferContentAndReset(&buf);
|
||||
}
|
||||
if (!(arg = virJSONValueToString(props, false)))
|
||||
return -1;
|
||||
|
||||
virCommandAddArgList(cmd, "-object", arg, NULL);
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user