[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v5 8/8] qemu-monitor: add HMP "info-bootindex" comma
From: |
arei.gonglei |
Subject: |
[Qemu-devel] [PATCH v5 8/8] qemu-monitor: add HMP "info-bootindex" command |
Date: |
Mon, 4 Aug 2014 20:46:22 +0800 |
From: Gonglei <address@hidden>
Add HMP info-bootindex command to getting
devcie's bootindex via monitor.
Signed-off-by: Gonglei <address@hidden>
Signed-off-by: Chenliang <address@hidden>
---
hmp-commands.hx | 2 ++
hmp.c | 20 ++++++++++++++++++++
hmp.h | 1 +
monitor.c | 7 +++++++
4 files changed, 30 insertions(+)
diff --git a/hmp-commands.hx b/hmp-commands.hx
index 31ef24e..bc1b982 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -1795,6 +1795,8 @@ show qdev device model list
show roms
@item info tpm
show the TPM device
address@hidden info bootindex
+show the current VM bootindex information
@end table
ETEXI
diff --git a/hmp.c b/hmp.c
index 95f7eeb..1688e02 100644
--- a/hmp.c
+++ b/hmp.c
@@ -725,6 +725,26 @@ void hmp_info_tpm(Monitor *mon, const QDict *qdict)
qapi_free_TPMInfoList(info_list);
}
+void hmp_info_bootindex(Monitor *mon, const QDict *qdict)
+{
+ BootindexInfoList *bootindex_list, *info;
+
+ bootindex_list = qmp_query_bootindex(NULL);
+ if (!bootindex_list) {
+ monitor_printf(mon, "No bootindex was configured\n");
+ return;
+ }
+
+ monitor_printf(mon, "id \t bootindex \t suffix\n");
+ for (info = bootindex_list; info; info = info->next) {
+ monitor_printf(mon, "\"%s\"\t %"PRId64"\t\"%s\"\n",
+ info->value->id, info->value->bootindex,
+ info->value->suffix);
+ }
+
+ qapi_free_BootindexInfoList(bootindex_list);
+}
+
void hmp_quit(Monitor *mon, const QDict *qdict)
{
monitor_suspend(mon);
diff --git a/hmp.h b/hmp.h
index eb2641a..5899537 100644
--- a/hmp.h
+++ b/hmp.h
@@ -38,6 +38,7 @@ void hmp_info_balloon(Monitor *mon, const QDict *qdict);
void hmp_info_pci(Monitor *mon, const QDict *qdict);
void hmp_info_block_jobs(Monitor *mon, const QDict *qdict);
void hmp_info_tpm(Monitor *mon, const QDict *qdict);
+void hmp_info_bootindex(Monitor *mon, const QDict *qdict);
void hmp_quit(Monitor *mon, const QDict *qdict);
void hmp_stop(Monitor *mon, const QDict *qdict);
void hmp_system_reset(Monitor *mon, const QDict *qdict);
diff --git a/monitor.c b/monitor.c
index 5bc70a6..8158ddb 100644
--- a/monitor.c
+++ b/monitor.c
@@ -2918,6 +2918,13 @@ static mon_cmd_t info_cmds[] = {
.mhandler.cmd = hmp_info_memdev,
},
{
+ .name = "bootindex",
+ .args_type = "",
+ .params = "",
+ .help = "show the current VM bootindex information",
+ .mhandler.cmd = hmp_info_bootindex,
+ },
+ {
.name = NULL,
},
};
--
1.7.12.4
- [Qemu-devel] [PATCH v5 0/8] modify boot order of guest, and take effect after rebooting, arei.gonglei, 2014/08/04
- [Qemu-devel] [PATCH v5 5/8] qmp: add set-bootindex command, arei.gonglei, 2014/08/04
- [Qemu-devel] [PATCH v5 2/8] bootindex: add del_boot_device_path function, arei.gonglei, 2014/08/04
- [Qemu-devel] [PATCH v5 4/8] bootindex: delete bootindex when device is removed, arei.gonglei, 2014/08/04
- [Qemu-devel] [PATCH v5 3/8] fw_cfg: add fw_cfg_machine_reset function, arei.gonglei, 2014/08/04
- [Qemu-devel] [PATCH v5 1/8] bootindex: add modify_boot_device_path function, arei.gonglei, 2014/08/04
- [Qemu-devel] [PATCH v5 7/8] qmp: add query-bootindex command, arei.gonglei, 2014/08/04
- [Qemu-devel] [PATCH v5 8/8] qemu-monitor: add HMP "info-bootindex" command,
arei.gonglei <=
- [Qemu-devel] [PATCH v5 6/8] qemu-monitor: HMP set-bootindex wrapper, arei.gonglei, 2014/08/04
- Re: [Qemu-devel] [PATCH v5 0/8] modify boot order of guest, and take effect after rebooting, Gonglei (Arei), 2014/08/04
- Re: [Qemu-devel] [PATCH v5 0/8] modify boot order of guest, and take effect after rebooting, Gonglei (Arei), 2014/08/07
- Re: [Qemu-devel] [PATCH v5 0/8] modify boot order of guest, and take effect after rebooting, Gerd Hoffmann, 2014/08/26