diff options
author | Gleb Natapov <gleb@redhat.com> | 2010-12-08 13:34:54 +0200 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2010-12-11 21:27:44 +0000 |
commit | 779206de677533616ec3558bae89ea06fb91fc84 (patch) | |
tree | f85efe1ffc71bf96366aa486aace956a7cc2bb6a | |
parent | 1b3cba6e91ab55a158e49bc5398fd76e67c695a8 (diff) | |
download | qemu-779206de677533616ec3558bae89ea06fb91fc84.tar.gz qemu-779206de677533616ec3558bae89ea06fb91fc84.tar.bz2 qemu-779206de677533616ec3558bae89ea06fb91fc84.zip |
Introduce fw_name field to DeviceInfo structure.
Add "fw_name" to DeviceInfo to use in device path building. In
contrast to "name" "fw_name" should refer to functionality device
provides instead of particular device model like "name" does.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
-rw-r--r-- | hw/fdc.c | 1 | ||||
-rw-r--r-- | hw/ide/isa.c | 1 | ||||
-rw-r--r-- | hw/ide/qdev.c | 1 | ||||
-rw-r--r-- | hw/isa-bus.c | 1 | ||||
-rw-r--r-- | hw/lance.c | 1 | ||||
-rw-r--r-- | hw/piix_pci.c | 1 | ||||
-rw-r--r-- | hw/qdev.h | 6 | ||||
-rw-r--r-- | hw/scsi-disk.c | 1 | ||||
-rw-r--r-- | hw/usb-hub.c | 1 | ||||
-rw-r--r-- | hw/usb-net.c | 1 | ||||
-rw-r--r-- | hw/virtio-pci.c | 1 |
11 files changed, 16 insertions, 0 deletions
@@ -2042,6 +2042,7 @@ static const VMStateDescription vmstate_isa_fdc ={ static ISADeviceInfo isa_fdc_info = { .init = isabus_fdc_init1, .qdev.name = "isa-fdc", + .qdev.fw_name = "fdc", .qdev.size = sizeof(FDCtrlISABus), .qdev.no_user = 1, .qdev.vmsd = &vmstate_isa_fdc, diff --git a/hw/ide/isa.c b/hw/ide/isa.c index 6b57e0d301..98564356d4 100644 --- a/hw/ide/isa.c +++ b/hw/ide/isa.c @@ -98,6 +98,7 @@ ISADevice *isa_ide_init(int iobase, int iobase2, int isairq, static ISADeviceInfo isa_ide_info = { .qdev.name = "isa-ide", + .qdev.fw_name = "ide", .qdev.size = sizeof(ISAIDEState), .init = isa_ide_initfn, .qdev.reset = isa_ide_reset, diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c index 080876035f..6d27b60740 100644 --- a/hw/ide/qdev.c +++ b/hw/ide/qdev.c @@ -134,6 +134,7 @@ static int ide_drive_initfn(IDEDevice *dev) static IDEDeviceInfo ide_drive_info = { .qdev.name = "ide-drive", + .qdev.fw_name = "drive", .qdev.size = sizeof(IDEDrive), .init = ide_drive_initfn, .qdev.props = (Property[]) { diff --git a/hw/isa-bus.c b/hw/isa-bus.c index 3a6c961343..f9c7ec098f 100644 --- a/hw/isa-bus.c +++ b/hw/isa-bus.c @@ -150,6 +150,7 @@ static int isabus_bridge_init(SysBusDevice *dev) static SysBusDeviceInfo isabus_bridge_info = { .init = isabus_bridge_init, .qdev.name = "isabus-bridge", + .qdev.fw_name = "isa", .qdev.size = sizeof(SysBusDevice), .qdev.no_user = 1, }; diff --git a/hw/lance.c b/hw/lance.c index 8c5185817b..ddb1cbb7a4 100644 --- a/hw/lance.c +++ b/hw/lance.c @@ -142,6 +142,7 @@ static void lance_reset(DeviceState *dev) static SysBusDeviceInfo lance_info = { .init = lance_init, .qdev.name = "lance", + .qdev.fw_name = "ethernet", .qdev.size = sizeof(SysBusPCNetState), .qdev.reset = lance_reset, .qdev.vmsd = &vmstate_lance, diff --git a/hw/piix_pci.c b/hw/piix_pci.c index b5589b9035..38f9d9eea4 100644 --- a/hw/piix_pci.c +++ b/hw/piix_pci.c @@ -365,6 +365,7 @@ static PCIDeviceInfo i440fx_info[] = { static SysBusDeviceInfo i440fx_pcihost_info = { .init = i440fx_pcihost_initfn, .qdev.name = "i440FX-pcihost", + .qdev.fw_name = "pci", .qdev.size = sizeof(I440FXState), .qdev.no_user = 1, }; @@ -141,6 +141,7 @@ typedef void (*qdev_resetfn)(DeviceState *dev); struct DeviceInfo { const char *name; + const char *fw_name; const char *alias; const char *desc; size_t size; @@ -306,6 +307,11 @@ void qdev_prop_set_defaults(DeviceState *dev, Property *props); void qdev_prop_register_global_list(GlobalProperty *props); void qdev_prop_set_globals(DeviceState *dev); +static inline const char *qdev_fw_name(DeviceState *dev) +{ + return dev->info->fw_name ? : dev->info->alias ? : dev->info->name; +} + /* This is a nasty hack to allow passing a NULL bus to qdev_create. */ extern struct BusInfo system_bus_info; diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index 6e49404d87..851046fd55 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -1230,6 +1230,7 @@ static int scsi_disk_initfn(SCSIDevice *dev) static SCSIDeviceInfo scsi_disk_info = { .qdev.name = "scsi-disk", + .qdev.fw_name = "disk", .qdev.desc = "virtual scsi disk or cdrom", .qdev.size = sizeof(SCSIDiskState), .qdev.reset = scsi_disk_reset, diff --git a/hw/usb-hub.c b/hw/usb-hub.c index 2a1edfc956..8e3a96b816 100644 --- a/hw/usb-hub.c +++ b/hw/usb-hub.c @@ -545,6 +545,7 @@ static int usb_hub_initfn(USBDevice *dev) static struct USBDeviceInfo hub_info = { .product_desc = "QEMU USB Hub", .qdev.name = "usb-hub", + .qdev.fw_name = "hub", .qdev.size = sizeof(USBHubState), .init = usb_hub_initfn, .handle_packet = usb_hub_handle_packet, diff --git a/hw/usb-net.c b/hw/usb-net.c index 58c672f426..f6bed2184e 100644 --- a/hw/usb-net.c +++ b/hw/usb-net.c @@ -1496,6 +1496,7 @@ static USBDevice *usb_net_init(const char *cmdline) static struct USBDeviceInfo net_info = { .product_desc = "QEMU USB Network Interface", .qdev.name = "usb-net", + .qdev.fw_name = "network", .qdev.size = sizeof(USBNetState), .init = usb_net_initfn, .handle_packet = usb_generic_handle_packet, diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index c65765a273..6186142b2b 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -699,6 +699,7 @@ static int virtio_9p_init_pci(PCIDevice *pci_dev) static PCIDeviceInfo virtio_info[] = { { .qdev.name = "virtio-blk-pci", + .qdev.alias = "virtio-blk", .qdev.size = sizeof(VirtIOPCIProxy), .init = virtio_blk_init_pci, .exit = virtio_blk_exit_pci, |