]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hmp: allow apic-id for "info lapic"
authorYi Wang <wang.yi59@zte.com.cn>
Wed, 26 Jul 2017 06:18:37 +0000 (02:18 -0400)
committerEduardo Habkost <ehabkost@redhat.com>
Fri, 1 Sep 2017 14:54:24 +0000 (11:54 -0300)
Add [apic-id] support for hmp command "info lapic", which is
useful when debugging ipi and so on. Current behavior is not
changed when the parameter isn't specified.

Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
Signed-off-by: Yun Liu <liu.yunh@zte.com.cn>
Message-Id: <1501049917-4701-3-git-send-email-wang.yi59@zte.com.cn>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
hmp-commands-info.hx
target/i386/monitor.c

index d9df238a5f47e2131ffd5466dc82c07f68c8caed..4ab7fcee98a94d261126ac357bbfd872dc67c328 100644 (file)
@@ -115,9 +115,10 @@ ETEXI
 #if defined(TARGET_I386)
     {
         .name       = "lapic",
-        .args_type  = "",
-        .params     = "",
-        .help       = "show local apic state",
+        .args_type  = "apic-id:i?",
+        .params     = "[apic-id]",
+        .help       = "show local apic state (apic-id: local apic to read, default is which of current CPU)",
+
         .cmd        = hmp_info_local_apic,
     },
 #endif
index 77ead604374a3fa945c52fe0ea1d8252f508770b..fe7d57b6aa6fdb086aa9b3a3d8aa78da77dbae2e 100644 (file)
@@ -632,7 +632,15 @@ const MonitorDef *target_monitor_defs(void)
 
 void hmp_info_local_apic(Monitor *mon, const QDict *qdict)
 {
-    CPUState *cs = mon_get_cpu();
+    CPUState *cs;
+
+    if (qdict_haskey(qdict, "apic-id")) {
+        int id = qdict_get_try_int(qdict, "apic-id", 0);
+        cs = cpu_by_arch_id(id);
+    } else {
+        cs = mon_get_cpu();
+    }
+
 
     if (!cs) {
         monitor_printf(mon, "No CPU available\n");