[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH v2 10/13] Rename all USB device functions to have a standard name prefix



From: "Daniel P. Berrange" <berrange redhat com>

Rename all the usbDeviceXXX and usbXXXDevice APIs to have a
fixed virUSBDevice name prefix
---
 src/libvirt_private.syms         |  38 +++----
 src/lxc/lxc_cgroup.c             |  17 ++--
 src/lxc/lxc_cgroup.h             |   4 +-
 src/lxc/lxc_conf.h               |   2 +-
 src/lxc/lxc_driver.c             |  22 ++--
 src/lxc/lxc_hostdev.c            | 112 ++++++++++-----------
 src/lxc/lxc_hostdev.h            |   4 +-
 src/qemu/qemu_cgroup.c           |  14 +--
 src/qemu/qemu_cgroup.h           |   2 +-
 src/qemu/qemu_conf.h             |   2 +-
 src/qemu/qemu_driver.c           |   4 +-
 src/qemu/qemu_hostdev.c          | 104 +++++++++----------
 src/qemu/qemu_hostdev.h          |   4 +-
 src/qemu/qemu_hotplug.c          |  32 +++---
 src/security/security_apparmor.c |  13 +--
 src/security/security_dac.c      |  34 +++----
 src/security/security_selinux.c  |  28 +++---
 src/security/virt-aa-helper.c    |  13 +--
 src/util/virusb.c                | 210 +++++++++++++++++++--------------------
 src/util/virusb.h                |  92 ++++++++---------
 20 files changed, 378 insertions(+), 373 deletions(-)

diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index dc9de46..e4d3605 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1218,25 +1218,25 @@ virThreadSelfID;
 
 
 # usb.h
-usbDeviceFileIterate;
-usbDeviceGetBus;
-usbDeviceGetDevno;
-usbDeviceGetName;
-usbDeviceGetUsedBy;
-usbDeviceListAdd;
-usbDeviceListCount;
-usbDeviceListDel;
-usbDeviceListFind;
-usbDeviceListFree;
-usbDeviceListGet;
-usbDeviceListNew;
-usbDeviceListSteal;
-usbDeviceSetUsedBy;
-usbFindDevice;
-usbFindDeviceByBus;
-usbFindDeviceByVendor;
-usbFreeDevice;
-usbGetDevice;
+virUSBDeviceFileIterate;
+virUSBDeviceFind;
+virUSBDeviceFindByBus;
+virUSBDeviceFindByVendor;
+virUSBDeviceFree;
+virUSBDeviceGetBus;
+virUSBDeviceGetDevno;
+virUSBDeviceGetName;
+virUSBDeviceGetUsedBy;
+virUSBDeviceNew;
+virUSBDeviceListAdd;
+virUSBDeviceListCount;
+virUSBDeviceListDel;
+virUSBDeviceListFind;
+virUSBDeviceListFree;
+virUSBDeviceListGet;
+virUSBDeviceListNew;
+virUSBDeviceListSteal;
+virUSBDeviceSetUsedBy;
 
 
 # util.h
diff --git a/src/lxc/lxc_cgroup.c b/src/lxc/lxc_cgroup.c
index 1984c5f..c382635 100644
--- a/src/lxc/lxc_cgroup.c
+++ b/src/lxc/lxc_cgroup.c
@@ -292,7 +292,7 @@ struct _virLXCCgroupDevicePolicy {
 
 
 int
-virLXCSetupHostUsbDeviceCgroup(usbDevice *dev ATTRIBUTE_UNUSED,
+virLXCSetupHostUsbDeviceCgroup(virUSBDevicePtr dev ATTRIBUTE_UNUSED,
                                const char *path,
                                void *opaque)
 {
@@ -314,7 +314,7 @@ virLXCSetupHostUsbDeviceCgroup(usbDevice *dev ATTRIBUTE_UNUSED,
 
 
 int
-virLXCTeardownHostUsbDeviceCgroup(usbDevice *dev ATTRIBUTE_UNUSED,
+virLXCTeardownHostUsbDeviceCgroup(virUSBDevicePtr dev ATTRIBUTE_UNUSED,
                                   const char *path,
                                   void *opaque)
 {
@@ -412,7 +412,7 @@ static int virLXCCgroupSetupDeviceACL(virDomainDefPtr def,
 
     for (i = 0; i < def->nhostdevs; i++) {
         virDomainHostdevDefPtr hostdev = def->hostdevs[i];
-        usbDevice *usb;
+        virUSBDevicePtr usb;
 
         switch (hostdev->mode) {
         case VIR_DOMAIN_HOSTDEV_MODE_SUBSYS:
@@ -421,14 +421,15 @@ static int virLXCCgroupSetupDeviceACL(virDomainDefPtr def,
             if (hostdev->missing)
                 continue;
 
-            if ((usb = usbGetDevice(hostdev->source.subsys.u.usb.bus,
-                                    hostdev->source.subsys.u.usb.device,
-                                    NULL)) == NULL)
+            if ((usb = virUSBDeviceNew(hostdev->source.subsys.u.usb.bus,
+                                       hostdev->source.subsys.u.usb.device,
+                                       NULL)) == NULL)
                 goto cleanup;
 
-            if (usbDeviceFileIterate(usb, virLXCSetupHostUsbDeviceCgroup,
-                                     cgroup) < 0)
+            if (virUSBDeviceFileIterate(usb, virLXCSetupHostUsbDeviceCgroup,
+                                        cgroup) < 0)
                 goto cleanup;
+            virUSBDeviceFree(usb);
             break;
         case VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES:
             switch (hostdev->source.caps.type) {
diff --git a/src/lxc/lxc_cgroup.h b/src/lxc/lxc_cgroup.h
index 97b94e5..fff554b 100644
--- a/src/lxc/lxc_cgroup.h
+++ b/src/lxc/lxc_cgroup.h
@@ -30,12 +30,12 @@ int virLXCCgroupSetup(virDomainDefPtr def);
 int virLXCCgroupGetMeminfo(virLXCMeminfoPtr meminfo);
 
 int
-virLXCSetupHostUsbDeviceCgroup(usbDevice *dev,
+virLXCSetupHostUsbDeviceCgroup(virUSBDevicePtr dev,
                                const char *path,
                                void *opaque);
 
 int
-virLXCTeardownHostUsbDeviceCgroup(usbDevice *dev,
+virLXCTeardownHostUsbDeviceCgroup(virUSBDevicePtr dev,
                                   const char *path,
                                   void *opaque);
 
diff --git a/src/lxc/lxc_conf.h b/src/lxc/lxc_conf.h
index a6c111e..2649cd6 100644
--- a/src/lxc/lxc_conf.h
+++ b/src/lxc/lxc_conf.h
@@ -66,7 +66,7 @@ struct _virLXCDriver {
     int log_libvirtd;
     int have_netns;
 
-    usbDeviceList *activeUsbHostdevs;
+    virUSBDeviceListPtr activeUsbHostdevs;
 
     virDomainEventStatePtr domainEventState;
 
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index f7ca70d..5084bc9 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -3370,7 +3370,7 @@ lxcDomainAttachDeviceHostdevSubsysUSBLive(virLXCDriverPtr driver,
     struct stat sb;
     mode_t mode;
     bool created = false;
-    usbDevice *usb = NULL;
+    virUSBDevicePtr usb = NULL;
     virCgroupPtr group = NULL;
 
     if (virDomainHostdevFind(vm->def, def, NULL) >= 0) {
@@ -3418,8 +3418,8 @@ lxcDomainAttachDeviceHostdevSubsysUSBLive(virLXCDriverPtr driver,
         goto cleanup;
     }
 
-    if (!(usb = usbGetDevice(def->source.subsys.u.usb.bus,
-                             def->source.subsys.u.usb.device, vroot)))
+    if (!(usb = virUSBDeviceNew(def->source.subsys.u.usb.bus,
+                                def->source.subsys.u.usb.device, vroot)))
         goto cleanup;
 
     if (stat(src, &sb) < 0) {
@@ -3457,7 +3457,7 @@ lxcDomainAttachDeviceHostdevSubsysUSBLive(virLXCDriverPtr driver,
                                           vm->def, def, vroot) < 0)
         goto cleanup;
 
-    if (usbDeviceFileIterate(usb,
+    if (virUSBDeviceFileIterate(usb,
                              virLXCSetupHostUsbDeviceCgroup,
                              &group) < 0)
         goto cleanup;
@@ -3469,7 +3469,7 @@ cleanup:
     if (ret < 0 && created)
         unlink(dstfile);
 
-    usbFreeDevice(usb);
+    virUSBDeviceFree(usb);
     virCgroupFree(&group);
     VIR_FREE(src);
     VIR_FREE(dstfile);
@@ -3960,7 +3960,7 @@ lxcDomainDetachDeviceHostdevUSBLive(virLXCDriverPtr driver,
     int idx, ret = -1;
     char *dst;
     char *vroot;
-    usbDevice *usb = NULL;
+    virUSBDevicePtr usb = NULL;
 
     if ((idx = virDomainHostdevFind(vm->def,
                                     dev->data.hostdev,
@@ -3996,8 +3996,8 @@ lxcDomainDetachDeviceHostdevUSBLive(virLXCDriverPtr driver,
         goto cleanup;
     }
 
-    if (!(usb = usbGetDevice(def->source.subsys.u.usb.bus,
-                             def->source.subsys.u.usb.device, vroot)))
+    if (!(usb = virUSBDeviceNew(def->source.subsys.u.usb.bus,
+                                def->source.subsys.u.usb.device, vroot)))
         goto cleanup;
 
     VIR_DEBUG("Unlinking %s", dst);
@@ -4009,13 +4009,13 @@ lxcDomainDetachDeviceHostdevUSBLive(virLXCDriverPtr driver,
     }
     virDomainAuditHostdev(vm, def, "detach", true);
 
-    if (usbDeviceFileIterate(usb,
+    if (virUSBDeviceFileIterate(usb,
                              virLXCTeardownHostUsbDeviceCgroup,
                              &group) < 0)
         VIR_WARN("cannot deny device %s for domain %s",
                  dst, vm->def->name);
 
-    usbDeviceListDel(driver->activeUsbHostdevs, usb);
+    virUSBDeviceListDel(driver->activeUsbHostdevs, usb);
 
     virDomainHostdevRemove(vm->def, idx);
     virDomainHostdevDefFree(def);
@@ -4023,7 +4023,7 @@ lxcDomainDetachDeviceHostdevUSBLive(virLXCDriverPtr driver,
     ret = 0;
 
 cleanup:
-    usbFreeDevice(usb);
+    virUSBDeviceFree(usb);
     VIR_FREE(dst);
     virCgroupFree(&group);
     return ret;
diff --git a/src/lxc/lxc_hostdev.c b/src/lxc/lxc_hostdev.c
index 4fa0508..a627714 100644
--- a/src/lxc/lxc_hostdev.c
+++ b/src/lxc/lxc_hostdev.c
@@ -41,7 +41,7 @@ virLXCUpdateActiveUsbHostdevs(virLXCDriverPtr driver,
         return 0;
 
     for (i = 0; i < def->nhostdevs; i++) {
-        usbDevice *usb = NULL;
+        virUSBDevicePtr usb = NULL;
         hostdev = def->hostdevs[i];
 
         if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS)
@@ -49,9 +49,9 @@ virLXCUpdateActiveUsbHostdevs(virLXCDriverPtr driver,
         if (hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB)
             continue;
 
-        usb = usbGetDevice(hostdev->source.subsys.u.usb.bus,
-                           hostdev->source.subsys.u.usb.device,
-                           NULL);
+        usb = virUSBDeviceNew(hostdev->source.subsys.u.usb.bus,
+                              hostdev->source.subsys.u.usb.device,
+                              NULL);
         if (!usb) {
             VIR_WARN("Unable to reattach USB device %03d.%03d on domain %s",
                      hostdev->source.subsys.u.usb.bus,
@@ -60,10 +60,10 @@ virLXCUpdateActiveUsbHostdevs(virLXCDriverPtr driver,
             continue;
         }
 
-        usbDeviceSetUsedBy(usb, def->name);
+        virUSBDeviceSetUsedBy(usb, def->name);
 
-        if (usbDeviceListAdd(driver->activeUsbHostdevs, usb) < 0) {
-            usbFreeDevice(usb);
+        if (virUSBDeviceListAdd(driver->activeUsbHostdevs, usb) < 0) {
+            virUSBDeviceFree(usb);
             return -1;
         }
     }
@@ -75,47 +75,47 @@ virLXCUpdateActiveUsbHostdevs(virLXCDriverPtr driver,
 int
 virLXCPrepareHostdevUSBDevices(virLXCDriverPtr driver,
                                const char *name,
-                               usbDeviceList *list)
+                               virUSBDeviceList *list)
 {
     size_t i, j;
     unsigned int count;
-    usbDevice *tmp;
+    virUSBDevicePtr tmp;
 
-    count = usbDeviceListCount(list);
+    count = virUSBDeviceListCount(list);
 
     for (i = 0; i < count; i++) {
-        usbDevice *usb = usbDeviceListGet(list, i);
-        if ((tmp = usbDeviceListFind(driver->activeUsbHostdevs, usb))) {
-            const char *other_name = usbDeviceGetUsedBy(tmp);
+        virUSBDevicePtr usb = virUSBDeviceListGet(list, i);
+        if ((tmp = virUSBDeviceListFind(driver->activeUsbHostdevs, usb))) {
+            const char *other_name = virUSBDeviceGetUsedBy(tmp);
 
             if (other_name)
                 virReportError(VIR_ERR_OPERATION_INVALID,
                                _("USB device %s is in use by domain %s"),
-                               usbDeviceGetName(tmp), other_name);
+                               virUSBDeviceGetName(tmp), other_name);
             else
                 virReportError(VIR_ERR_OPERATION_INVALID,
                                _("USB device %s is already in use"),
-                               usbDeviceGetName(tmp));
+                               virUSBDeviceGetName(tmp));
             goto error;
         }
 
-        usbDeviceSetUsedBy(usb, name);
+        virUSBDeviceSetUsedBy(usb, name);
         VIR_DEBUG("Adding %03d.%03d dom=%s to activeUsbHostdevs",
-                  usbDeviceGetBus(usb), usbDeviceGetDevno(usb), name);
+                  virUSBDeviceGetBus(usb), virUSBDeviceGetDevno(usb), name);
         /*
          * The caller is responsible to steal these usb devices
-         * from the usbDeviceList that passed in on success,
+         * from the virUSBDeviceList that passed in on success,
          * perform rollback on failure.
          */
-        if (usbDeviceListAdd(driver->activeUsbHostdevs, usb) < 0)
+        if (virUSBDeviceListAdd(driver->activeUsbHostdevs, usb) < 0)
             goto error;
     }
     return 0;
 
 error:
     for (j = 0; j < i; j++) {
-        tmp = usbDeviceListGet(list, i);
-        usbDeviceListSteal(driver->activeUsbHostdevs, tmp);
+        tmp = virUSBDeviceListGet(list, i);
+        virUSBDeviceListSteal(driver->activeUsbHostdevs, tmp);
     }
     return -1;
 }
@@ -123,7 +123,7 @@ error:
 int
 virLXCFindHostdevUSBDevice(virDomainHostdevDefPtr hostdev,
                            bool mandatory,
-                           usbDevice **usb)
+                           virUSBDevicePtr *usb)
 {
     unsigned vendor = hostdev->source.subsys.u.usb.vendor;
     unsigned product = hostdev->source.subsys.u.usb.product;
@@ -135,10 +135,10 @@ virLXCFindHostdevUSBDevice(virDomainHostdevDefPtr hostdev,
     *usb = NULL;
 
     if (vendor && bus) {
-        rc = usbFindDevice(vendor, product, bus, device,
-                           NULL,
-                           autoAddress ? false : mandatory,
-                           usb);
+        rc = virUSBDeviceFind(vendor, product, bus, device,
+                              NULL,
+                              autoAddress ? false : mandatory,
+                              usb);
         if (rc < 0) {
             return -1;
         } else if (!autoAddress) {
@@ -155,19 +155,19 @@ virLXCFindHostdevUSBDevice(virDomainHostdevDefPtr hostdev,
      * automatically found before.
      */
     if (vendor) {
-        usbDeviceList *devs;
+        virUSBDeviceList *devs;
 
-        rc = usbFindDeviceByVendor(vendor, product,
-                                   NULL,
-                                   mandatory, &devs);
+        rc = virUSBDeviceFindByVendor(vendor, product,
+                                      NULL,
+                                      mandatory, &devs);
         if (rc < 0)
             return -1;
 
         if (rc == 1) {
-            *usb = usbDeviceListGet(devs, 0);
-            usbDeviceListSteal(devs, *usb);
+            *usb = virUSBDeviceListGet(devs, 0);
+            virUSBDeviceListSteal(devs, *usb);
         }
-        usbDeviceListFree(devs);
+        virUSBDeviceListFree(devs);
 
         if (rc == 0) {
             goto out;
@@ -186,8 +186,8 @@ virLXCFindHostdevUSBDevice(virDomainHostdevDefPtr hostdev,
             return -1;
         }
 
-        hostdev->source.subsys.u.usb.bus = usbDeviceGetBus(*usb);
-        hostdev->source.subsys.u.usb.device = usbDeviceGetDevno(*usb);
+        hostdev->source.subsys.u.usb.bus = virUSBDeviceGetBus(*usb);
+        hostdev->source.subsys.u.usb.device = virUSBDeviceGetDevno(*usb);
         hostdev->source.subsys.u.usb.autoAddress = true;
 
         if (autoAddress) {
@@ -199,9 +199,9 @@ virLXCFindHostdevUSBDevice(virDomainHostdevDefPtr hostdev,
                      bus, device);
         }
     } else if (!vendor && bus) {
-        if (usbFindDeviceByBus(bus, device,
-                               NULL,
-                               mandatory, usb) < 0)
+        if (virUSBDeviceFindByBus(bus, device,
+                                  NULL,
+                                  mandatory, usb) < 0)
             return -1;
     }
 
@@ -217,8 +217,8 @@ virLXCPrepareHostUSBDevices(virLXCDriverPtr driver,
 {
     size_t i;
     int ret = -1;
-    usbDeviceList *list;
-    usbDevice *tmp;
+    virUSBDeviceList *list;
+    virUSBDevicePtr tmp;
     virDomainHostdevDefPtr *hostdevs = def->hostdevs;
     int nhostdevs = def->nhostdevs;
 
@@ -227,7 +227,7 @@ virLXCPrepareHostUSBDevices(virLXCDriverPtr driver,
      * This is done in several loops which cannot be joined into one big
      * loop. See virLXCPrepareHostdevPCIDevices()
      */
-    if (!(list = usbDeviceListNew()))
+    if (!(list = virUSBDeviceListNew()))
         goto cleanup;
 
     /* Loop 1: build temporary list
@@ -235,7 +235,7 @@ virLXCPrepareHostUSBDevices(virLXCDriverPtr driver,
     for (i = 0 ; i < nhostdevs ; i++) {
         virDomainHostdevDefPtr hostdev = hostdevs[i];
         bool required = true;
-        usbDevice *usb;
+        virUSBDevicePtr usb;
 
         if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS)
             continue;
@@ -248,8 +248,8 @@ virLXCPrepareHostUSBDevices(virLXCDriverPtr driver,
         if (virLXCFindHostdevUSBDevice(hostdev, required, &usb) < 0)
             goto cleanup;
 
-        if (usb && usbDeviceListAdd(list, usb) < 0) {
-            usbFreeDevice(usb);
+        if (usb && virUSBDeviceListAdd(list, usb) < 0) {
+            virUSBDeviceFree(usb);
             goto cleanup;
         }
     }
@@ -265,15 +265,15 @@ virLXCPrepareHostUSBDevices(virLXCDriverPtr driver,
      * driver list, so steal all items to avoid freeing them
      * in cleanup label.
      */
-    while (usbDeviceListCount(list) > 0) {
-        tmp = usbDeviceListGet(list, 0);
-        usbDeviceListSteal(list, tmp);
+    while (virUSBDeviceListCount(list) > 0) {
+        tmp = virUSBDeviceListGet(list, 0);
+        virUSBDeviceListSteal(list, tmp);
     }
 
     ret = 0;
 
 cleanup:
-    usbDeviceListFree(list);
+    virUSBDeviceListFree(list);
     return ret;
 }
 
@@ -342,7 +342,7 @@ virLXCDomainReAttachHostUsbDevices(virLXCDriverPtr driver,
 
     for (i = 0; i < nhostdevs; i++) {
         virDomainHostdevDefPtr hostdev = hostdevs[i];
-        usbDevice *usb, *tmp;
+        virUSBDevicePtr usb, tmp;
         const char *used_by = NULL;
 
         if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS)
@@ -352,9 +352,9 @@ virLXCDomainReAttachHostUsbDevices(virLXCDriverPtr driver,
         if (hostdev->missing)
             continue;
 
-        usb = usbGetDevice(hostdev->source.subsys.u.usb.bus,
-                           hostdev->source.subsys.u.usb.device,
-                           NULL);
+        usb = virUSBDeviceNew(hostdev->source.subsys.u.usb.bus,
+                              hostdev->source.subsys.u.usb.device,
+                              NULL);
 
         if (!usb) {
             VIR_WARN("Unable to reattach USB device %03d.%03d on domain %s",
@@ -370,8 +370,8 @@ virLXCDomainReAttachHostUsbDevices(virLXCDriverPtr driver,
          * Therefore we want to steal only those devices from
          * the list which were taken by @name */
 
-        tmp = usbDeviceListFind(driver->activeUsbHostdevs, usb);
-        usbFreeDevice(usb);
+        tmp = virUSBDeviceListFind(driver->activeUsbHostdevs, usb);
+        virUSBDeviceFree(usb);
 
         if (!tmp) {
             VIR_WARN("Unable to find device %03d.%03d "
@@ -381,14 +381,14 @@ virLXCDomainReAttachHostUsbDevices(virLXCDriverPtr driver,
             continue;
         }
 
-        used_by = usbDeviceGetUsedBy(tmp);
+        used_by = virUSBDeviceGetUsedBy(tmp);
         if (STREQ_NULLABLE(used_by, name)) {
             VIR_DEBUG("Removing %03d.%03d dom=%s from activeUsbHostdevs",
                       hostdev->source.subsys.u.usb.bus,
                       hostdev->source.subsys.u.usb.device,
                       name);
 
-            usbDeviceListDel(driver->activeUsbHostdevs, tmp);
+            virUSBDeviceListDel(driver->activeUsbHostdevs, tmp);
         }
     }
 }
diff --git a/src/lxc/lxc_hostdev.h b/src/lxc/lxc_hostdev.h
index dd98112..41bb178 100644
--- a/src/lxc/lxc_hostdev.h
+++ b/src/lxc/lxc_hostdev.h
@@ -31,10 +31,10 @@ int virLXCUpdateActiveUsbHostdevs(virLXCDriverPtr driver,
                                   virDomainDefPtr def);
 int virLXCFindHostdevUSBDevice(virDomainHostdevDefPtr hostdev,
                                bool mandatory,
-                               usbDevice **usb);
+                               virUSBDevicePtr *usb);
 int virLXCPrepareHostdevUSBDevices(virLXCDriverPtr driver,
                                    const char *name,
-                                   usbDeviceList *list);
+                                   virUSBDeviceListPtr list);
 int virLXCPrepareHostDevices(virLXCDriverPtr driver,
                              virDomainDefPtr def);
 void virLXCDomainReAttachHostDevices(virLXCDriverPtr driver,
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index 482989f..4eeb4e5 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -172,7 +172,7 @@ qemuSetupChardevCgroup(virDomainDefPtr def,
 }
 
 
-int qemuSetupHostUsbDeviceCgroup(usbDevice *dev ATTRIBUTE_UNUSED,
+int qemuSetupHostUsbDeviceCgroup(virUSBDevicePtr dev ATTRIBUTE_UNUSED,
                                  const char *path,
                                  void *opaque)
 {
@@ -286,7 +286,7 @@ int qemuSetupCgroup(virQEMUDriverPtr driver,
 
         for (i = 0; i < vm->def->nhostdevs; i++) {
             virDomainHostdevDefPtr hostdev = vm->def->hostdevs[i];
-            usbDevice *usb;
+            virUSBDevicePtr usb;
 
             if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS)
                 continue;
@@ -295,13 +295,13 @@ int qemuSetupCgroup(virQEMUDriverPtr driver,
             if (hostdev->missing)
                 continue;
 
-            if ((usb = usbGetDevice(hostdev->source.subsys.u.usb.bus,
-                                    hostdev->source.subsys.u.usb.device,
-                                    NULL)) == NULL)
+            if ((usb = virUSBDeviceNew(hostdev->source.subsys.u.usb.bus,
+                                       hostdev->source.subsys.u.usb.device,
+                                       NULL)) == NULL)
                 goto cleanup;
 
-            if (usbDeviceFileIterate(usb, qemuSetupHostUsbDeviceCgroup,
-                                     &data) < 0)
+            if (virUSBDeviceFileIterate(usb, qemuSetupHostUsbDeviceCgroup,
+                                        &data) < 0)
                 goto cleanup;
         }
     }
diff --git a/src/qemu/qemu_cgroup.h b/src/qemu/qemu_cgroup.h
index 75ef514..a677d07 100644
--- a/src/qemu/qemu_cgroup.h
+++ b/src/qemu/qemu_cgroup.h
@@ -42,7 +42,7 @@ int qemuSetupDiskCgroup(virDomainObjPtr vm,
 int qemuTeardownDiskCgroup(virDomainObjPtr vm,
                            virCgroupPtr cgroup,
                            virDomainDiskDefPtr disk);
-int qemuSetupHostUsbDeviceCgroup(usbDevice *dev,
+int qemuSetupHostUsbDeviceCgroup(virUSBDevicePtr dev,
                                  const char *path,
                                  void *opaque);
 int qemuSetupCgroup(virQEMUDriverPtr driver,
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index be45cf0..4bf1be0 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -183,7 +183,7 @@ struct _virQEMUDriver {
 
     virPCIDeviceListPtr activePciHostdevs;
     virPCIDeviceListPtr inactivePciHostdevs;
-    usbDeviceList *activeUsbHostdevs;
+    virUSBDeviceListPtr activeUsbHostdevs;
 
     virHashTablePtr sharedDisks;
 
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d36f2c0..cba926d 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -784,7 +784,7 @@ qemuStartup(bool privileged,
     if ((qemu_driver->activePciHostdevs = virPCIDeviceListNew()) == NULL)
         goto error;
 
-    if ((qemu_driver->activeUsbHostdevs = usbDeviceListNew()) == NULL)
+    if ((qemu_driver->activeUsbHostdevs = virUSBDeviceListNew()) == NULL)
         goto error;
 
     if ((qemu_driver->inactivePciHostdevs = virPCIDeviceListNew()) == NULL)
@@ -1050,7 +1050,7 @@ qemuShutdown(void) {
     virNWFilterUnRegisterCallbackDriver(&qemuCallbackDriver);
     virPCIDeviceListFree(qemu_driver->activePciHostdevs);
     virPCIDeviceListFree(qemu_driver->inactivePciHostdevs);
-    usbDeviceListFree(qemu_driver->activeUsbHostdevs);
+    virUSBDeviceListFree(qemu_driver->activeUsbHostdevs);
     virHashFree(qemu_driver->sharedDisks);
     virCapabilitiesFree(qemu_driver->caps);
     qemuCapsCacheFree(qemu_driver->capsCache);
diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c
index b5d7c5e..46a17a7 100644
--- a/src/qemu/qemu_hostdev.c
+++ b/src/qemu/qemu_hostdev.c
@@ -170,7 +170,7 @@ qemuUpdateActiveUsbHostdevs(virQEMUDriverPtr driver,
         return 0;
 
     for (i = 0; i < def->nhostdevs; i++) {
-        usbDevice *usb = NULL;
+        virUSBDevicePtr usb = NULL;
         hostdev = def->hostdevs[i];
 
         if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS)
@@ -178,9 +178,9 @@ qemuUpdateActiveUsbHostdevs(virQEMUDriverPtr driver,
         if (hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB)
             continue;
 
-        usb = usbGetDevice(hostdev->source.subsys.u.usb.bus,
-                           hostdev->source.subsys.u.usb.device,
-                           NULL);
+        usb = virUSBDeviceNew(hostdev->source.subsys.u.usb.bus,
+                              hostdev->source.subsys.u.usb.device,
+                              NULL);
         if (!usb) {
             VIR_WARN("Unable to reattach USB device %03d.%03d on domain %s",
                      hostdev->source.subsys.u.usb.bus,
@@ -189,10 +189,10 @@ qemuUpdateActiveUsbHostdevs(virQEMUDriverPtr driver,
             continue;
         }
 
-        usbDeviceSetUsedBy(usb, def->name);
+        virUSBDeviceSetUsedBy(usb, def->name);
 
-        if (usbDeviceListAdd(driver->activeUsbHostdevs, usb) < 0) {
-            usbFreeDevice(usb);
+        if (virUSBDeviceListAdd(driver->activeUsbHostdevs, usb) < 0) {
+            virUSBDeviceFree(usb);
             return -1;
         }
     }
@@ -596,47 +596,47 @@ qemuPrepareHostPCIDevices(virQEMUDriverPtr driver,
 int
 qemuPrepareHostdevUSBDevices(virQEMUDriverPtr driver,
                              const char *name,
-                             usbDeviceList *list)
+                             virUSBDeviceListPtr list)
 {
     int i, j;
     unsigned int count;
-    usbDevice *tmp;
+    virUSBDevicePtr tmp;
 
-    count = usbDeviceListCount(list);
+    count = virUSBDeviceListCount(list);
 
     for (i = 0; i < count; i++) {
-        usbDevice *usb = usbDeviceListGet(list, i);
-        if ((tmp = usbDeviceListFind(driver->activeUsbHostdevs, usb))) {
-            const char *other_name = usbDeviceGetUsedBy(tmp);
+        virUSBDevicePtr usb = virUSBDeviceListGet(list, i);
+        if ((tmp = virUSBDeviceListFind(driver->activeUsbHostdevs, usb))) {
+            const char *other_name = virUSBDeviceGetUsedBy(tmp);
 
             if (other_name)
                 virReportError(VIR_ERR_OPERATION_INVALID,
                                _("USB device %s is in use by domain %s"),
-                               usbDeviceGetName(tmp), other_name);
+                               virUSBDeviceGetName(tmp), other_name);
             else
                 virReportError(VIR_ERR_OPERATION_INVALID,
                                _("USB device %s is already in use"),
-                               usbDeviceGetName(tmp));
+                               virUSBDeviceGetName(tmp));
             goto error;
         }
 
-        usbDeviceSetUsedBy(usb, name);
+        virUSBDeviceSetUsedBy(usb, name);
         VIR_DEBUG("Adding %03d.%03d dom=%s to activeUsbHostdevs",
-                  usbDeviceGetBus(usb), usbDeviceGetDevno(usb), name);
+                  virUSBDeviceGetBus(usb), virUSBDeviceGetDevno(usb), name);
         /*
          * The caller is responsible to steal these usb devices
-         * from the usbDeviceList that passed in on success,
+         * from the virUSBDeviceList that passed in on success,
          * perform rollback on failure.
          */
-        if (usbDeviceListAdd(driver->activeUsbHostdevs, usb) < 0)
+        if (virUSBDeviceListAdd(driver->activeUsbHostdevs, usb) < 0)
             goto error;
     }
     return 0;
 
 error:
     for (j = 0; j < i; j++) {
-        tmp = usbDeviceListGet(list, i);
-        usbDeviceListSteal(driver->activeUsbHostdevs, tmp);
+        tmp = virUSBDeviceListGet(list, i);
+        virUSBDeviceListSteal(driver->activeUsbHostdevs, tmp);
     }
     return -1;
 }
@@ -644,7 +644,7 @@ error:
 int
 qemuFindHostdevUSBDevice(virDomainHostdevDefPtr hostdev,
                          bool mandatory,
-                         usbDevice **usb)
+                         virUSBDevicePtr *usb)
 {
     unsigned vendor = hostdev->source.subsys.u.usb.vendor;
     unsigned product = hostdev->source.subsys.u.usb.product;
@@ -656,10 +656,10 @@ qemuFindHostdevUSBDevice(virDomainHostdevDefPtr hostdev,
     *usb = NULL;
 
     if (vendor && bus) {
-        rc = usbFindDevice(vendor, product, bus, device,
-                           NULL,
-                           autoAddress ? false : mandatory,
-                           usb);
+        rc = virUSBDeviceFind(vendor, product, bus, device,
+                              NULL,
+                              autoAddress ? false : mandatory,
+                              usb);
         if (rc < 0) {
             return -1;
         } else if (!autoAddress) {
@@ -676,17 +676,17 @@ qemuFindHostdevUSBDevice(virDomainHostdevDefPtr hostdev,
      * automatically found before.
      */
     if (vendor) {
-        usbDeviceList *devs;
+        virUSBDeviceListPtr devs;
 
-        rc = usbFindDeviceByVendor(vendor, product, NULL, mandatory, &devs);
+        rc = virUSBDeviceFindByVendor(vendor, product, NULL, mandatory, &devs);
         if (rc < 0)
             return -1;
 
         if (rc == 1) {
-            *usb = usbDeviceListGet(devs, 0);
-            usbDeviceListSteal(devs, *usb);
+            *usb = virUSBDeviceListGet(devs, 0);
+            virUSBDeviceListSteal(devs, *usb);
         }
-        usbDeviceListFree(devs);
+        virUSBDeviceListFree(devs);
 
         if (rc == 0) {
             goto out;
@@ -705,8 +705,8 @@ qemuFindHostdevUSBDevice(virDomainHostdevDefPtr hostdev,
             return -1;
         }
 
-        hostdev->source.subsys.u.usb.bus = usbDeviceGetBus(*usb);
-        hostdev->source.subsys.u.usb.device = usbDeviceGetDevno(*usb);
+        hostdev->source.subsys.u.usb.bus = virUSBDeviceGetBus(*usb);
+        hostdev->source.subsys.u.usb.device = virUSBDeviceGetDevno(*usb);
         hostdev->source.subsys.u.usb.autoAddress = true;
 
         if (autoAddress) {
@@ -718,7 +718,7 @@ qemuFindHostdevUSBDevice(virDomainHostdevDefPtr hostdev,
                      bus, device);
         }
     } else if (!vendor && bus) {
-        if (usbFindDeviceByBus(bus, device, NULL, mandatory, usb) < 0)
+        if (virUSBDeviceFindByBus(bus, device, NULL, mandatory, usb) < 0)
             return -1;
     }
 
@@ -734,8 +734,8 @@ qemuPrepareHostUSBDevices(virQEMUDriverPtr driver,
                           bool coldBoot)
 {
     int i, ret = -1;
-    usbDeviceList *list;
-    usbDevice *tmp;
+    virUSBDeviceListPtr list;
+    virUSBDevicePtr tmp;
     virDomainHostdevDefPtr *hostdevs = def->hostdevs;
     int nhostdevs = def->nhostdevs;
 
@@ -744,7 +744,7 @@ qemuPrepareHostUSBDevices(virQEMUDriverPtr driver,
      * This is done in several loops which cannot be joined into one big
      * loop. See qemuPrepareHostdevPCIDevices()
      */
-    if (!(list = usbDeviceListNew()))
+    if (!(list = virUSBDeviceListNew()))
         goto cleanup;
 
     /* Loop 1: build temporary list
@@ -752,7 +752,7 @@ qemuPrepareHostUSBDevices(virQEMUDriverPtr driver,
     for (i = 0 ; i < nhostdevs ; i++) {
         virDomainHostdevDefPtr hostdev = hostdevs[i];
         bool required = true;
-        usbDevice *usb;
+        virUSBDevicePtr usb;
 
         if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS)
             continue;
@@ -767,8 +767,8 @@ qemuPrepareHostUSBDevices(virQEMUDriverPtr driver,
         if (qemuFindHostdevUSBDevice(hostdev, required, &usb) < 0)
             goto cleanup;
 
-        if (usb && usbDeviceListAdd(list, usb) < 0) {
-            usbFreeDevice(usb);
+        if (usb && virUSBDeviceListAdd(list, usb) < 0) {
+            virUSBDeviceFree(usb);
             goto cleanup;
         }
     }
@@ -784,15 +784,15 @@ qemuPrepareHostUSBDevices(virQEMUDriverPtr driver,
      * driver list, so steal all items to avoid freeing them
      * in cleanup label.
      */
-    while (usbDeviceListCount(list) > 0) {
-        tmp = usbDeviceListGet(list, 0);
-        usbDeviceListSteal(list, tmp);
+    while (virUSBDeviceListCount(list) > 0) {
+        tmp = virUSBDeviceListGet(list, 0);
+        virUSBDeviceListSteal(list, tmp);
     }
 
     ret = 0;
 
 cleanup:
-    usbDeviceListFree(list);
+    virUSBDeviceListFree(list);
     return ret;
 }
 
@@ -931,7 +931,7 @@ qemuDomainReAttachHostUsbDevices(virQEMUDriverPtr driver,
 
     for (i = 0; i < nhostdevs; i++) {
         virDomainHostdevDefPtr hostdev = hostdevs[i];
-        usbDevice *usb, *tmp;
+        virUSBDevicePtr usb, tmp;
         const char *used_by = NULL;
 
         if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS)
@@ -941,9 +941,9 @@ qemuDomainReAttachHostUsbDevices(virQEMUDriverPtr driver,
         if (hostdev->missing)
             continue;
 
-        usb = usbGetDevice(hostdev->source.subsys.u.usb.bus,
-                           hostdev->source.subsys.u.usb.device,
-                           NULL);
+        usb = virUSBDeviceNew(hostdev->source.subsys.u.usb.bus,
+                              hostdev->source.subsys.u.usb.device,
+                              NULL);
 
         if (!usb) {
             VIR_WARN("Unable to reattach USB device %03d.%03d on domain %s",
@@ -959,8 +959,8 @@ qemuDomainReAttachHostUsbDevices(virQEMUDriverPtr driver,
          * Therefore we want to steal only those devices from
          * the list which were taken by @name */
 
-        tmp = usbDeviceListFind(driver->activeUsbHostdevs, usb);
-        usbFreeDevice(usb);
+        tmp = virUSBDeviceListFind(driver->activeUsbHostdevs, usb);
+        virUSBDeviceFree(usb);
 
         if (!tmp) {
             VIR_WARN("Unable to find device %03d.%03d "
@@ -970,14 +970,14 @@ qemuDomainReAttachHostUsbDevices(virQEMUDriverPtr driver,
             continue;
         }
 
-        used_by = usbDeviceGetUsedBy(tmp);
+        used_by = virUSBDeviceGetUsedBy(tmp);
         if (STREQ_NULLABLE(used_by, name)) {
             VIR_DEBUG("Removing %03d.%03d dom=%s from activeUsbHostdevs",
                       hostdev->source.subsys.u.usb.bus,
                       hostdev->source.subsys.u.usb.device,
                       name);
 
-            usbDeviceListDel(driver->activeUsbHostdevs, tmp);
+            virUSBDeviceListDel(driver->activeUsbHostdevs, tmp);
         }
     }
 }
diff --git a/src/qemu/qemu_hostdev.h b/src/qemu/qemu_hostdev.h
index 8bfd36f..a1b8b9e 100644
--- a/src/qemu/qemu_hostdev.h
+++ b/src/qemu/qemu_hostdev.h
@@ -38,10 +38,10 @@ int qemuPrepareHostdevPCIDevices(virQEMUDriverPtr driver,
                                  int nhostdevs);
 int qemuFindHostdevUSBDevice(virDomainHostdevDefPtr hostdev,
                              bool mandatory,
-                             usbDevice **usb);
+                             virUSBDevicePtr *usb);
 int qemuPrepareHostdevUSBDevices(virQEMUDriverPtr driver,
                                  const char *name,
-                                 usbDeviceList *list);
+                                 virUSBDeviceListPtr list);
 int qemuPrepareHostDevices(virQEMUDriverPtr driver,
                            virDomainDefPtr def,
                            bool coldBoot);
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 2fc8b00..c1305f4 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1094,7 +1094,7 @@ int qemuDomainAttachHostUsbDevice(virQEMUDriverPtr driver,
 
     if (qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_DEVICES)) {
         virCgroupPtr cgroup = NULL;
-        usbDevice *usb;
+        virUSBDevicePtr usb;
         qemuCgroupData data;
 
         if (virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0) != 0) {
@@ -1104,14 +1104,14 @@ int qemuDomainAttachHostUsbDevice(virQEMUDriverPtr driver,
             goto error;
         }
 
-        if ((usb = usbGetDevice(hostdev->source.subsys.u.usb.bus,
+        if ((usb = virUSBDeviceNew(hostdev->source.subsys.u.usb.bus,
                                 hostdev->source.subsys.u.usb.device,
                                 NULL)) == NULL)
             goto error;
 
         data.vm = vm;
         data.cgroup = cgroup;
-        if (usbDeviceFileIterate(usb, qemuSetupHostUsbDeviceCgroup, &data) < 0)
+        if (virUSBDeviceFileIterate(usb, qemuSetupHostUsbDeviceCgroup, &data) < 0)
             goto error;
     }
 
@@ -1142,8 +1142,8 @@ int qemuDomainAttachHostDevice(virQEMUDriverPtr driver,
                                virDomainObjPtr vm,
                                virDomainHostdevDefPtr hostdev)
 {
-    usbDeviceList *list;
-    usbDevice *usb = NULL;
+    virUSBDeviceList *list;
+    virUSBDevicePtr usb = NULL;
 
     if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
@@ -1152,15 +1152,15 @@ int qemuDomainAttachHostDevice(virQEMUDriverPtr driver,
         return -1;
     }
 
-    if (!(list = usbDeviceListNew()))
+    if (!(list = virUSBDeviceListNew()))
         goto cleanup;
 
     if (hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB) {
         if (qemuFindHostdevUSBDevice(hostdev, true, &usb) < 0)
             goto cleanup;
 
-        if (usbDeviceListAdd(list, usb) < 0) {
-            usbFreeDevice(usb);
+        if (virUSBDeviceListAdd(list, usb) < 0) {
+            virUSBDeviceFree(usb);
             usb = NULL;
             goto cleanup;
         }
@@ -1170,7 +1170,7 @@ int qemuDomainAttachHostDevice(virQEMUDriverPtr driver,
             goto cleanup;
         }
 
-        usbDeviceListSteal(list, usb);
+        virUSBDeviceListSteal(list, usb);
     }
 
     if (virSecurityManagerSetHostdevLabel(driver->securityManager,
@@ -1197,7 +1197,7 @@ int qemuDomainAttachHostDevice(virQEMUDriverPtr driver,
         goto error;
     }
 
-    usbDeviceListFree(list);
+    virUSBDeviceListFree(list);
     return 0;
 
 error:
@@ -1206,9 +1206,9 @@ error:
         VIR_WARN("Unable to restore host device labelling on hotplug fail");
 
 cleanup:
-    usbDeviceListFree(list);
+    virUSBDeviceListFree(list);
     if (usb)
-        usbDeviceListSteal(driver->activeUsbHostdevs, usb);
+        virUSBDeviceListSteal(driver->activeUsbHostdevs, usb);
     return -1;
 }
 
@@ -2377,7 +2377,7 @@ qemuDomainDetachHostUsbDevice(virQEMUDriverPtr driver,
 {
     qemuDomainObjPrivatePtr priv = vm->privateData;
     virDomainHostdevSubsysPtr subsys = &detach->source.subsys;
-    usbDevice *usb;
+    virUSBDevicePtr usb;
     int ret;
 
     if (!detach->info->alias) {
@@ -2399,10 +2399,10 @@ qemuDomainDetachHostUsbDevice(virQEMUDriverPtr driver,
     if (ret < 0)
         return -1;
 
-    usb = usbGetDevice(subsys->u.usb.bus, subsys->u.usb.device, NULL);
+    usb = virUSBDeviceNew(subsys->u.usb.bus, subsys->u.usb.device, NULL);
     if (usb) {
-        usbDeviceListDel(driver->activeUsbHostdevs, usb);
-        usbFreeDevice(usb);
+        virUSBDeviceListDel(driver->activeUsbHostdevs, usb);
+        virUSBDeviceFree(usb);
     } else {
         VIR_WARN("Unable to find device %03d.%03d in list of used USB devices",
                  subsys->u.usb.bus, subsys->u.usb.device);
diff --git a/src/security/security_apparmor.c b/src/security/security_apparmor.c
index a635a1b..8764758 100644
--- a/src/security/security_apparmor.c
+++ b/src/security/security_apparmor.c
@@ -305,7 +305,7 @@ reload_profile(virSecurityManagerPtr mgr,
 }
 
 static int
-AppArmorSetSecurityUSBLabel(usbDevice *dev ATTRIBUTE_UNUSED,
+AppArmorSetSecurityUSBLabel(virUSBDevicePtr dev ATTRIBUTE_UNUSED,
                            const char *file, void *opaque)
 {
     struct SDPDOP *ptr = opaque;
@@ -769,15 +769,16 @@ AppArmorSetSecurityHostdevLabel(virSecurityManagerPtr mgr,
 
     switch (dev->source.subsys.type) {
     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: {
-        usbDevice *usb = usbGetDevice(dev->source.subsys.u.usb.bus,
-                                      dev->source.subsys.u.usb.device,
-                                      vroot);
+        virUSBDevicePtr usb =
+            virUSBDeviceNew(dev->source.subsys.u.usb.bus,
+                            dev->source.subsys.u.usb.device,
+                            vroot);
 
         if (!usb)
             goto done;
 
-        ret = usbDeviceFileIterate(usb, AppArmorSetSecurityUSBLabel, ptr);
-        usbFreeDevice(usb);
+        ret = virUSBDeviceFileIterate(usb, AppArmorSetSecurityUSBLabel, ptr);
+        virUSBDeviceFree(usb);
         break;
     }
 
diff --git a/src/security/security_dac.c b/src/security/security_dac.c
index e42d049..bfe292c 100644
--- a/src/security/security_dac.c
+++ b/src/security/security_dac.c
@@ -453,7 +453,7 @@ virSecurityDACSetSecurityPCILabel(virPCIDevicePtr dev ATTRIBUTE_UNUSED,
 
 
 static int
-virSecurityDACSetSecurityUSBLabel(usbDevice *dev ATTRIBUTE_UNUSED,
+virSecurityDACSetSecurityUSBLabel(virUSBDevicePtr dev ATTRIBUTE_UNUSED,
                                   const char *file,
                                   void *opaque)
 {
@@ -489,20 +489,20 @@ virSecurityDACSetSecurityHostdevLabel(virSecurityManagerPtr mgr,
 
     switch (dev->source.subsys.type) {
     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: {
-        usbDevice *usb;
+        virUSBDevicePtr usb;
 
         if (dev->missing)
             return 0;
 
-        usb = usbGetDevice(dev->source.subsys.u.usb.bus,
-                           dev->source.subsys.u.usb.device,
-                           vroot);
+        usb = virUSBDeviceNew(dev->source.subsys.u.usb.bus,
+                              dev->source.subsys.u.usb.device,
+                              vroot);
         if (!usb)
             goto done;
 
-        ret = usbDeviceFileIterate(usb, virSecurityDACSetSecurityUSBLabel,
-                                   params);
-        usbFreeDevice(usb);
+        ret = virUSBDeviceFileIterate(usb, virSecurityDACSetSecurityUSBLabel,
+                                      params);
+        virUSBDeviceFree(usb);
         break;
     }
 
@@ -543,9 +543,9 @@ virSecurityDACRestoreSecurityPCILabel(virPCIDevicePtr dev ATTRIBUTE_UNUSED,
 
 
 static int
-virSecurityDACRestoreSecurityUSBLabel(usbDevice *dev ATTRIBUTE_UNUSED,
-                                       const char *file,
-                                       void *opaque ATTRIBUTE_UNUSED)
+virSecurityDACRestoreSecurityUSBLabel(virUSBDevicePtr dev ATTRIBUTE_UNUSED,
+                                      const char *file,
+                                      void *opaque ATTRIBUTE_UNUSED)
 {
     return virSecurityDACRestoreSecurityFileLabel(file);
 }
@@ -569,19 +569,19 @@ virSecurityDACRestoreSecurityHostdevLabel(virSecurityManagerPtr mgr,
 
     switch (dev->source.subsys.type) {
     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: {
-        usbDevice *usb;
+        virUSBDevicePtr usb;
 
         if (dev->missing)
             return 0;
 
-        usb = usbGetDevice(dev->source.subsys.u.usb.bus,
-                           dev->source.subsys.u.usb.device,
-                           vroot);
+        usb = virUSBDeviceNew(dev->source.subsys.u.usb.bus,
+                              dev->source.subsys.u.usb.device,
+                              vroot);
         if (!usb)
             goto done;
 
-        ret = usbDeviceFileIterate(usb, virSecurityDACRestoreSecurityUSBLabel, mgr);
-        usbFreeDevice(usb);
+        ret = virUSBDeviceFileIterate(usb, virSecurityDACRestoreSecurityUSBLabel, mgr);
+        virUSBDeviceFree(usb);
 
         break;
     }
diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c
index 8b1692c..b6b727e 100644
--- a/src/security/security_selinux.c
+++ b/src/security/security_selinux.c
@@ -1145,7 +1145,7 @@ virSecuritySELinuxSetSecurityPCILabel(virPCIDevicePtr dev ATTRIBUTE_UNUSED,
 }
 
 static int
-virSecuritySELinuxSetSecurityUSBLabel(usbDevice *dev ATTRIBUTE_UNUSED,
+virSecuritySELinuxSetSecurityUSBLabel(virUSBDevicePtr dev ATTRIBUTE_UNUSED,
                                       const char *file, void *opaque)
 {
     virSecurityLabelDefPtr secdef;
@@ -1169,19 +1169,19 @@ virSecuritySELinuxSetSecurityHostdevSubsysLabel(virDomainDefPtr def,
 
     switch (dev->source.subsys.type) {
     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: {
-        usbDevice *usb;
+        virUSBDevicePtr usb;
 
         if (dev->missing)
             return 0;
 
-        usb = usbGetDevice(dev->source.subsys.u.usb.bus,
-                           dev->source.subsys.u.usb.device,
-                           vroot);
+        usb = virUSBDeviceNew(dev->source.subsys.u.usb.bus,
+                              dev->source.subsys.u.usb.device,
+                              vroot);
         if (!usb)
             goto done;
 
-        ret = usbDeviceFileIterate(usb, virSecuritySELinuxSetSecurityUSBLabel, def);
-        usbFreeDevice(usb);
+        ret = virUSBDeviceFileIterate(usb, virSecuritySELinuxSetSecurityUSBLabel, def);
+        virUSBDeviceFree(usb);
         break;
     }
 
@@ -1308,7 +1308,7 @@ virSecuritySELinuxRestoreSecurityPCILabel(virPCIDevicePtr dev ATTRIBUTE_UNUSED,
 }
 
 static int
-virSecuritySELinuxRestoreSecurityUSBLabel(usbDevice *dev ATTRIBUTE_UNUSED,
+virSecuritySELinuxRestoreSecurityUSBLabel(virUSBDevicePtr dev ATTRIBUTE_UNUSED,
                                           const char *file,
                                           void *opaque ATTRIBUTE_UNUSED)
 {
@@ -1325,19 +1325,19 @@ virSecuritySELinuxRestoreSecurityHostdevSubsysLabel(virDomainHostdevDefPtr dev,
 
     switch (dev->source.subsys.type) {
     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: {
-        usbDevice *usb;
+        virUSBDevicePtr usb;
 
         if (dev->missing)
             return 0;
 
-        usb = usbGetDevice(dev->source.subsys.u.usb.bus,
-                           dev->source.subsys.u.usb.device,
-                           vroot);
+        usb = virUSBDeviceNew(dev->source.subsys.u.usb.bus,
+                              dev->source.subsys.u.usb.device,
+                              vroot);
         if (!usb)
             goto done;
 
-        ret = usbDeviceFileIterate(usb, virSecuritySELinuxRestoreSecurityUSBLabel, NULL);
-        usbFreeDevice(usb);
+        ret = virUSBDeviceFileIterate(usb, virSecuritySELinuxRestoreSecurityUSBLabel, NULL);
+        virUSBDeviceFree(usb);
 
         break;
     }
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index 227d0f1..7b12a7d 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -845,7 +845,7 @@ vah_add_file_chardev(virBufferPtr buf,
 }
 
 static int
-file_iterate_hostdev_cb(usbDevice *dev ATTRIBUTE_UNUSED,
+file_iterate_hostdev_cb(virUSBDevicePtr dev ATTRIBUTE_UNUSED,
                         const char *file, void *opaque)
 {
     virBufferPtr buf = opaque;
@@ -1007,15 +1007,16 @@ get_files(vahControl * ctl)
             virDomainHostdevDefPtr dev = ctl->def->hostdevs[i];
             switch (dev->source.subsys.type) {
             case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: {
-                usbDevice *usb = usbGetDevice(dev->source.subsys.u.usb.bus,
-                                              dev->source.subsys.u.usb.device,
-                                              NULL);
+                virUSBDevicePtr usb =
+                    virUSBDeviceNew(dev->source.subsys.u.usb.bus,
+                                    dev->source.subsys.u.usb.device,
+                                    NULL);
 
                 if (usb == NULL)
                     continue;
 
-                rc = usbDeviceFileIterate(usb, file_iterate_hostdev_cb, &buf);
-                usbFreeDevice(usb);
+                rc = virUSBDeviceFileIterate(usb, file_iterate_hostdev_cb, &buf);
+                virUSBDeviceFree(usb);
                 if (rc != 0)
                     goto clean;
                 break;
diff --git a/src/util/virusb.c b/src/util/virusb.c
index 1ec5f45..88119e4 100644
--- a/src/util/virusb.c
+++ b/src/util/virusb.c
@@ -46,7 +46,7 @@
 /* For virReportOOMError()  and virReportSystemError() */
 #define VIR_FROM_THIS VIR_FROM_NONE
 
-struct _usbDevice {
+struct _virUSBDevice {
     unsigned int      bus;
     unsigned int      dev;
 
@@ -56,19 +56,19 @@ struct _usbDevice {
     const char    *used_by;           /* name of the domain using this dev */
 };
 
-struct _usbDeviceList {
+struct _virUSBDeviceList {
     unsigned int count;
-    usbDevice **devs;
+    virUSBDevicePtr *devs;
 };
 
 typedef enum {
     USB_DEVICE_ALL = 0,
     USB_DEVICE_FIND_BY_VENDOR = 1 << 0,
     USB_DEVICE_FIND_BY_BUS = 1 << 1,
-} usbDeviceFindFlags;
+} virUSBDeviceFindFlags;
 
-static int usbSysReadFile(const char *f_name, const char *d_name,
-                          int base, unsigned int *value)
+static int virUSBSysReadFile(const char *f_name, const char *d_name,
+                             int base, unsigned int *value)
 {
     int ret = -1, tmp;
     char *buf = NULL;
@@ -97,22 +97,22 @@ cleanup:
     return ret;
 }
 
-static usbDeviceList *
-usbDeviceSearch(unsigned int vendor,
-                unsigned int product,
-                unsigned int bus,
-                unsigned int devno,
-                const char *vroot,
-                unsigned int flags)
+static virUSBDeviceListPtr
+virUSBDeviceSearch(unsigned int vendor,
+                   unsigned int product,
+                   unsigned int bus,
+                   unsigned int devno,
+                   const char *vroot,
+                   unsigned int flags)
 {
     DIR *dir = NULL;
     bool found = false;
     char *ignore = NULL;
     struct dirent *de;
-    usbDeviceList *list = NULL, *ret = NULL;
-    usbDevice *usb;
+    virUSBDeviceListPtr list = NULL, ret = NULL;
+    virUSBDevicePtr usb;
 
-    if (!(list = usbDeviceListNew()))
+    if (!(list = virUSBDeviceListNew()))
         goto cleanup;
 
     dir = opendir(USB_SYSFS "/devices");
@@ -130,12 +130,12 @@ usbDeviceSearch(unsigned int vendor,
         if (de->d_name[0] == '.' || strchr(de->d_name, ':'))
             continue;
 
-        if (usbSysReadFile("idVendor", de->d_name,
-                           16, &found_vend) < 0)
+        if (virUSBSysReadFile("idVendor", de->d_name,
+                              16, &found_vend) < 0)
             goto cleanup;
 
-        if (usbSysReadFile("idProduct", de->d_name,
-                           16, &found_prod) < 0)
+        if (virUSBSysReadFile("idProduct", de->d_name,
+                              16, &found_prod) < 0)
             goto cleanup;
 
         if (STRPREFIX(de->d_name, "usb"))
@@ -148,8 +148,8 @@ usbDeviceSearch(unsigned int vendor,
             goto cleanup;
         }
 
-        if (usbSysReadFile("devnum", de->d_name,
-                           10, &found_devno) < 0)
+        if (virUSBSysReadFile("devnum", de->d_name,
+                              10, &found_devno) < 0)
             goto cleanup;
 
         if ((flags & USB_DEVICE_FIND_BY_VENDOR) &&
@@ -162,12 +162,12 @@ usbDeviceSearch(unsigned int vendor,
             found = true;
         }
 
-        usb = usbGetDevice(found_bus, found_devno, vroot);
+        usb = virUSBDeviceNew(found_bus, found_devno, vroot);
         if (!usb)
             goto cleanup;
 
-        if (usbDeviceListAdd(list, usb) < 0) {
-            usbFreeDevice(usb);
+        if (virUSBDeviceListAdd(list, usb) < 0) {
+            virUSBDeviceFree(usb);
             goto cleanup;
         }
 
@@ -184,27 +184,27 @@ cleanup:
     }
 
     if (!ret)
-        usbDeviceListFree(list);
+        virUSBDeviceListFree(list);
     return ret;
 }
 
 int
-usbFindDeviceByVendor(unsigned int vendor,
-                      unsigned product,
-                      const char *vroot,
-                      bool mandatory,
-                      usbDeviceList **devices)
+virUSBDeviceFindByVendor(unsigned int vendor,
+                         unsigned product,
+                         const char *vroot,
+                         bool mandatory,
+                         virUSBDeviceListPtr *devices)
 {
-    usbDeviceList *list;
+    virUSBDeviceListPtr list;
     int count;
 
-    if (!(list = usbDeviceSearch(vendor, product, 0 , 0,
-                                 vroot,
-                                 USB_DEVICE_FIND_BY_VENDOR)))
+    if (!(list = virUSBDeviceSearch(vendor, product, 0 , 0,
+                                    vroot,
+                                    USB_DEVICE_FIND_BY_VENDOR)))
         return -1;
 
     if (list->count == 0) {
-        usbDeviceListFree(list);
+        virUSBDeviceListFree(list);
         if (!mandatory) {
             VIR_DEBUG("Did not find USB device %x:%x",
                       vendor, product);
@@ -222,27 +222,27 @@ usbFindDeviceByVendor(unsigned int vendor,
     if (devices)
         *devices = list;
     else
-        usbDeviceListFree(list);
+        virUSBDeviceListFree(list);
 
     return count;
 }
 
 int
-usbFindDeviceByBus(unsigned int bus,
-                   unsigned devno,
-                   const char *vroot,
-                   bool mandatory,
-                   usbDevice **usb)
+virUSBDeviceFindByBus(unsigned int bus,
+                      unsigned devno,
+                      const char *vroot,
+                      bool mandatory,
+                      virUSBDevicePtr *usb)
 {
-    usbDeviceList *list;
+    virUSBDeviceListPtr list;
 
-    if (!(list = usbDeviceSearch(0, 0, bus, devno,
-                                 vroot,
-                                 USB_DEVICE_FIND_BY_BUS)))
+    if (!(list = virUSBDeviceSearch(0, 0, bus, devno,
+                                    vroot,
+                                    USB_DEVICE_FIND_BY_BUS)))
         return -1;
 
     if (list->count == 0) {
-        usbDeviceListFree(list);
+        virUSBDeviceListFree(list);
         if (!mandatory) {
             VIR_DEBUG("Did not find USB device bus:%u device:%u",
                       bus, devno);
@@ -258,32 +258,32 @@ usbFindDeviceByBus(unsigned int bus,
     }
 
     if (usb) {
-        *usb = usbDeviceListGet(list, 0);
-        usbDeviceListSteal(list, *usb);
+        *usb = virUSBDeviceListGet(list, 0);
+        virUSBDeviceListSteal(list, *usb);
     }
-    usbDeviceListFree(list);
+    virUSBDeviceListFree(list);
 
     return 0;
 }
 
 int
-usbFindDevice(unsigned int vendor,
-              unsigned int product,
-              unsigned int bus,
-              unsigned int devno,
-              const char *vroot,
-              bool mandatory,
-              usbDevice **usb)
+virUSBDeviceFind(unsigned int vendor,
+                 unsigned int product,
+                 unsigned int bus,
+                 unsigned int devno,
+                 const char *vroot,
+                 bool mandatory,
+                 virUSBDevicePtr *usb)
 {
-    usbDeviceList *list;
+    virUSBDeviceListPtr list;
 
     unsigned int flags = USB_DEVICE_FIND_BY_VENDOR|USB_DEVICE_FIND_BY_BUS;
-    if (!(list = usbDeviceSearch(vendor, product, bus, devno,
-                                 vroot, flags)))
+    if (!(list = virUSBDeviceSearch(vendor, product, bus, devno,
+                                    vroot, flags)))
         return -1;
 
     if (list->count == 0) {
-        usbDeviceListFree(list);
+        virUSBDeviceListFree(list);
         if (!mandatory) {
             VIR_DEBUG("Did not find USB device %x:%x bus:%u device:%u",
                       vendor, product, bus, devno);
@@ -299,20 +299,20 @@ usbFindDevice(unsigned int vendor,
     }
 
     if (usb) {
-        *usb = usbDeviceListGet(list, 0);
-        usbDeviceListSteal(list, *usb);
+        *usb = virUSBDeviceListGet(list, 0);
+        virUSBDeviceListSteal(list, *usb);
     }
-    usbDeviceListFree(list);
+    virUSBDeviceListFree(list);
 
     return 0;
 }
 
-usbDevice *
-usbGetDevice(unsigned int bus,
-             unsigned int devno,
-             const char *vroot)
+virUSBDevicePtr
+virUSBDeviceNew(unsigned int bus,
+                unsigned int devno,
+                const char *vroot)
 {
-    usbDevice *dev;
+    virUSBDevicePtr dev;
 
     if (VIR_ALLOC(dev) < 0) {
         virReportOOMError();
@@ -327,14 +327,14 @@ usbGetDevice(unsigned int bus,
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("dev->name buffer overflow: %.3o:%.3o"),
                        dev->bus, dev->dev);
-        usbFreeDevice(dev);
+        virUSBDeviceFree(dev);
         return NULL;
     }
     if (virAsprintf(&dev->path, "%s" USB_DEVFS "%03d/%03d",
                     vroot ? vroot : "",
                     dev->bus, dev->dev) < 0) {
         virReportOOMError();
-        usbFreeDevice(dev);
+        virUSBDeviceFree(dev);
         return NULL;
     }
 
@@ -344,7 +344,7 @@ usbGetDevice(unsigned int bus,
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("dev->id buffer overflow: %d %d"),
                        dev->bus, dev->dev);
-        usbFreeDevice(dev);
+        virUSBDeviceFree(dev);
         return NULL;
     }
 
@@ -354,7 +354,7 @@ usbGetDevice(unsigned int bus,
 }
 
 void
-usbFreeDevice(usbDevice *dev)
+virUSBDeviceFree(virUSBDevicePtr dev)
 {
     if (!dev)
         return;
@@ -364,45 +364,45 @@ usbFreeDevice(usbDevice *dev)
 }
 
 
-void usbDeviceSetUsedBy(usbDevice *dev,
-                        const char *name)
+void virUSBDeviceSetUsedBy(virUSBDevicePtr dev,
+                           const char *name)
 {
     dev->used_by = name;
 }
 
-const char * usbDeviceGetUsedBy(usbDevice *dev)
+const char * virUSBDeviceGetUsedBy(virUSBDevicePtr dev)
 {
     return dev->used_by;
 }
 
-const char *usbDeviceGetName(usbDevice *dev)
+const char *virUSBDeviceGetName(virUSBDevicePtr dev)
 {
     return dev->name;
 }
 
-unsigned int usbDeviceGetBus(usbDevice *dev)
+unsigned int virUSBDeviceGetBus(virUSBDevicePtr dev)
 {
     return dev->bus;
 }
 
 
-unsigned int usbDeviceGetDevno(usbDevice *dev)
+unsigned int virUSBDeviceGetDevno(virUSBDevicePtr dev)
 {
     return dev->dev;
 }
 
 
-int usbDeviceFileIterate(usbDevice *dev,
-                         usbDeviceFileActor actor,
-                         void *opaque)
+int virUSBDeviceFileIterate(virUSBDevicePtr dev,
+                            virUSBDeviceFileActor actor,
+                            void *opaque)
 {
     return (actor)(dev, dev->path, opaque);
 }
 
-usbDeviceList *
-usbDeviceListNew(void)
+virUSBDeviceListPtr
+virUSBDeviceListNew(void)
 {
-    usbDeviceList *list;
+    virUSBDeviceListPtr list;
 
     if (VIR_ALLOC(list) < 0) {
         virReportOOMError();
@@ -413,7 +413,7 @@ usbDeviceListNew(void)
 }
 
 void
-usbDeviceListFree(usbDeviceList *list)
+virUSBDeviceListFree(virUSBDeviceListPtr list)
 {
     int i;
 
@@ -421,17 +421,17 @@ usbDeviceListFree(usbDeviceList *list)
         return;
 
     for (i = 0; i < list->count; i++)
-        usbFreeDevice(list->devs[i]);
+        virUSBDeviceFree(list->devs[i]);
 
     VIR_FREE(list->devs);
     VIR_FREE(list);
 }
 
 int
-usbDeviceListAdd(usbDeviceList *list,
-                 usbDevice *dev)
+virUSBDeviceListAdd(virUSBDeviceListPtr list,
+                    virUSBDevicePtr dev)
 {
-    if (usbDeviceListFind(list, dev)) {
+    if (virUSBDeviceListFind(list, dev)) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Device %s is already in use"),
                        dev->name);
@@ -448,9 +448,9 @@ usbDeviceListAdd(usbDeviceList *list,
     return 0;
 }
 
-usbDevice *
-usbDeviceListGet(usbDeviceList *list,
-                 int idx)
+virUSBDevicePtr
+virUSBDeviceListGet(virUSBDeviceListPtr list,
+                    int idx)
 {
     if (idx >= list->count ||
         idx < 0)
@@ -460,16 +460,16 @@ usbDeviceListGet(usbDeviceList *list,
 }
 
 int
-usbDeviceListCount(usbDeviceList *list)
+virUSBDeviceListCount(virUSBDeviceListPtr list)
 {
     return list->count;
 }
 
-usbDevice *
-usbDeviceListSteal(usbDeviceList *list,
-                   usbDevice *dev)
+virUSBDevicePtr
+virUSBDeviceListSteal(virUSBDeviceListPtr list,
+                      virUSBDevicePtr dev)
 {
-    usbDevice *ret = NULL;
+    virUSBDevicePtr ret = NULL;
     int i;
 
     for (i = 0; i < list->count; i++) {
@@ -494,16 +494,16 @@ usbDeviceListSteal(usbDeviceList *list,
 }
 
 void
-usbDeviceListDel(usbDeviceList *list,
-                 usbDevice *dev)
+virUSBDeviceListDel(virUSBDeviceListPtr list,
+                    virUSBDevicePtr dev)
 {
-    usbDevice *ret = usbDeviceListSteal(list, dev);
-    usbFreeDevice(ret);
+    virUSBDevicePtr ret = virUSBDeviceListSteal(list, dev);
+    virUSBDeviceFree(ret);
 }
 
-usbDevice *
-usbDeviceListFind(usbDeviceList *list,
-                  usbDevice *dev)
+virUSBDevicePtr
+virUSBDeviceListFind(virUSBDeviceListPtr list,
+                     virUSBDevicePtr dev)
 {
     int i;
 
diff --git a/src/util/virusb.h b/src/util/virusb.h
index 917dd15..f231a41 100644
--- a/src/util/virusb.h
+++ b/src/util/virusb.h
@@ -29,40 +29,42 @@
 
 # define USB_DEVFS "/dev/bus/usb/"
 
-typedef struct _usbDevice usbDevice;
-typedef struct _usbDeviceList usbDeviceList;
+typedef struct _virUSBDevice virUSBDevice;
+typedef virUSBDevice *virUSBDevicePtr;
+typedef struct _virUSBDeviceList virUSBDeviceList;
+typedef virUSBDeviceList *virUSBDeviceListPtr;
 
-usbDevice *usbGetDevice(unsigned int bus,
-                        unsigned int devno,
-                        const char *vroot);
+virUSBDevicePtr virUSBDeviceNew(unsigned int bus,
+                                unsigned int devno,
+                                const char *vroot);
 
-int usbFindDeviceByBus(unsigned int bus,
-                       unsigned int devno,
-                       const char *vroot,
-                       bool mandatory,
-                       usbDevice **usb);
-
-int usbFindDeviceByVendor(unsigned int vendor,
-                          unsigned int product,
+int virUSBDeviceFindByBus(unsigned int bus,
+                          unsigned int devno,
                           const char *vroot,
                           bool mandatory,
-                          usbDeviceList **devices);
+                          virUSBDevicePtr *usb);
+
+int virUSBDeviceFindByVendor(unsigned int vendor,
+                             unsigned int product,
+                             const char *vroot,
+                             bool mandatory,
+                             virUSBDeviceListPtr *devices);
 
-int usbFindDevice(unsigned int vendor,
-                  unsigned int product,
-                  unsigned int bus,
-                  unsigned int devno,
-                  const char *vroot,
-                  bool mandatory,
-                  usbDevice **usb);
+int virUSBDeviceFind(unsigned int vendor,
+                     unsigned int product,
+                     unsigned int bus,
+                     unsigned int devno,
+                     const char *vroot,
+                     bool mandatory,
+                     virUSBDevicePtr *usb);
 
-void       usbFreeDevice (usbDevice *dev);
-void       usbDeviceSetUsedBy(usbDevice *dev, const char *name);
-const char *usbDeviceGetUsedBy(usbDevice *dev);
-const char *usbDeviceGetName(usbDevice *dev);
+void virUSBDeviceFree(virUSBDevicePtr dev);
+void virUSBDeviceSetUsedBy(virUSBDevicePtr dev, const char *name);
+const char *virUSBDeviceGetUsedBy(virUSBDevicePtr dev);
+const char *virUSBDeviceGetName(virUSBDevicePtr dev);
 
-unsigned int usbDeviceGetBus(usbDevice *dev);
-unsigned int usbDeviceGetDevno(usbDevice *dev);
+unsigned int virUSBDeviceGetBus(virUSBDevicePtr dev);
+unsigned int virUSBDeviceGetDevno(virUSBDevicePtr dev);
 
 /*
  * Callback that will be invoked once for each file
@@ -71,25 +73,25 @@ unsigned int usbDeviceGetDevno(usbDevice *dev);
  * Should return 0 if successfully processed, or
  * -1 to indicate error and abort iteration
  */
-typedef int (*usbDeviceFileActor)(usbDevice *dev,
-                                  const char *path, void *opaque);
+typedef int (*virUSBDeviceFileActor)(virUSBDevicePtr dev,
+                                     const char *path, void *opaque);
 
-int usbDeviceFileIterate(usbDevice *dev,
-                         usbDeviceFileActor actor,
-                         void *opaque);
+int virUSBDeviceFileIterate(virUSBDevicePtr dev,
+                            virUSBDeviceFileActor actor,
+                            void *opaque);
 
-usbDeviceList *usbDeviceListNew(void);
-void           usbDeviceListFree(usbDeviceList *list);
-int            usbDeviceListAdd(usbDeviceList *list,
-                                usbDevice *dev);
-usbDevice *    usbDeviceListGet(usbDeviceList *list,
-                                int idx);
-int            usbDeviceListCount(usbDeviceList *list);
-usbDevice *    usbDeviceListSteal(usbDeviceList *list,
-                                  usbDevice *dev);
-void           usbDeviceListDel(usbDeviceList *list,
-                                usbDevice *dev);
-usbDevice *    usbDeviceListFind(usbDeviceList *list,
-                                 usbDevice *dev);
+virUSBDeviceListPtr virUSBDeviceListNew(void);
+void virUSBDeviceListFree(virUSBDeviceListPtr list);
+int virUSBDeviceListAdd(virUSBDeviceListPtr list,
+                        virUSBDevicePtr dev);
+virUSBDevicePtr virUSBDeviceListGet(virUSBDeviceListPtr list,
+                                    int idx);
+int virUSBDeviceListCount(virUSBDeviceListPtr list);
+virUSBDevicePtr virUSBDeviceListSteal(virUSBDeviceListPtr list,
+                                      virUSBDevicePtr dev);
+void virUSBDeviceListDel(virUSBDeviceListPtr list,
+                         virUSBDevicePtr dev);
+virUSBDevicePtr virUSBDeviceListFind(virUSBDeviceListPtr list,
+                                     virUSBDevicePtr dev);
 
 #endif /* __VIR_USB_H__ */
-- 
1.8.0.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]