[PATCH 009/103] qemuBuildObjectCommandlineFromJSON: Remove checks for 'type' and 'alias'

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

 



We validate the generated props agains the QMP schema which makes sure
that the objects are generated properly.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_command.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 1a946d895d..f82768d5b1 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -161,20 +161,12 @@ qemuBuildObjectCommandlineFromJSON(virCommand *cmd,
                                    virQEMUCaps *qemuCaps)
 {
     g_autofree char *arg = NULL;
-    const char *type = virJSONValueObjectGetString(props, "qom-type");
-    const char *alias = virJSONValueObjectGetString(props, "id");
-
-    if (!type || !alias) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("missing 'type'(%s) or 'alias'(%s) field of QOM 'object'"),
-                       NULLSTR(type), NULLSTR(alias));
-        return -1;
-    }

     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);
-- 
2.31.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