From: Gleb Natapov Date: Wed, 8 Dec 2010 11:34:59 +0000 (+0200) Subject: Add get_fw_dev_path callback to IDE bus. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=dc1a46b60941e137b3194936540790b720952055;p=qmiga%2Fqemu.git Add get_fw_dev_path callback to IDE bus. Signed-off-by: Gleb Natapov Signed-off-by: Blue Swirl --- diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c index 88ff6570b7..01a181bb45 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);