[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/17] monitor: Convert do_info_hpet() to QObject
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PATCH 09/17] monitor: Convert do_info_hpet() to QObject |
Date: |
Fri, 4 Dec 2009 15:11:27 -0200 |
Return a QString with HPET information.
Signed-off-by: Luiz Capitulino <address@hidden>
---
monitor.c | 24 +++++++++++++++++++++---
1 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/monitor.c b/monitor.c
index 96fde16..f9a698f 100644
--- a/monitor.c
+++ b/monitor.c
@@ -548,10 +548,27 @@ static void do_info_commands(Monitor *mon, QObject
**ret_data)
}
#if defined(TARGET_I386)
-static void do_info_hpet(Monitor *mon)
+static void do_info_hpet_print(Monitor *mon, const QObject *data)
{
monitor_printf(mon, "HPET is %s by QEMU\n",
- (no_hpet) ? "disabled" : "enabled");
+ qstring_get_str(qobject_to_qstring(data)));
+}
+
+/**
+ * do_info_hpet(): Show HPET state
+ *
+ * Return a QString with HPET information, which can be:
+ *
+ * - "enabled"
+ * - "disabled"
+ */
+static void do_info_hpet(Monitor *mon, QObject **ret_data)
+{
+ if (no_hpet) {
+ *ret_data = QOBJECT(qstring_from_str("disabled"));
+ } else {
+ *ret_data = QOBJECT(qstring_from_str("enabled"));
+ }
}
#endif
@@ -2296,7 +2313,8 @@ static const mon_cmd_t info_cmds[] = {
.args_type = "",
.params = "",
.help = "show state of HPET",
- .mhandler.info = do_info_hpet,
+ .user_print = do_info_hpet_print,
+ .mhandler.info_new = do_info_hpet,
},
#endif
{
--
1.6.6.rc1.5.ge21a85
- [Qemu-devel] [PATCH 02/17] Makefile: move QObject objs to their own entry, (continued)
- [Qemu-devel] [PATCH 02/17] Makefile: move QObject objs to their own entry, Luiz Capitulino, 2009/12/04
- [Qemu-devel] [PATCH 03/17] QDict: Introduce qdict_get_qbool(), Luiz Capitulino, 2009/12/04
- [Qemu-devel] [PATCH 04/17] QDict: Introduce qdict_get_qlist(), Luiz Capitulino, 2009/12/04
- [Qemu-devel] [PATCH 05/17] monitor: Fix do_info_balloon() output, Luiz Capitulino, 2009/12/04
- [Qemu-devel] [PATCH 06/17] monitor: Convert do_info_status() to QObject, Luiz Capitulino, 2009/12/04
- [Qemu-devel] [PATCH 07/17] monitor: Convert do_info_kvm() to QObject, Luiz Capitulino, 2009/12/04
- [Qemu-devel] [PATCH 08/17] monitor: Convert do_info_name() to QObject, Luiz Capitulino, 2009/12/04
- [Qemu-devel] [PATCH 09/17] monitor: Convert do_info_hpet() to QObject,
Luiz Capitulino <=
- [Qemu-devel] [PATCH 10/17] monitor: Convert do_info_uuid() to QObject, Luiz Capitulino, 2009/12/04
- [Qemu-devel] [PATCH 11/17] monitor: Convert do_info_mice() to QObject, Luiz Capitulino, 2009/12/04
- [Qemu-devel] [PATCH 12/17] migration: Convert do_info_migrate() to QObject, Luiz Capitulino, 2009/12/04
- [Qemu-devel] [PATCH 13/17] block: Convert bdrv_info() to QObject, Luiz Capitulino, 2009/12/04
- [Qemu-devel] [PATCH 14/17] block: Convert bdrv_info_stats() to QObject, Luiz Capitulino, 2009/12/04
- [Qemu-devel] [PATCH 15/17] char: Convert qemu_chr_info() to QObject, Luiz Capitulino, 2009/12/04
- [Qemu-devel] [PATCH 16/17] PCI: Convert pci_device_hot_add() to QObject, Luiz Capitulino, 2009/12/04
- [Qemu-devel] [PATCH 17/17] VNC: Convert do_info_vnc() to QObject, Luiz Capitulino, 2009/12/04