]> Git Repo - qemu.git/commitdiff
hmp: add info iothreads command
authorTing Wang <[email protected]>
Fri, 26 Jun 2015 08:07:13 +0000 (16:07 +0800)
committerMarkus Armbruster <[email protected]>
Fri, 4 Sep 2015 11:26:26 +0000 (13:26 +0200)
Make "info iothreads" available on the HMP monitor.

For example, the results are as follows when executing qemu
command with "-object iothread,id=iothread-1 -object
iothread,id=iothread-2".
(qemu) info iothreads
iothread-1: thread_id=123
iothread-2: thread_id=456

Signed-off-by: Ting Wang <[email protected]>
Message-Id: <1435306033[email protected]>
Reviewed-by: Luiz Capitulino <[email protected]>
Reviewed-by: Amos Jianjun Kong <[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
hmp-commands.hx
hmp.c
hmp.h
monitor.c

index d6e81e4df35825bbc478ce8b221f1c543478f902..286dcc75aa65fca9ed199c9e8c3b3a9056b90667 100644 (file)
@@ -1809,6 +1809,8 @@ show the TPM device
 show the memory devices
 @item info skeys
 Display the value of a storage key (s390 only)
+@item info iothreads
+show iothreads
 @end table
 ETEXI
 
diff --git a/hmp.c b/hmp.c
index dcc66f159a2b5b6709909f4e0e0ceb7929c96d9f..3f807b75f16f166da49fe9d80b5b6de7c5ff8722 100644 (file)
--- a/hmp.c
+++ b/hmp.c
@@ -1963,6 +1963,19 @@ void hmp_info_memory_devices(Monitor *mon, const QDict *qdict)
     qapi_free_MemoryDeviceInfoList(info_list);
 }
 
+void hmp_info_iothreads(Monitor *mon, const QDict *qdict)
+{
+    IOThreadInfoList *info_list = qmp_query_iothreads(NULL);
+    IOThreadInfoList *info;
+
+    for (info = info_list; info; info = info->next) {
+        monitor_printf(mon, "%s: thread_id=%" PRId64 "\n",
+                       info->value->id, info->value->thread_id);
+    }
+
+    qapi_free_IOThreadInfoList(info_list);
+}
+
 void hmp_qom_list(Monitor *mon, const QDict *qdict)
 {
     const char *path = qdict_get_try_str(qdict, "path");
diff --git a/hmp.h b/hmp.h
index b8f5d336427868cef3d8c9c595e7ab1269ff17ae..81656c3d829e85584c0c7cb9ac7dd2e84cd6980e 100644 (file)
--- a/hmp.h
+++ b/hmp.h
@@ -39,6 +39,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_iothreads(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);
index b1f2a2979377160da0606134f53a5b1a141454be..5455ab9de0d8358b4f9ef54af7266d1f65de8d17 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -2853,6 +2853,13 @@ static mon_cmd_t info_cmds[] = {
         .help       = "show memory devices",
         .mhandler.cmd = hmp_info_memory_devices,
     },
+    {
+        .name       = "iothreads",
+        .args_type  = "",
+        .params     = "",
+        .help       = "show iothreads",
+        .mhandler.cmd = hmp_info_iothreads,
+    },
     {
         .name       = "rocker",
         .args_type  = "name:s",
This page took 0.041703 seconds and 4 git commands to generate.