aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2018-09-25 15:49:25 +0100
committerPeter Maydell <peter.maydell@linaro.org>2018-09-25 15:49:25 +0100
commit0a736f7ab83df26dbe5421bb3d1f7892def05dee (patch)
tree6df73845d8291cf9c23cdfe4b48c1d3fa5e5a6f5
parent71fbecea0f725bc16aec32cf89cbf3aa78058826 (diff)
parent5383a705207790bbd82516b3665ba7d99522ce4a (diff)
downloadqemu-0a736f7ab83df26dbe5421bb3d1f7892def05dee.zip
qemu-0a736f7ab83df26dbe5421bb3d1f7892def05dee.tar.gz
qemu-0a736f7ab83df26dbe5421bb3d1f7892def05dee.tar.bz2
Merge remote-tracking branch 'remotes/dgilbert/tags/pull-hmp-20180925' into staging
HMP pull 2018-09-25 # gpg: Signature made Tue 25 Sep 2018 15:11:09 BST # gpg: using RSA key 0516331EBC5BFDE7 # gpg: Good signature from "Dr. David Alan Gilbert (RH2) <dgilbert@redhat.com>" # Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A 9FA9 0516 331E BC5B FDE7 * remotes/dgilbert/tags/pull-hmp-20180925: qmp, hmp: add PCI subsystem id and vendor id to PCI info hmp: fix migrate status timer leak monitor: print message when using 'help' with an unknown command Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--hmp.c3
-rw-r--r--hw/pci/pci.c3
-rw-r--r--monitor.c9
-rw-r--r--qapi/misc.json7
4 files changed, 20 insertions, 2 deletions
diff --git a/hmp.c b/hmp.c
index 4975fa5..80a95fc 100644
--- a/hmp.c
+++ b/hmp.c
@@ -824,6 +824,8 @@ static void hmp_info_pci_device(Monitor *mon, const PciDeviceInfo *dev)
monitor_printf(mon, ": PCI device %04" PRIx64 ":%04" PRIx64 "\n",
dev->id->vendor, dev->id->device);
+ monitor_printf(mon, " PCI subsystem %04" PRIx64 ":%04" PRIx64 "\n",
+ dev->id->subsystem_vendor, dev->id->subsystem);
if (dev->has_irq) {
monitor_printf(mon, " IRQ %" PRId64 ".\n", dev->irq);
@@ -2001,6 +2003,7 @@ static void hmp_migrate_status_cb(void *opaque)
}
monitor_resume(status->mon);
timer_del(status->timer);
+ timer_free(status->timer);
g_free(status);
}
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 80bc459..51d0dec 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -1737,6 +1737,9 @@ static PciDeviceInfo *qmp_query_pci_device(PCIDevice *dev, PCIBus *bus,
info->id = g_new0(PciDeviceId, 1);
info->id->vendor = pci_get_word(dev->config + PCI_VENDOR_ID);
info->id->device = pci_get_word(dev->config + PCI_DEVICE_ID);
+ info->id->subsystem = pci_get_word(dev->config + PCI_SUBSYSTEM_ID);
+ info->id->subsystem_vendor =
+ pci_get_word(dev->config + PCI_SUBSYSTEM_VENDOR_ID);
info->regions = qmp_query_pci_regions(dev);
info->qdev_id = g_strdup(dev->qdev.id ? dev->qdev.id : "");
diff --git a/monitor.c b/monitor.c
index 3b90c9e..c4677b5 100644
--- a/monitor.c
+++ b/monitor.c
@@ -952,6 +952,7 @@ static void help_cmd_dump(Monitor *mon, const mon_cmd_t *cmds,
char **args, int nb_args, int arg_index)
{
const mon_cmd_t *cmd;
+ size_t i;
/* No valid arg need to compare with, dump all in *cmds */
if (arg_index >= nb_args) {
@@ -973,9 +974,15 @@ static void help_cmd_dump(Monitor *mon, const mon_cmd_t *cmds,
} else {
help_cmd_dump_one(mon, cmd, args, arg_index);
}
- break;
+ return;
}
}
+
+ /* Command not found */
+ monitor_printf(mon, "unknown command: '");
+ for (i = 0; i <= arg_index; i++) {
+ monitor_printf(mon, "%s%s", args[i], i == arg_index ? "'\n" : " ");
+ }
}
static void help_cmd(Monitor *mon, const char *name)
diff --git a/qapi/misc.json b/qapi/misc.json
index d450cfe..ada9af5 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -832,10 +832,15 @@
#
# @vendor: the PCI vendor id
#
+# @subsystem: the PCI subsystem id (since 3.1)
+#
+# @subsystem-vendor: the PCI subsystem vendor id (since 3.1)
+#
# Since: 2.4
##
{ 'struct': 'PciDeviceId',
- 'data': {'device': 'int', 'vendor': 'int'} }
+ 'data': {'device': 'int', 'vendor': 'int', 'subsystem': 'int',
+ 'subsystem-vendor': 'int'} }
##
# @PciDeviceInfo: