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

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