From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 4/4] fbdev: add monitor command to enable/disable
Date: Mon, 10 Sep 2012 16:21:00 +0200 [thread overview]
Message-ID: <1347286860-22918-5-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1347286860-22918-1-git-send-email-kraxel@redhat.com>
This patch adds a fbdev monitor command to enable/disable
the fbdev display at runtime to both qmp and hmp.
qmp: fbdev enable=on|off
hmp: fbdev on|off
---
hmp-commands.hx | 15 +++++++++++++++
hmp.c | 9 +++++++++
hmp.h | 1 +
qapi-schema.json | 15 +++++++++++++++
qmp-commands.hx | 6 ++++++
qmp.c | 17 +++++++++++++++++
6 files changed, 63 insertions(+), 0 deletions(-)
diff --git a/hmp-commands.hx b/hmp-commands.hx
index f6104b0..1ef372b 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -1378,6 +1378,21 @@ passed since 1970, i.e. unix epoch.
ETEXI
{
+ .name = "fbdev",
+ .args_type = "enable:b",
+ .params = "on|off",
+ .help = "enable/disable fbdev",
+ .mhandler.cmd = hmp_fbdev,
+ },
+
+STEXI
+@item fbdev on | off
+@findex fbdev
+
+enable/disable fbdev
+ETEXI
+
+ {
.name = "info",
.args_type = "item:s?",
.params = "[subcommand]",
diff --git a/hmp.c b/hmp.c
index 81c8acb..a7f9ecb 100644
--- a/hmp.c
+++ b/hmp.c
@@ -1102,3 +1102,12 @@ void hmp_closefd(Monitor *mon, const QDict *qdict)
qmp_closefd(fdname, &errp);
hmp_handle_error(mon, &errp);
}
+
+void hmp_fbdev(Monitor *mon, const QDict *qdict)
+{
+ int enable = qdict_get_bool(qdict, "enable");
+ Error *errp = NULL;
+
+ qmp_fbdev(enable, &errp);
+ hmp_handle_error(mon, &errp);
+}
diff --git a/hmp.h b/hmp.h
index 7dd93bf..1eb02aa 100644
--- a/hmp.h
+++ b/hmp.h
@@ -71,5 +71,6 @@ void hmp_netdev_add(Monitor *mon, const QDict *qdict);
void hmp_netdev_del(Monitor *mon, const QDict *qdict);
void hmp_getfd(Monitor *mon, const QDict *qdict);
void hmp_closefd(Monitor *mon, const QDict *qdict);
+void hmp_fbdev(Monitor *mon, const QDict *qdict);
#endif
diff --git a/qapi-schema.json b/qapi-schema.json
index bd8ad74..d83ee2b 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -2493,3 +2493,18 @@
# Since: 1.2.0
##
{ 'command': 'query-target', 'returns': 'TargetInfo' }
+
+##
+# @fbdev:
+#
+# Enable/disable fbdev.
+#
+# @enable: true to set the link status to be up
+#
+# Returns: Nothing on success
+# If @name is not a valid network device, DeviceNotFound
+#
+# Since: 1.3
+#
+##
+{ 'command': 'fbdev', 'data': {'enable': 'bool'} }
diff --git a/qmp-commands.hx b/qmp-commands.hx
index 3745a21..8382020 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -2514,3 +2514,9 @@ EQMP
.args_type = "",
.mhandler.cmd_new = qmp_marshal_input_query_target,
},
+
+ {
+ .name = "fbdev",
+ .args_type = "enable:b",
+ .mhandler.cmd_new = qmp_marshal_input_fbdev,
+ },
diff --git a/qmp.c b/qmp.c
index 8463922..d7306ab 100644
--- a/qmp.c
+++ b/qmp.c
@@ -391,6 +391,23 @@ void qmp_change(const char *device, const char *target,
}
}
+void qmp_fbdev(bool enable, Error **errp)
+{
+#if defined(CONFIG_LINUX)
+ DisplayState *ds = get_displaystate();
+
+ if (enable) {
+ if (fbdev_display_init(ds, NULL) != 0) {
+ error_set(errp, QERR_UNDEFINED_ERROR);
+ }
+ } else {
+ fbdev_display_uninit(ds);
+ }
+#else
+ error_set(errp, QERR_FEATURE_DISABLED, "fbdev");
+#endif
+}
+
static void qom_list_types_tramp(ObjectClass *klass, void *data)
{
ObjectTypeInfoList *e, **pret = data;
--
1.7.1
next prev parent reply other threads:[~2012-09-10 14:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-10 14:20 [Qemu-devel] [PATCH 0/4] linux framebuffer display driver Gerd Hoffmann
2012-09-10 14:20 ` [Qemu-devel] [PATCH 1/4] QLIST-ify display change listeners Gerd Hoffmann
2012-09-10 14:20 ` [Qemu-devel] [PATCH 2/4] add unregister_displaychangelistener Gerd Hoffmann
2012-09-10 14:20 ` [Qemu-devel] [PATCH 3/4] fbdev: add linux framebuffer display driver Gerd Hoffmann
2012-09-11 11:10 ` Markus Armbruster
2012-09-11 20:37 ` Blue Swirl
2012-09-10 14:21 ` Gerd Hoffmann [this message]
2012-09-11 9:30 ` [Qemu-devel] [PATCH 4/4] fbdev: add monitor command to enable/disable Markus Armbruster
2012-09-11 8:09 ` [Qemu-devel] [PATCH 0/4] linux framebuffer display driver Alon Levy
2012-09-11 8:54 ` Gerd Hoffmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1347286860-22918-5-git-send-email-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).