2 * Human Monitor Interface
4 * Copyright IBM, Corp. 2011
7 * Anthony Liguori <aliguori@us.ibm.com>
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
15 #include "qmp-commands.h"
17 void hmp_info_name(Monitor
*mon
)
21 info
= qmp_query_name(NULL
);
23 monitor_printf(mon
, "%s\n", info
->name
);
25 qapi_free_NameInfo(info
);
28 void hmp_info_version(Monitor
*mon
)
32 info
= qmp_query_version(NULL
);
34 monitor_printf(mon
, "%" PRId64
".%" PRId64
".%" PRId64
"%s\n",
35 info
->qemu
.major
, info
->qemu
.minor
, info
->qemu
.micro
,
38 qapi_free_VersionInfo(info
);
41 void hmp_info_kvm(Monitor
*mon
)
45 info
= qmp_query_kvm(NULL
);
46 monitor_printf(mon
, "kvm support: ");
48 monitor_printf(mon
, "%s\n", info
->enabled
? "enabled" : "disabled");
50 monitor_printf(mon
, "not compiled\n");
53 qapi_free_KvmInfo(info
);
56 void hmp_info_status(Monitor
*mon
)
60 info
= qmp_query_status(NULL
);
62 monitor_printf(mon
, "VM status: %s%s",
63 info
->running
? "running" : "paused",
64 info
->singlestep
? " (single step mode)" : "");
66 if (!info
->running
&& info
->status
!= RUN_STATE_PAUSED
) {
67 monitor_printf(mon
, " (%s)", RunState_lookup
[info
->status
]);
70 monitor_printf(mon
, "\n");
72 qapi_free_StatusInfo(info
);
75 void hmp_info_uuid(Monitor
*mon
)
79 info
= qmp_query_uuid(NULL
);
80 monitor_printf(mon
, "%s\n", info
->UUID
);
81 qapi_free_UuidInfo(info
);
84 void hmp_info_chardev(Monitor
*mon
)
86 ChardevInfoList
*char_info
, *info
;
88 char_info
= qmp_query_chardev(NULL
);
89 for (info
= char_info
; info
; info
= info
->next
) {
90 monitor_printf(mon
, "%s: filename=%s\n", info
->value
->label
,
91 info
->value
->filename
);
94 qapi_free_ChardevInfoList(char_info
);