[PATCH 03/17] qemuBuildObjectCommandlineFromJSON: Assume all qemus support QEMU_CAPS_OBJECT_JSON

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



'-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@xxxxxxxxxx>
---
 src/qemu/qemu_command.c | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 2b0e3dd53a..51e428e017 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -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;
-- 
2.48.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux