]> git.proxmox.com Git - qemu.git/blob - hmp.c
qapi: Convert query-kvm
[qemu.git] / hmp.c
1 /*
2 * Human Monitor Interface
3 *
4 * Copyright IBM, Corp. 2011
5 *
6 * Authors:
7 * Anthony Liguori <aliguori@us.ibm.com>
8 *
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
11 *
12 */
13
14 #include "hmp.h"
15 #include "qmp-commands.h"
16
17 void hmp_info_name(Monitor *mon)
18 {
19 NameInfo *info;
20
21 info = qmp_query_name(NULL);
22 if (info->has_name) {
23 monitor_printf(mon, "%s\n", info->name);
24 }
25 qapi_free_NameInfo(info);
26 }
27
28 void hmp_info_version(Monitor *mon)
29 {
30 VersionInfo *info;
31
32 info = qmp_query_version(NULL);
33
34 monitor_printf(mon, "%" PRId64 ".%" PRId64 ".%" PRId64 "%s\n",
35 info->qemu.major, info->qemu.minor, info->qemu.micro,
36 info->package);
37
38 qapi_free_VersionInfo(info);
39 }
40
41 void hmp_info_kvm(Monitor *mon)
42 {
43 KvmInfo *info;
44
45 info = qmp_query_kvm(NULL);
46 monitor_printf(mon, "kvm support: ");
47 if (info->present) {
48 monitor_printf(mon, "%s\n", info->enabled ? "enabled" : "disabled");
49 } else {
50 monitor_printf(mon, "not compiled\n");
51 }
52
53 qapi_free_KvmInfo(info);
54 }
55