summary refs log tree commit diff stats
path: root/hw/qdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/qdev.c')
-rw-r--r--hw/qdev.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/hw/qdev.c b/hw/qdev.c
index 7f18590594..7b2802dee0 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -494,6 +494,22 @@ char* qdev_get_fw_dev_path(DeviceState *dev)
     return strdup(path);
 }
 
+char *qdev_get_dev_path(DeviceState *dev)
+{
+    BusInfo *businfo;
+
+    if (!dev || !dev->parent_bus) {
+        return NULL;
+    }
+
+    businfo = dev->parent_bus->info;
+    if (businfo->get_dev_path) {
+        return businfo->get_dev_path(dev);
+    }
+
+    return NULL;
+}
+
 /**
  * Legacy property handling
  */