We will need this function in near future so that we know what
/dev device corresponds to the USB device.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/libvirt_private.syms | 1 +
src/util/virusb.c | 5 +++++
src/util/virusb.h | 1 +
3 files changed, 7 insertions(+)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 5f560bf..8a172c3 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -2602,6 +2602,7 @@ virUSBDeviceFree;
virUSBDeviceGetBus;
virUSBDeviceGetDevno;
virUSBDeviceGetName;
+virUSBDeviceGetPath;
virUSBDeviceGetUsedBy;
virUSBDeviceListAdd;
virUSBDeviceListCount;
diff --git a/src/util/virusb.c b/src/util/virusb.c
index 6a001a7..8cd2f57 100644
--- a/src/util/virusb.c
+++ b/src/util/virusb.c
@@ -406,6 +406,11 @@ const char *virUSBDeviceGetName(virUSBDevicePtr dev)
return dev->name;
}
+const char *virUSBDeviceGetPath(virUSBDevicePtr dev)
+{
+ return dev->path;
+}
+
unsigned int virUSBDeviceGetBus(virUSBDevicePtr dev)
{
return dev->bus;
diff --git a/src/util/virusb.h b/src/util/virusb.h
index f98ea21..716e8c6 100644
--- a/src/util/virusb.h
+++ b/src/util/virusb.h
@@ -67,6 +67,7 @@ void virUSBDeviceGetUsedBy(virUSBDevicePtr dev,
const char **drv_name,
const char **dom_name);
const char *virUSBDeviceGetName(virUSBDevicePtr dev);
+const char *virUSBDeviceGetPath(virUSBDevicePtr usb);
unsigned int virUSBDeviceGetBus(virUSBDevicePtr dev);
unsigned int virUSBDeviceGetDevno(virUSBDevicePtr dev);
--
2.8.4