@@ -1780,6 +1780,8 @@ show qdev device model list
show roms
@item info tpm
show the TPM device
+@item info qdev_devices
+show the qdevified devices registered with migration capability
@end table
ETEXI
@@ -1714,3 +1714,24 @@ void hmp_info_memdev(Monitor *mon, const QDict *qdict)
monitor_printf(mon, "\n");
}
+
+void hmp_info_qdev_devices(Monitor *mon, const QDict *qdict)
+{
+ Error *err = NULL;
+ VMStatesQdevDevices *qdev_devices = qmp_query_qdev_devices(&err);
+ strList *list = NULL;
+
+ if (qdev_devices) {
+ list = qdev_devices->device;
+ while (list) {
+ monitor_printf(mon, "%s\n", list->value);
+ list = list->next;
+ }
+ }
+
+ if (err) {
+ hmp_handle_error(mon, &err);
+ }
+
+ qapi_free_strList(list);
+}
@@ -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_qdev_devices(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);
@@ -2918,6 +2918,13 @@ static mon_cmd_t info_cmds[] = {
.mhandler.cmd = hmp_info_memdev,
},
{
+ .name = "qdev_devices",
+ .args_type = "",
+ .params = "",
+ .help = "show registered qdevified devices",
+ .mhandler.cmd = hmp_info_qdev_devices,
+ },
+ {
.name = NULL,
},
};
This patch provides the hmp interface for qdevified devices list. Signed-off-by: Sanidhya Kashyap <sanidhya.iiith@gmail.com> --- hmp-commands.hx | 2 ++ hmp.c | 21 +++++++++++++++++++++ hmp.h | 1 + monitor.c | 7 +++++++ 4 files changed, 31 insertions(+)