Rename 'class' member in class_info of PciDeviceInfo to 'dev_class', and add some casts to avoid errors from c++ compiler.
Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama...@hitachi.com> --- hmp.c | 2 +- hw/pci/pci.c | 2 +- qapi-schema.json | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hmp.c b/hmp.c index 1689e6f..a889c89 100644 --- a/hmp.c +++ b/hmp.c @@ -482,7 +482,7 @@ static void hmp_info_pci_device(Monitor *mon, const PciDeviceInfo *dev) if (dev->class_info.has_desc) { monitor_printf(mon, "%s", dev->class_info.desc); } else { - monitor_printf(mon, "Class %04" PRId64, dev->class_info.class); + monitor_printf(mon, "Class %04" PRId64, dev->class_info.dev_class); } monitor_printf(mon, ": PCI device %04" PRIx64 ":%04" PRIx64 "\n", diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 905dc4a..2ca0675 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -1385,7 +1385,7 @@ static PciDeviceInfo *qmp_query_pci_device(PCIDevice *dev, PCIBus *bus, info->function = PCI_FUNC(dev->devfn); class = pci_get_word(dev->config + PCI_CLASS_DEVICE); - info->class_info.class = class; + info->class_info.dev_class = class; desc = get_class_desc(class); if (desc->desc) { info->class_info.has_desc = true; diff --git a/qapi-schema.json b/qapi-schema.json index cdd8384..413df5c 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -1150,7 +1150,7 @@ # # @class_info.desc: #optional a string description of the device's class # -# @class_info.class: the class code of the device +# @class_info.dev_class: the class code of the device # # @id.device: the PCI device id # @@ -1171,7 +1171,7 @@ ## { 'type': 'PciDeviceInfo', 'data': {'bus': 'int', 'slot': 'int', 'function': 'int', - 'class_info': {'*desc': 'str', 'class': 'int'}, + 'class_info': {'*desc': 'str', 'dev_class': 'int'}, 'id': {'device': 'int', 'vendor': 'int'}, '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo', 'regions': ['PciMemoryRegion']} }