summary refs log tree commit diff stats
path: root/hw/core/qdev.c
diff options
context:
space:
mode:
authorGonglei <arei.gonglei@huawei.com>2015-01-29 15:08:51 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2015-02-11 21:47:51 +0100
commit0be63901d2a33a6ed25caa5df3f530df75338f6a (patch)
tree646c8bc5c70c485cd6db1ab64f295c6875f6621c /hw/core/qdev.c
parentedecf5eced082cb45e213cb4e791b2fcf9f867c1 (diff)
downloadfocaccia-qemu-0be63901d2a33a6ed25caa5df3f530df75338f6a.tar.gz
focaccia-qemu-0be63901d2a33a6ed25caa5df3f530df75338f6a.zip
qdev: support to get a device firmware path directly
commit 6b1566c (qdev: Introduce FWPathProvider interface) did a
good job for supproting to get firmware path on some different
architectures.

Moreover further more, we can use the interface to get firmware
path name for a device which isn't attached a specific bus,
such as virtio-bus, scsi-bus etc.

When the device (such as vhost-scsi) realize the TYPE_FW_PATH_PROVIDER
interface, we should introduce a new function to get the correct firmware
path name for it.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/core/qdev.c')
-rw-r--r--hw/core/qdev.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 2eacac0787..44c6b93727 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -818,6 +818,13 @@ static char *qdev_get_fw_dev_path_from_handler(BusState *bus, DeviceState *dev)
     return d;
 }
 
+char *qdev_get_own_fw_dev_path_from_handler(BusState *bus, DeviceState *dev)
+{
+    Object *obj = OBJECT(dev);
+
+    return fw_path_provider_try_get_dev_path(obj, bus, dev);
+}
+
 static int qdev_get_fw_dev_path_helper(DeviceState *dev, char *p, int size)
 {
     int l = 0;