Blame SOURCES/kvm-qapi-add-query-display-options-command.patch

383d26
From 8c923259c0880336125c05adb5b7e8001776cd79 Mon Sep 17 00:00:00 2001
383d26
From: Gerd Hoffmann <kraxel@redhat.com>
383d26
Date: Tue, 5 Mar 2019 08:26:16 +0100
383d26
Subject: [PATCH 8/9] qapi: add query-display-options command
383d26
MIME-Version: 1.0
383d26
Content-Type: text/plain; charset=UTF-8
383d26
Content-Transfer-Encoding: 8bit
383d26
383d26
RH-Author: Gerd Hoffmann <kraxel@redhat.com>
383d26
Message-id: <20190305082617.14614-4-kraxel@redhat.com>
383d26
Patchwork-id: 84795
383d26
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH 3/4] qapi: add query-display-options command
383d26
Bugzilla: 1648236
383d26
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
383d26
RH-Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
383d26
RH-Acked-by: John Snow <jsnow@redhat.com>
383d26
RH-Acked-by: Erik Skultety <eskultet@redhat.com>
383d26
383d26
Add query-display-options command, which allows querying the qemu
383d26
display configuration.  This isn't particularly useful, except it
383d26
exposes QAPI type DisplayOptions in query-qmp-schema, so that libvirt
383d26
can discover recently added -display parameter rendernode (commit
383d26
d4dc4ab133b).  Works around lack of sufficiently powerful command line
383d26
introspection.
383d26
383d26
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
383d26
Reviewed-by: Eric Blake <eblake@redhat.com>
383d26
Tested-by: Eric Blake <eblake@redhat.com>
383d26
Tested-by: Erik Skultety <eskultet@redhat.com>
383d26
Message-id: 20181122071613.2889-1-kraxel@redhat.com
383d26
383d26
[ kraxel: reworded commit message as suggested by armbru ]
383d26
383d26
(cherry picked from commit e1ca8f7e1915496148f6e0ce1f7c2309af013312)
383d26
383d26
[ kraxel: No QAPI_CLONE() in rhel-7.  So do a manual clone of the
383d26
          one essential field: DisplayOptions->type ]
383d26
383d26
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
383d26
---
383d26
 qapi/ui.json | 13 +++++++++++++
383d26
 vl.c         |  9 +++++++++
383d26
 2 files changed, 22 insertions(+)
383d26
383d26
diff --git a/qapi/ui.json b/qapi/ui.json
383d26
index 3e8aeee..1475867 100644
383d26
--- a/qapi/ui.json
383d26
+++ b/qapi/ui.json
383d26
@@ -1071,3 +1071,16 @@
383d26
                 'egl-headless'   : 'DisplayEGLHeadless',
383d26
                 'curses'         : 'DisplayNoOpts',
383d26
                 'cocoa'          : 'DisplayNoOpts' } }
383d26
+
383d26
+##
383d26
+# @query-display-options:
383d26
+#
383d26
+# Returns information about display configuration
383d26
+#
383d26
+# Returns: @DisplayOptions
383d26
+#
383d26
+# Since: 3.1
383d26
+#
383d26
+##
383d26
+{ 'command': 'query-display-options',
383d26
+  'returns': 'DisplayOptions' }
383d26
diff --git a/vl.c b/vl.c
383d26
index 713f899..8b79eb9 100644
383d26
--- a/vl.c
383d26
+++ b/vl.c
383d26
@@ -129,6 +129,7 @@ int main(int argc, char **argv)
383d26
 #include "qapi/qapi-commands-block-core.h"
383d26
 #include "qapi/qapi-commands-misc.h"
383d26
 #include "qapi/qapi-commands-run-state.h"
383d26
+#include "qapi/qapi-commands-ui.h"
383d26
 #include "qapi/qmp/qerror.h"
383d26
 #include "sysemu/iothread.h"
383d26
 
383d26
@@ -2119,6 +2120,14 @@ static void select_vgahw(const char *p)
383d26
     }
383d26
 }
383d26
 
383d26
+DisplayOptions *qmp_query_display_options(Error **errp)
383d26
+{
383d26
+    DisplayOptions *r = g_new0(DisplayOptions, 1);
383d26
+
383d26
+    r->type = dpy.type;
383d26
+    return r;
383d26
+}
383d26
+
383d26
 static void parse_display(const char *p)
383d26
 {
383d26
     const char *opts;
383d26
-- 
383d26
1.8.3.1
383d26