mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
qdev: don't access name through info
We already have a QOM interface for this so let's use it. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
30fbb9fc7c
commit
f79f2bfc6a
28 changed files with 44 additions and 44 deletions
6
hw/pci.c
6
hw/pci.c
|
@ -1493,7 +1493,7 @@ static int pci_qdev_init(DeviceState *qdev, DeviceInfo *base)
|
|||
if (pci_dev == NULL)
|
||||
return -1;
|
||||
if (qdev->hotplugged && info->no_hotplug) {
|
||||
qerror_report(QERR_DEVICE_NO_HOTPLUG, info->qdev.name);
|
||||
qerror_report(QERR_DEVICE_NO_HOTPLUG, object_get_typename(OBJECT(pci_dev)));
|
||||
do_pci_unregister_device(pci_dev);
|
||||
return -1;
|
||||
}
|
||||
|
@ -1534,7 +1534,7 @@ static int pci_unplug_device(DeviceState *qdev)
|
|||
PCIDeviceInfo *info = container_of(qdev_get_info(qdev), PCIDeviceInfo, qdev);
|
||||
|
||||
if (info->no_hotplug) {
|
||||
qerror_report(QERR_DEVICE_NO_HOTPLUG, info->qdev.name);
|
||||
qerror_report(QERR_DEVICE_NO_HOTPLUG, object_get_typename(OBJECT(dev)));
|
||||
return -1;
|
||||
}
|
||||
return dev->bus->hotplug(dev->bus->hotplug_qdev, dev,
|
||||
|
@ -1742,7 +1742,7 @@ static int pci_add_option_rom(PCIDevice *pdev, bool is_default_rom)
|
|||
if (qdev_get_info(&pdev->qdev)->vmsd)
|
||||
snprintf(name, sizeof(name), "%s.rom", qdev_get_info(&pdev->qdev)->vmsd->name);
|
||||
else
|
||||
snprintf(name, sizeof(name), "%s.rom", qdev_get_info(&pdev->qdev)->name);
|
||||
snprintf(name, sizeof(name), "%s.rom", object_get_typename(OBJECT(pdev)));
|
||||
pdev->has_rom = true;
|
||||
memory_region_init_ram(&pdev->rom, name, size);
|
||||
vmstate_register_ram(&pdev->rom, &pdev->qdev);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue