Since it is an abbreviation, USB should always be fully capitalized or full lower case, never Usb. Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx> --- src/conf/domain_conf.c | 40 ++++++++++++++++++++-------------------- src/conf/domain_conf.h | 8 ++++---- src/conf/node_device_conf.c | 8 ++++---- src/lxc/lxc_cgroup.c | 6 +++--- src/lxc/lxc_cgroup.h | 4 ++-- src/lxc/lxc_driver.c | 6 +++--- src/lxc/lxc_hostdev.c | 6 +++--- src/lxc/lxc_hostdev.h | 2 +- src/lxc/lxc_process.c | 2 +- src/qemu/qemu_capabilities.c | 18 +++++++++--------- src/qemu/qemu_cgroup.c | 6 +++--- src/qemu/qemu_command.c | 14 +++++++------- src/qemu/qemu_command.h | 2 +- 13 files changed, 61 insertions(+), 61 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index c59b4fb..bfdf4cb 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3799,7 +3799,7 @@ virDomainParseLegacyDeviceAddress(char *devaddr, } static int -virDomainHostdevSubsysUsbDefParseXML(xmlNodePtr node, +virDomainHostdevSubsysUSBDefParseXML(xmlNodePtr node, virDomainHostdevDefPtr def) { @@ -4347,7 +4347,7 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node, break; case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: - if (virDomainHostdevSubsysUsbDefParseXML(sourcenode, def) < 0) + if (virDomainHostdevSubsysUSBDefParseXML(sourcenode, def) < 0) goto error; break; @@ -9576,8 +9576,8 @@ error: * USB 1.1 as 0x0110 and USB 1.0 as 0x0100. */ static int -virDomainRedirFilterUsbVersionHelper(const char *version, - virDomainRedirFilterUsbDevDefPtr def) +virDomainRedirFilterUSBVersionHelper(const char *version, + virDomainRedirFilterUSBDevDefPtr def) { char *version_copy = NULL; char *temp = NULL; @@ -9630,13 +9630,13 @@ cleanup: return ret; } -static virDomainRedirFilterUsbDevDefPtr -virDomainRedirFilterUsbDevDefParseXML(xmlNodePtr node) +static virDomainRedirFilterUSBDevDefPtr +virDomainRedirFilterUSBDevDefParseXML(xmlNodePtr node) { char *class; char *vendor = NULL, *product = NULL; char *version = NULL, *allow = NULL; - virDomainRedirFilterUsbDevDefPtr def; + virDomainRedirFilterUSBDevDefPtr def; if (VIR_ALLOC(def) < 0) return NULL; @@ -9684,7 +9684,7 @@ virDomainRedirFilterUsbDevDefParseXML(xmlNodePtr node) if (version) { if (STREQ(version, "-1")) def->version = -1; - else if ((virDomainRedirFilterUsbVersionHelper(version, def)) < 0) + else if ((virDomainRedirFilterUSBVersionHelper(version, def)) < 0) goto error; } else { def->version = -1; @@ -9743,8 +9743,8 @@ virDomainRedirFilterDefParseXML(xmlNodePtr node, goto error; for (i = 0; i < n; i++) { - virDomainRedirFilterUsbDevDefPtr usbdev = - virDomainRedirFilterUsbDevDefParseXML(nodes[i]); + virDomainRedirFilterUSBDevDefPtr usbdev = + virDomainRedirFilterUSBDevDefParseXML(nodes[i]); if (!usbdev) goto error; @@ -13732,37 +13732,37 @@ virDomainRedirFilterDefCheckABIStability(virDomainRedirFilterDefPtr src, } for (i = 0; i < src->nusbdevs; i++) { - virDomainRedirFilterUsbDevDefPtr srcUsbDev = src->usbdevs[i]; - virDomainRedirFilterUsbDevDefPtr dstUsbDev = dst->usbdevs[i]; - if (srcUsbDev->usbClass != dstUsbDev->usbClass) { + virDomainRedirFilterUSBDevDefPtr srcUSBDev = src->usbdevs[i]; + virDomainRedirFilterUSBDevDefPtr dstUSBDev = dst->usbdevs[i]; + if (srcUSBDev->usbClass != dstUSBDev->usbClass) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Target USB Class code does not match source")); return false; } - if (srcUsbDev->vendor != dstUsbDev->vendor) { + if (srcUSBDev->vendor != dstUSBDev->vendor) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Target USB vendor ID does not match source")); return false; } - if (srcUsbDev->product != dstUsbDev->product) { + if (srcUSBDev->product != dstUSBDev->product) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Target USB product ID does not match source")); return false; } - if (srcUsbDev->version != dstUsbDev->version) { + if (srcUSBDev->version != dstUSBDev->version) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Target USB version does not match source")); return false; } - if (srcUsbDev->allow != dstUsbDev->allow) { + if (srcUSBDev->allow != dstUSBDev->allow) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Target USB allow '%s' does not match source '%s'"), - dstUsbDev->allow ? "yes" : "no", - srcUsbDev->allow ? "yes" : "no"); + dstUSBDev->allow ? "yes" : "no", + srcUSBDev->allow ? "yes" : "no"); return false; } } @@ -16770,7 +16770,7 @@ virDomainRedirFilterDefFormat(virBufferPtr buf, virBufferAddLit(buf, " <redirfilter>\n"); for (i = 0; i < filter->nusbdevs; i++) { - virDomainRedirFilterUsbDevDefPtr usbdev = filter->usbdevs[i]; + virDomainRedirFilterUSBDevDefPtr usbdev = filter->usbdevs[i]; virBufferAddLit(buf, " <usbdev"); if (usbdev->usbClass >= 0) virBufferAsprintf(buf, " class='0x%02X'", usbdev->usbClass); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 2fd2656..ad502f3 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -93,8 +93,8 @@ typedef virDomainHubDef *virDomainHubDefPtr; typedef struct _virDomainRedirdevDef virDomainRedirdevDef; typedef virDomainRedirdevDef *virDomainRedirdevDefPtr; -typedef struct _virDomainRedirFilterUsbDevDef virDomainRedirFilterUsbDevDef; -typedef virDomainRedirFilterUsbDevDef *virDomainRedirFilterUsbDevDefPtr; +typedef struct _virDomainRedirFilterUSBDevDef virDomainRedirFilterUSBDevDef; +typedef virDomainRedirFilterUSBDevDef *virDomainRedirFilterUSBDevDefPtr; typedef struct _virDomainRedirFilterDef virDomainRedirFilterDef; typedef virDomainRedirFilterDef *virDomainRedirFilterDefPtr; @@ -1572,7 +1572,7 @@ struct _virDomainRedirdevDef { virDomainDeviceInfo info; /* Guest address */ }; -struct _virDomainRedirFilterUsbDevDef { +struct _virDomainRedirFilterUSBDevDef { int usbClass; int vendor; int product; @@ -1582,7 +1582,7 @@ struct _virDomainRedirFilterUsbDevDef { struct _virDomainRedirFilterDef { size_t nusbdevs; - virDomainRedirFilterUsbDevDefPtr *usbdevs; + virDomainRedirFilterUSBDevDefPtr *usbdevs; }; enum virDomainMemDump { diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c index 9e94092..dca69e2 100644 --- a/src/conf/node_device_conf.c +++ b/src/conf/node_device_conf.c @@ -859,7 +859,7 @@ out: } static int -virNodeDevCapUsbInterfaceParseXML(xmlXPathContextPtr ctxt, +virNodeDevCapUSBInterfaceParseXML(xmlXPathContextPtr ctxt, virNodeDeviceDefPtr def, xmlNodePtr node, union _virNodeDevCapData *data) @@ -926,7 +926,7 @@ virNodeDevCapsDefParseHexId(const char *xpath, } static int -virNodeDevCapUsbDevParseXML(xmlXPathContextPtr ctxt, +virNodeDevCapUSBDevParseXML(xmlXPathContextPtr ctxt, virNodeDeviceDefPtr def, xmlNodePtr node, union _virNodeDevCapData *data) @@ -1172,10 +1172,10 @@ virNodeDevCapsDefParseXML(xmlXPathContextPtr ctxt, ret = virNodeDevCapPciDevParseXML(ctxt, def, node, &caps->data); break; case VIR_NODE_DEV_CAP_USB_DEV: - ret = virNodeDevCapUsbDevParseXML(ctxt, def, node, &caps->data); + ret = virNodeDevCapUSBDevParseXML(ctxt, def, node, &caps->data); break; case VIR_NODE_DEV_CAP_USB_INTERFACE: - ret = virNodeDevCapUsbInterfaceParseXML(ctxt, def, node, &caps->data); + ret = virNodeDevCapUSBInterfaceParseXML(ctxt, def, node, &caps->data); break; case VIR_NODE_DEV_CAP_NET: ret = virNodeDevCapNetParseXML(ctxt, def, node, &caps->data); diff --git a/src/lxc/lxc_cgroup.c b/src/lxc/lxc_cgroup.c index 39d955c..144520a 100644 --- a/src/lxc/lxc_cgroup.c +++ b/src/lxc/lxc_cgroup.c @@ -308,7 +308,7 @@ struct _virLXCCgroupDevicePolicy { int -virLXCSetupHostUsbDeviceCgroup(virUSBDevicePtr dev ATTRIBUTE_UNUSED, +virLXCSetupHostUSBDeviceCgroup(virUSBDevicePtr dev ATTRIBUTE_UNUSED, const char *path, void *opaque) { @@ -324,7 +324,7 @@ virLXCSetupHostUsbDeviceCgroup(virUSBDevicePtr dev ATTRIBUTE_UNUSED, int -virLXCTeardownHostUsbDeviceCgroup(virUSBDevicePtr dev ATTRIBUTE_UNUSED, +virLXCTeardownHostUSBDeviceCgroup(virUSBDevicePtr dev ATTRIBUTE_UNUSED, const char *path, void *opaque) { @@ -412,7 +412,7 @@ static int virLXCCgroupSetupDeviceACL(virDomainDefPtr def, NULL)) == NULL) goto cleanup; - if (virUSBDeviceFileIterate(usb, virLXCSetupHostUsbDeviceCgroup, + if (virUSBDeviceFileIterate(usb, virLXCSetupHostUSBDeviceCgroup, cgroup) < 0) { virUSBDeviceFree(usb); goto cleanup; diff --git a/src/lxc/lxc_cgroup.h b/src/lxc/lxc_cgroup.h index 25a427c..0e78126 100644 --- a/src/lxc/lxc_cgroup.h +++ b/src/lxc/lxc_cgroup.h @@ -36,12 +36,12 @@ int virLXCCgroupSetup(virDomainDefPtr def, int virLXCCgroupGetMeminfo(virLXCMeminfoPtr meminfo); int -virLXCSetupHostUsbDeviceCgroup(virUSBDevicePtr dev, +virLXCSetupHostUSBDeviceCgroup(virUSBDevicePtr dev, const char *path, void *opaque); int -virLXCTeardownHostUsbDeviceCgroup(virUSBDevicePtr dev, +virLXCTeardownHostUSBDeviceCgroup(virUSBDevicePtr dev, const char *path, void *opaque); diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 0ab1ba2..11c6e7d 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -4280,7 +4280,7 @@ lxcDomainAttachDeviceHostdevSubsysUSBLive(virLXCDriverPtr driver, goto cleanup; if (virUSBDeviceFileIterate(usb, - virLXCSetupHostUsbDeviceCgroup, + virLXCSetupHostUSBDeviceCgroup, priv->cgroup) < 0) goto cleanup; @@ -4291,7 +4291,7 @@ lxcDomainAttachDeviceHostdevSubsysUSBLive(virLXCDriverPtr driver, dev, src) < 0) { if (virUSBDeviceFileIterate(usb, - virLXCTeardownHostUsbDeviceCgroup, + virLXCTeardownHostUSBDeviceCgroup, priv->cgroup) < 0) VIR_WARN("cannot deny device %s for domain %s", src, vm->def->name); @@ -4730,7 +4730,7 @@ lxcDomainDetachDeviceHostdevUSBLive(virLXCDriverPtr driver, virDomainAuditHostdev(vm, def, "detach", true); if (virUSBDeviceFileIterate(usb, - virLXCTeardownHostUsbDeviceCgroup, + virLXCTeardownHostUSBDeviceCgroup, priv->cgroup) < 0) VIR_WARN("cannot deny device %s for domain %s", dst, vm->def->name); diff --git a/src/lxc/lxc_hostdev.c b/src/lxc/lxc_hostdev.c index d12013c..653a0a9 100644 --- a/src/lxc/lxc_hostdev.c +++ b/src/lxc/lxc_hostdev.c @@ -32,7 +32,7 @@ #define VIR_FROM_THIS VIR_FROM_LXC int -virLXCUpdateActiveUsbHostdevs(virLXCDriverPtr driver, +virLXCUpdateActiveUSBHostdevs(virLXCDriverPtr driver, virDomainDefPtr def) { virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr; @@ -116,7 +116,7 @@ int virLXCPrepareHostDevices(virLXCDriverPtr driver, static void -virLXCDomainReAttachHostUsbDevices(virLXCDriverPtr driver, +virLXCDomainReAttachHostUSBDevices(virLXCDriverPtr driver, const char *name, virDomainHostdevDefPtr *hostdevs, int nhostdevs) @@ -133,6 +133,6 @@ void virLXCDomainReAttachHostDevices(virLXCDriverPtr driver, if (!def->nhostdevs) return; - virLXCDomainReAttachHostUsbDevices(driver, def->name, def->hostdevs, + virLXCDomainReAttachHostUSBDevices(driver, def->name, def->hostdevs, def->nhostdevs); } diff --git a/src/lxc/lxc_hostdev.h b/src/lxc/lxc_hostdev.h index cf89a99..b3bc45e 100644 --- a/src/lxc/lxc_hostdev.h +++ b/src/lxc/lxc_hostdev.h @@ -27,7 +27,7 @@ # include "lxc_conf.h" # include "domain_conf.h" -int virLXCUpdateActiveUsbHostdevs(virLXCDriverPtr driver, +int virLXCUpdateActiveUSBHostdevs(virLXCDriverPtr driver, virDomainDefPtr def); int virLXCFindHostdevUSBDevice(virDomainHostdevDefPtr hostdev, bool mandatory, diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c index fcdcb2d..d278abc 100644 --- a/src/lxc/lxc_process.c +++ b/src/lxc/lxc_process.c @@ -1499,7 +1499,7 @@ virLXCProcessReconnectDomain(virDomainObjPtr vm, goto error; } - if (virLXCUpdateActiveUsbHostdevs(driver, vm->def) < 0) + if (virLXCUpdateActiveUSBHostdevs(driver, vm->def) < 0) goto error; if (virSecurityManagerReserveLabel(driver->securityManager, diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 66e8448..9601063 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1455,12 +1455,12 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsPixx4PM[] = { { "disable_s4", QEMU_CAPS_DISABLE_S4 }, }; -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsUsbRedir[] = { +static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsUSBRedir[] = { { "filter", QEMU_CAPS_USB_REDIR_FILTER }, { "bootindex", QEMU_CAPS_USB_REDIR_BOOTINDEX }, }; -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsUsbHost[] = { +static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsUSBHost[] = { { "bootindex", QEMU_CAPS_USB_HOST_BOOTINDEX }, }; @@ -1476,7 +1476,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQ35PciHost[] = { { "pci-hole64-size", QEMU_CAPS_Q35_PCI_HOLE64_SIZE }, }; -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsUsbStorage[] = { +static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsUSBStorage[] = { { "removable", QEMU_CAPS_USB_STORAGE_REMOVABLE }, }; @@ -1515,18 +1515,18 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = { ARRAY_CARDINALITY(virQEMUCapsObjectPropsIDEDrive) }, { "PIIX4_PM", virQEMUCapsObjectPropsPixx4PM, ARRAY_CARDINALITY(virQEMUCapsObjectPropsPixx4PM) }, - { "usb-redir", virQEMUCapsObjectPropsUsbRedir, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsUsbRedir) }, - { "usb-host", virQEMUCapsObjectPropsUsbHost, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsUsbHost) }, + { "usb-redir", virQEMUCapsObjectPropsUSBRedir, + ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBRedir) }, + { "usb-host", virQEMUCapsObjectPropsUSBHost, + ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBHost) }, { "scsi-generic", virQEMUCapsObjectPropsSCSIGeneric, ARRAY_CARDINALITY(virQEMUCapsObjectPropsSCSIGeneric) }, { "i440FX-pcihost", virQEMUCapsObjectPropsI440FXPciHost, ARRAY_CARDINALITY(virQEMUCapsObjectPropsI440FXPciHost) }, { "q35-pcihost", virQEMUCapsObjectPropsQ35PciHost, ARRAY_CARDINALITY(virQEMUCapsObjectPropsQ35PciHost) }, - { "usb-storage", virQEMUCapsObjectPropsUsbStorage, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsUsbStorage) }, + { "usb-storage", virQEMUCapsObjectPropsUSBStorage, + ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBStorage) }, { "kvm-pit", virQEMUCapsObjectPropsKVMPit, ARRAY_CARDINALITY(virQEMUCapsObjectPropsKVMPit) }, }; diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index 48a51f0..a65325b 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -183,7 +183,7 @@ qemuSetupTPMCgroup(virDomainDefPtr def, static int -qemuSetupHostUsbDeviceCgroup(virUSBDevicePtr dev ATTRIBUTE_UNUSED, +qemuSetupHostUSBDeviceCgroup(virUSBDevicePtr dev ATTRIBUTE_UNUSED, const char *path, void *opaque) { @@ -281,10 +281,10 @@ qemuSetupHostdevCGroup(virDomainObjPtr vm, goto cleanup; } - /* oddly, qemuSetupHostUsbDeviceCgroup doesn't ever + /* oddly, qemuSetupHostUSBDeviceCgroup doesn't ever * reference the usb object we just created */ - if (virUSBDeviceFileIterate(usb, qemuSetupHostUsbDeviceCgroup, + if (virUSBDeviceFileIterate(usb, qemuSetupHostUSBDeviceCgroup, vm) < 0) { goto cleanup; } diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 0f546f5..2582d7b 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2997,7 +2997,7 @@ error: } static void -qemuUsbId(virBufferPtr buf, int idx) +qemuUSBId(virBufferPtr buf, int idx) { if (idx == 0) virBufferAddLit(buf, "usb"); @@ -3094,7 +3094,7 @@ qemuBuildDeviceAddressStr(virBufferPtr buf, virBufferAsprintf(buf, ".0x%x", info->addr.pci.function); } else if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB) { virBufferAddLit(buf, ",bus="); - qemuUsbId(buf, info->addr.usb.bus); + qemuUSBId(buf, info->addr.usb.bus); virBufferAsprintf(buf, ".0,port=%s", info->addr.usb.port); } else if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO) { if (info->addr.spaprvio.has_reg) @@ -4782,11 +4782,11 @@ qemuBuildUSBControllerDevStr(virDomainDefPtr domainDef, if (def->info.mastertype == VIR_DOMAIN_CONTROLLER_MASTER_USB) { virBufferAddLit(buf, ",masterbus="); - qemuUsbId(buf, def->idx); + qemuUSBId(buf, def->idx); virBufferAsprintf(buf, ".0,firstport=%d", def->info.master.usb.startport); } else { virBufferAddLit(buf, ",id="); - qemuUsbId(buf, def->idx); + qemuUSBId(buf, def->idx); } return 0; @@ -5627,7 +5627,7 @@ qemuBuildRedirdevDevStr(virDomainDefPtr def, virBufferAddLit(&buf, ",filter="); for (i = 0; i < redirfilter->nusbdevs; i++) { - virDomainRedirFilterUsbDevDefPtr usbdev = redirfilter->usbdevs[i]; + virDomainRedirFilterUSBDevDefPtr usbdev = redirfilter->usbdevs[i]; if (usbdev->usbClass >= 0) virBufferAsprintf(&buf, "0x%02X:", usbdev->usbClass); else @@ -5759,7 +5759,7 @@ error: char * -qemuBuildUSBHostdevUsbDevStr(virDomainHostdevDefPtr dev) +qemuBuildUSBHostdevUSBDevStr(virDomainHostdevDefPtr dev) { char *ret = NULL; @@ -9455,7 +9455,7 @@ qemuBuildCommandLine(virConnectPtr conn, VIR_FREE(devstr); } else { virCommandAddArg(cmd, "-usbdevice"); - if (!(devstr = qemuBuildUSBHostdevUsbDevStr(hostdev))) + if (!(devstr = qemuBuildUSBHostdevUSBDevStr(hostdev))) goto error; virCommandAddArg(cmd, devstr); VIR_FREE(devstr); diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index ebb0b1d..d7ce574 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -161,7 +161,7 @@ char * qemuBuildPCIHostdevDevStr(virDomainDefPtr def, int qemuOpenPCIConfig(virDomainHostdevDefPtr dev); /* Legacy, pre device support */ -char * qemuBuildUSBHostdevUsbDevStr(virDomainHostdevDefPtr dev); +char * qemuBuildUSBHostdevUSBDevStr(virDomainHostdevDefPtr dev); /* Current, best practice */ char * qemuBuildUSBHostdevDevStr(virDomainDefPtr def, virDomainHostdevDefPtr dev, -- 1.8.5.3 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list