diff options
author | Gleb Natapov <gleb@redhat.com> | 2010-12-08 13:34:59 +0200 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2010-12-11 21:27:48 +0000 |
commit | dc1a46b60941e137b3194936540790b720952055 (patch) | |
tree | 7c58a85ede9afa570547db5b1689c4cb90e0a407 /hw | |
parent | 3835510f10ac74553ff19df3eb254809f0b593c0 (diff) | |
download | qemu-dc1a46b60941e137b3194936540790b720952055.zip qemu-dc1a46b60941e137b3194936540790b720952055.tar.gz qemu-dc1a46b60941e137b3194936540790b720952055.tar.bz2 |
Add get_fw_dev_path callback to IDE bus.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/ide/qdev.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c index 88ff657..01a181b 100644 --- a/hw/ide/qdev.c +++ b/hw/ide/qdev.c @@ -24,9 +24,12 @@ /* --------------------------------- */ +static char *idebus_get_fw_dev_path(DeviceState *dev); + static struct BusInfo ide_bus_info = { .name = "IDE", .size = sizeof(IDEBus), + .get_fw_dev_path = idebus_get_fw_dev_path, }; void ide_bus_new(IDEBus *idebus, DeviceState *dev, int bus_id) @@ -35,6 +38,16 @@ void ide_bus_new(IDEBus *idebus, DeviceState *dev, int bus_id) idebus->bus_id = bus_id; } +static char *idebus_get_fw_dev_path(DeviceState *dev) +{ + char path[30]; + + snprintf(path, sizeof(path), "%s@%d", qdev_fw_name(dev), + ((IDEBus*)dev->parent_bus)->bus_id); + + return strdup(path); +} + static int ide_qdev_init(DeviceState *qdev, DeviceInfo *base) { IDEDevice *dev = DO_UPCAST(IDEDevice, qdev, qdev); |