thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
26ba25
From 056ced52b46ff725b79c04813467ce0643c1b878 Mon Sep 17 00:00:00 2001
26ba25
From: Gerd Hoffmann <kraxel@redhat.com>
26ba25
Date: Fri, 14 Dec 2018 08:26:42 +0000
26ba25
Subject: [PATCH 5/5] qapi: add query-display-options command
26ba25
MIME-Version: 1.0
26ba25
Content-Type: text/plain; charset=UTF-8
26ba25
Content-Transfer-Encoding: 8bit
26ba25
26ba25
RH-Author: Gerd Hoffmann <kraxel@redhat.com>
26ba25
Message-id: <20181214082642.21878-6-kraxel@redhat.com>
26ba25
Patchwork-id: 83503
26ba25
O-Subject: [RHEL8/rhel qemu-kvm PATCH 5/5] qapi: add query-display-options command
26ba25
Bugzilla: 1652871
26ba25
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
26ba25
RH-Acked-by: Daniel P. Berrange <berrange@redhat.com>
26ba25
RH-Acked-by: Erik Skultety <eskultet@redhat.com>
26ba25
26ba25
Add query-display-options command, which allows querying the qemu
26ba25
display configuration.  This isn't particularly useful, except it
26ba25
exposes QAPI type DisplayOptions in query-qmp-schema, so that libvirt
26ba25
can discover recently added -display parameter rendernode (commit
26ba25
d4dc4ab133b).  Works around lack of sufficiently powerful command line
26ba25
introspection.
26ba25
26ba25
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
26ba25
Reviewed-by: Eric Blake <eblake@redhat.com>
26ba25
Tested-by: Eric Blake <eblake@redhat.com>
26ba25
Tested-by: Erik Skultety <eskultet@redhat.com>
26ba25
Message-id: 20181122071613.2889-1-kraxel@redhat.com
26ba25
26ba25
[ kraxel: reworded commit message as suggested by armbru ]
26ba25
26ba25
(cherry picked from commit e1ca8f7e1915496148f6e0ce1f7c2309af013312)
26ba25
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
26ba25
26ba25
Conflicts:
26ba25
	qapi/ui.json
26ba25
26ba25
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
26ba25
---
26ba25
 qapi/ui.json | 13 +++++++++++++
26ba25
 vl.c         |  6 ++++++
26ba25
 2 files changed, 19 insertions(+)
26ba25
26ba25
diff --git a/qapi/ui.json b/qapi/ui.json
26ba25
index 3e8aeee..1475867 100644
26ba25
--- a/qapi/ui.json
26ba25
+++ b/qapi/ui.json
26ba25
@@ -1071,3 +1071,16 @@
26ba25
                 'egl-headless'   : 'DisplayEGLHeadless',
26ba25
                 'curses'         : 'DisplayNoOpts',
26ba25
                 'cocoa'          : 'DisplayNoOpts' } }
26ba25
+
26ba25
+##
26ba25
+# @query-display-options:
26ba25
+#
26ba25
+# Returns information about display configuration
26ba25
+#
26ba25
+# Returns: @DisplayOptions
26ba25
+#
26ba25
+# Since: 3.1
26ba25
+#
26ba25
+##
26ba25
+{ 'command': 'query-display-options',
26ba25
+  'returns': 'DisplayOptions' }
26ba25
diff --git a/vl.c b/vl.c
26ba25
index a4d1e3f..9d32921 100644
26ba25
--- a/vl.c
26ba25
+++ b/vl.c
26ba25
@@ -131,6 +131,7 @@ int main(int argc, char **argv)
26ba25
 #include "qapi/qapi-commands-block-core.h"
26ba25
 #include "qapi/qapi-commands-misc.h"
26ba25
 #include "qapi/qapi-commands-run-state.h"
26ba25
+#include "qapi/qapi-commands-ui.h"
26ba25
 #include "qapi/qmp/qerror.h"
26ba25
 #include "sysemu/iothread.h"
26ba25
 
26ba25
@@ -2138,6 +2139,11 @@ static void parse_display_qapi(const char *optarg)
26ba25
     visit_free(v);
26ba25
 }
26ba25
 
26ba25
+DisplayOptions *qmp_query_display_options(Error **errp)
26ba25
+{
26ba25
+    return QAPI_CLONE(DisplayOptions, &dpy);
26ba25
+}
26ba25
+
26ba25
 static void parse_display(const char *p)
26ba25
 {
26ba25
     const char *opts;
26ba25
-- 
26ba25
1.8.3.1
26ba25