Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/dgilbert/tags/pull-hmp-20180925…
Browse files Browse the repository at this point in the history
…' 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>
  • Loading branch information
pm215 committed Sep 25, 2018
2 parents 71fbece + 5383a70 commit 0a736f7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
3 changes: 3 additions & 0 deletions hmp.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}

Expand Down
3 changes: 3 additions & 0 deletions hw/pci/pci.c
Expand Up @@ -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 : "");

Expand Down
9 changes: 8 additions & 1 deletion monitor.c
Expand Up @@ -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) {
Expand All @@ -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)
Expand Down
7 changes: 6 additions & 1 deletion qapi/misc.json
Expand Up @@ -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:
Expand Down

0 comments on commit 0a736f7

Please sign in to comment.