From nobody Sun Apr 28 11:33:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1542704272813874.3421877325609; Tue, 20 Nov 2018 00:57:52 -0800 (PST) Received: from localhost ([::1]:60857 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gP1qq-0006Ke-SU for importer@patchew.org; Tue, 20 Nov 2018 03:57:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37881) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gP1pS-0005SY-Vt for qemu-devel@nongnu.org; Tue, 20 Nov 2018 03:56:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gP1pP-0000Ca-Qi for qemu-devel@nongnu.org; Tue, 20 Nov 2018 03:56:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36264) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gP1pP-0000Bg-KI for qemu-devel@nongnu.org; Tue, 20 Nov 2018 03:56:15 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 218093084044 for ; Tue, 20 Nov 2018 08:56:14 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-59.ams2.redhat.com [10.36.116.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 036E52B1C2; Tue, 20 Nov 2018 08:56:04 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 393C824D56A; Tue, 20 Nov 2018 09:56:03 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 20 Nov 2018 09:56:03 +0100 Message-Id: <20181120085603.31472-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 20 Nov 2018 08:56:14 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] qapi: add query-display-options command X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Erik Skultety , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add query-display-options command, which allows to query the qemu display configuration, and -- as intentional side effect -- makes DisplayOptions discoverable via query-qmp-schema so libvirt can go figure which display options are supported. Cc: Eric Blake Cc: Erik Skultety Signed-off-by: Gerd Hoffmann Reviewed-by: Eric Blake Tested-by: Eric Blake Tested-by: Erik Skultety --- vl.c | 10 ++++++++++ qapi/ui.json | 13 +++++++++++++ 2 files changed, 23 insertions(+) diff --git a/vl.c b/vl.c index fa25d1ae2d..c6e662677a 100644 --- a/vl.c +++ b/vl.c @@ -128,6 +128,7 @@ int main(int argc, char **argv) #include "qapi/qapi-commands-block-core.h" #include "qapi/qapi-commands-misc.h" #include "qapi/qapi-commands-run-state.h" +#include "qapi/qapi-commands-ui.h" #include "qapi/qmp/qerror.h" #include "sysemu/iothread.h" =20 @@ -2055,6 +2056,15 @@ static void parse_display_qapi(const char *optarg) visit_free(v); } =20 +DisplayOptions *qmp_query_display_options(Error **errp) +{ + DisplayOptions *opts; + + opts =3D g_new(DisplayOptions, 1); + QAPI_CLONE_MEMBERS(DisplayOptions, opts, &dpy); + return opts; +} + static void parse_display(const char *p) { const char *opts; diff --git a/qapi/ui.json b/qapi/ui.json index bf9e157d5a..3e58fd20ea 100644 --- a/qapi/ui.json +++ b/qapi/ui.json @@ -1087,3 +1087,16 @@ '*gl' : 'DisplayGLMode' }, 'discriminator' : 'type', 'data' : { 'gtk' : 'DisplayGTK' } } + +## +# @query-display-options: +# +# Returns information about display configuration +# +# Returns: @DisplayOptions +# +# Since: 3.1 +# +## +{ 'command': 'query-display-options', + 'returns': 'DisplayOptions' } --=20 2.9.3