mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-09-09 09:14:57 +00:00
Capitalize USB, PCI and SCSI in hostdev methods
Change any method names with Usb, Pci or Scsi to use USB, PCI and SCSI since they are abbreviations. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
b4bbaeef41
commit
7be4bddea1
@ -1299,18 +1299,18 @@ virHookPresent;
|
||||
|
||||
#util/virhostdev.h
|
||||
virHostdevManagerGetDefault;
|
||||
virHostdevPciNodeDeviceDetach;
|
||||
virHostdevPciNodeDeviceReAttach;
|
||||
virHostdevPciNodeDeviceReset;
|
||||
virHostdevPCINodeDeviceDetach;
|
||||
virHostdevPCINodeDeviceReAttach;
|
||||
virHostdevPCINodeDeviceReset;
|
||||
virHostdevPreparePCIDevices;
|
||||
virHostdevPrepareSCSIDevices;
|
||||
virHostdevPrepareUSBDevices;
|
||||
virHostdevReAttachPCIDevices;
|
||||
virHostdevReAttachScsiHostdevs;
|
||||
virHostdevReAttachUsbHostdevs;
|
||||
virHostdevUpdateActivePciHostdevs;
|
||||
virHostdevUpdateActiveScsiHostdevs;
|
||||
virHostdevUpdateActiveUsbHostdevs;
|
||||
virHostdevReAttachSCSIHostdevs;
|
||||
virHostdevReAttachUSBHostdevs;
|
||||
virHostdevUpdateActivePCIHostdevs;
|
||||
virHostdevUpdateActiveSCSIHostdevs;
|
||||
virHostdevUpdateActiveUSBHostdevs;
|
||||
|
||||
# util/viridentity.h
|
||||
virIdentityGetAttr;
|
||||
|
@ -11231,7 +11231,7 @@ qemuDomainMigrateConfirm3Params(virDomainPtr domain,
|
||||
|
||||
|
||||
static int
|
||||
qemuNodeDeviceGetPciInfo(virNodeDeviceDefPtr def,
|
||||
qemuNodeDeviceGetPCIInfo(virNodeDeviceDefPtr def,
|
||||
unsigned *domain,
|
||||
unsigned *bus,
|
||||
unsigned *slot,
|
||||
@ -11292,7 +11292,7 @@ qemuNodeDeviceDetachFlags(virNodeDevicePtr dev,
|
||||
if (virNodeDeviceDetachFlagsEnsureACL(dev->conn, def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (qemuNodeDeviceGetPciInfo(def, &domain, &bus, &slot, &function) < 0)
|
||||
if (qemuNodeDeviceGetPCIInfo(def, &domain, &bus, &slot, &function) < 0)
|
||||
goto cleanup;
|
||||
|
||||
pci = virPCIDeviceNew(domain, bus, slot, function);
|
||||
@ -11336,7 +11336,7 @@ qemuNodeDeviceDetachFlags(virNodeDevicePtr dev,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
ret = virHostdevPciNodeDeviceDetach(hostdev_mgr, pci);
|
||||
ret = virHostdevPCINodeDeviceDetach(hostdev_mgr, pci);
|
||||
cleanup:
|
||||
virPCIDeviceFree(pci);
|
||||
virNodeDeviceDefFree(def);
|
||||
@ -11372,14 +11372,14 @@ qemuNodeDeviceReAttach(virNodeDevicePtr dev)
|
||||
if (virNodeDeviceReAttachEnsureACL(dev->conn, def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (qemuNodeDeviceGetPciInfo(def, &domain, &bus, &slot, &function) < 0)
|
||||
if (qemuNodeDeviceGetPCIInfo(def, &domain, &bus, &slot, &function) < 0)
|
||||
goto cleanup;
|
||||
|
||||
pci = virPCIDeviceNew(domain, bus, slot, function);
|
||||
if (!pci)
|
||||
goto cleanup;
|
||||
|
||||
ret = virHostdevPciNodeDeviceReAttach(hostdev_mgr, pci);
|
||||
ret = virHostdevPCINodeDeviceReAttach(hostdev_mgr, pci);
|
||||
|
||||
virPCIDeviceFree(pci);
|
||||
cleanup:
|
||||
@ -11410,14 +11410,14 @@ qemuNodeDeviceReset(virNodeDevicePtr dev)
|
||||
if (virNodeDeviceResetEnsureACL(dev->conn, def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (qemuNodeDeviceGetPciInfo(def, &domain, &bus, &slot, &function) < 0)
|
||||
if (qemuNodeDeviceGetPCIInfo(def, &domain, &bus, &slot, &function) < 0)
|
||||
goto cleanup;
|
||||
|
||||
pci = virPCIDeviceNew(domain, bus, slot, function);
|
||||
if (!pci)
|
||||
goto cleanup;
|
||||
|
||||
ret = virHostdevPciNodeDeviceReset(hostdev_mgr, pci);
|
||||
ret = virHostdevPCINodeDeviceReset(hostdev_mgr, pci);
|
||||
|
||||
virPCIDeviceFree(pci);
|
||||
cleanup:
|
||||
|
@ -42,7 +42,7 @@
|
||||
#define VIR_FROM_THIS VIR_FROM_QEMU
|
||||
|
||||
int
|
||||
qemuUpdateActivePciHostdevs(virQEMUDriverPtr driver,
|
||||
qemuUpdateActivePCIHostdevs(virQEMUDriverPtr driver,
|
||||
virDomainDefPtr def)
|
||||
{
|
||||
virHostdevManagerPtr mgr = driver->hostdevMgr;
|
||||
@ -50,11 +50,11 @@ qemuUpdateActivePciHostdevs(virQEMUDriverPtr driver,
|
||||
if (!def->nhostdevs)
|
||||
return 0;
|
||||
|
||||
return virHostdevUpdateActivePciHostdevs(mgr, QEMU_DRIVER_NAME, def);
|
||||
return virHostdevUpdateActivePCIHostdevs(mgr, QEMU_DRIVER_NAME, def);
|
||||
}
|
||||
|
||||
int
|
||||
qemuUpdateActiveUsbHostdevs(virQEMUDriverPtr driver,
|
||||
qemuUpdateActiveUSBHostdevs(virQEMUDriverPtr driver,
|
||||
virDomainDefPtr def)
|
||||
{
|
||||
virHostdevManagerPtr mgr = driver->hostdevMgr;
|
||||
@ -62,11 +62,11 @@ qemuUpdateActiveUsbHostdevs(virQEMUDriverPtr driver,
|
||||
if (!def->nhostdevs)
|
||||
return 0;
|
||||
|
||||
return virHostdevUpdateActiveUsbHostdevs(mgr, QEMU_DRIVER_NAME, def);
|
||||
return virHostdevUpdateActiveUSBHostdevs(mgr, QEMU_DRIVER_NAME, def);
|
||||
}
|
||||
|
||||
int
|
||||
qemuUpdateActiveScsiHostdevs(virQEMUDriverPtr driver,
|
||||
qemuUpdateActiveSCSIHostdevs(virQEMUDriverPtr driver,
|
||||
virDomainDefPtr def)
|
||||
{
|
||||
virHostdevManagerPtr mgr = driver->hostdevMgr;
|
||||
@ -74,7 +74,7 @@ qemuUpdateActiveScsiHostdevs(virQEMUDriverPtr driver,
|
||||
if (!def->nhostdevs)
|
||||
return 0;
|
||||
|
||||
return virHostdevUpdateActiveScsiHostdevs(mgr, QEMU_DRIVER_NAME, def);
|
||||
return virHostdevUpdateActiveSCSIHostdevs(mgr, QEMU_DRIVER_NAME, def);
|
||||
}
|
||||
|
||||
|
||||
@ -317,19 +317,19 @@ qemuDomainReAttachHostdevDevices(virQEMUDriverPtr driver,
|
||||
}
|
||||
|
||||
void
|
||||
qemuDomainReAttachHostUsbDevices(virQEMUDriverPtr driver,
|
||||
qemuDomainReAttachHostUSBDevices(virQEMUDriverPtr driver,
|
||||
const char *name,
|
||||
virDomainHostdevDefPtr *hostdevs,
|
||||
int nhostdevs)
|
||||
{
|
||||
virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr;
|
||||
|
||||
virHostdevReAttachUsbHostdevs(hostdev_mgr, QEMU_DRIVER_NAME,
|
||||
virHostdevReAttachUSBHostdevs(hostdev_mgr, QEMU_DRIVER_NAME,
|
||||
name, hostdevs, nhostdevs);
|
||||
}
|
||||
|
||||
void
|
||||
qemuDomainReAttachHostScsiDevices(virQEMUDriverPtr driver,
|
||||
qemuDomainReAttachHostSCSIDevices(virQEMUDriverPtr driver,
|
||||
const char *name,
|
||||
virDomainHostdevDefPtr *hostdevs,
|
||||
int nhostdevs)
|
||||
@ -347,7 +347,7 @@ qemuDomainReAttachHostScsiDevices(virQEMUDriverPtr driver,
|
||||
ignore_value(qemuRemoveSharedDevice(driver, &dev, name));
|
||||
}
|
||||
|
||||
virHostdevReAttachScsiHostdevs(hostdev_mgr, QEMU_DRIVER_NAME,
|
||||
virHostdevReAttachSCSIHostdevs(hostdev_mgr, QEMU_DRIVER_NAME,
|
||||
name, hostdevs, nhostdevs);
|
||||
}
|
||||
|
||||
@ -361,9 +361,9 @@ qemuDomainReAttachHostDevices(virQEMUDriverPtr driver,
|
||||
qemuDomainReAttachHostdevDevices(driver, def->name, def->hostdevs,
|
||||
def->nhostdevs);
|
||||
|
||||
qemuDomainReAttachHostUsbDevices(driver, def->name, def->hostdevs,
|
||||
qemuDomainReAttachHostUSBDevices(driver, def->name, def->hostdevs,
|
||||
def->nhostdevs);
|
||||
|
||||
qemuDomainReAttachHostScsiDevices(driver, def->name, def->hostdevs,
|
||||
qemuDomainReAttachHostSCSIDevices(driver, def->name, def->hostdevs,
|
||||
def->nhostdevs);
|
||||
}
|
||||
|
@ -27,11 +27,11 @@
|
||||
# include "qemu_conf.h"
|
||||
# include "domain_conf.h"
|
||||
|
||||
int qemuUpdateActivePciHostdevs(virQEMUDriverPtr driver,
|
||||
int qemuUpdateActivePCIHostdevs(virQEMUDriverPtr driver,
|
||||
virDomainDefPtr def);
|
||||
int qemuUpdateActiveUsbHostdevs(virQEMUDriverPtr driver,
|
||||
int qemuUpdateActiveUSBHostdevs(virQEMUDriverPtr driver,
|
||||
virDomainDefPtr def);
|
||||
int qemuUpdateActiveScsiHostdevs(virQEMUDriverPtr driver,
|
||||
int qemuUpdateActiveSCSIHostdevs(virQEMUDriverPtr driver,
|
||||
virDomainDefPtr def);
|
||||
bool qemuHostdevHostSupportsPassthroughLegacy(void);
|
||||
bool qemuHostdevHostSupportsPassthroughVFIO(void);
|
||||
@ -57,11 +57,11 @@ int qemuPrepareHostDevices(virQEMUDriverPtr driver,
|
||||
virQEMUCapsPtr qemuCaps,
|
||||
unsigned int flags);
|
||||
void
|
||||
qemuDomainReAttachHostUsbDevices(virQEMUDriverPtr driver,
|
||||
qemuDomainReAttachHostUSBDevices(virQEMUDriverPtr driver,
|
||||
const char *name,
|
||||
virDomainHostdevDefPtr *hostdevs,
|
||||
int nhostdevs);
|
||||
void qemuDomainReAttachHostScsiDevices(virQEMUDriverPtr driver,
|
||||
void qemuDomainReAttachHostSCSIDevices(virQEMUDriverPtr driver,
|
||||
const char *name,
|
||||
virDomainHostdevDefPtr *hostdevs,
|
||||
int nhostdevs);
|
||||
|
@ -597,7 +597,7 @@ error:
|
||||
|
||||
|
||||
static int
|
||||
qemuDomainAttachUsbMassstorageDevice(virConnectPtr conn,
|
||||
qemuDomainAttachUSBMassstorageDevice(virConnectPtr conn,
|
||||
virQEMUDriverPtr driver,
|
||||
virDomainObjPtr vm,
|
||||
virDomainDiskDefPtr disk)
|
||||
@ -769,7 +769,7 @@ qemuDomainAttachDeviceDiskLive(virConnectPtr conn,
|
||||
_("disk device='lun' is not supported for usb bus"));
|
||||
break;
|
||||
}
|
||||
ret = qemuDomainAttachUsbMassstorageDevice(conn, driver, vm,
|
||||
ret = qemuDomainAttachUSBMassstorageDevice(conn, driver, vm,
|
||||
disk);
|
||||
} else if (disk->bus == VIR_DOMAIN_DISK_BUS_VIRTIO) {
|
||||
ret = qemuDomainAttachVirtioDiskDevice(conn, driver, vm, disk);
|
||||
@ -1147,7 +1147,7 @@ try_remove:
|
||||
|
||||
|
||||
static int
|
||||
qemuDomainAttachHostPciDevice(virQEMUDriverPtr driver,
|
||||
qemuDomainAttachHostPCIDevice(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr vm,
|
||||
virDomainHostdevDefPtr hostdev)
|
||||
{
|
||||
@ -1463,7 +1463,7 @@ cleanup:
|
||||
}
|
||||
|
||||
static int
|
||||
qemuDomainAttachHostUsbDevice(virQEMUDriverPtr driver,
|
||||
qemuDomainAttachHostUSBDevice(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr vm,
|
||||
virDomainHostdevDefPtr hostdev)
|
||||
{
|
||||
@ -1522,14 +1522,14 @@ cleanup:
|
||||
vm->def, hostdev, NULL) < 0)
|
||||
VIR_WARN("Unable to restore host device labelling on hotplug fail");
|
||||
if (added)
|
||||
qemuDomainReAttachHostUsbDevices(driver, vm->def->name, &hostdev, 1);
|
||||
qemuDomainReAttachHostUSBDevices(driver, vm->def->name, &hostdev, 1);
|
||||
}
|
||||
VIR_FREE(devstr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
qemuDomainAttachHostScsiDevice(virQEMUDriverPtr driver,
|
||||
qemuDomainAttachHostSCSIDevice(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr vm,
|
||||
virDomainHostdevDefPtr hostdev)
|
||||
{
|
||||
@ -1611,7 +1611,7 @@ qemuDomainAttachHostScsiDevice(virQEMUDriverPtr driver,
|
||||
ret = 0;
|
||||
cleanup:
|
||||
if (ret < 0) {
|
||||
qemuDomainReAttachHostScsiDevices(driver, vm->def->name, &hostdev, 1);
|
||||
qemuDomainReAttachHostSCSIDevices(driver, vm->def->name, &hostdev, 1);
|
||||
if (teardowncgroup && qemuTeardownHostdevCgroup(vm, hostdev) < 0)
|
||||
VIR_WARN("Unable to remove host device cgroup ACL on hotplug fail");
|
||||
if (teardownlabel &&
|
||||
@ -1637,19 +1637,19 @@ int qemuDomainAttachHostDevice(virQEMUDriverPtr driver,
|
||||
|
||||
switch (hostdev->source.subsys.type) {
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
|
||||
if (qemuDomainAttachHostPciDevice(driver, vm,
|
||||
if (qemuDomainAttachHostPCIDevice(driver, vm,
|
||||
hostdev) < 0)
|
||||
goto error;
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
|
||||
if (qemuDomainAttachHostUsbDevice(driver, vm,
|
||||
if (qemuDomainAttachHostUSBDevice(driver, vm,
|
||||
hostdev) < 0)
|
||||
goto error;
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
|
||||
if (qemuDomainAttachHostScsiDevice(driver, vm,
|
||||
if (qemuDomainAttachHostSCSIDevice(driver, vm,
|
||||
hostdev) < 0)
|
||||
goto error;
|
||||
break;
|
||||
@ -2537,7 +2537,7 @@ qemuDomainRemoveUSBHostDevice(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr vm,
|
||||
virDomainHostdevDefPtr hostdev)
|
||||
{
|
||||
qemuDomainReAttachHostUsbDevices(driver, vm->def->name, &hostdev, 1);
|
||||
qemuDomainReAttachHostUSBDevices(driver, vm->def->name, &hostdev, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -2545,7 +2545,7 @@ qemuDomainRemoveSCSIHostDevice(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr vm,
|
||||
virDomainHostdevDefPtr hostdev)
|
||||
{
|
||||
qemuDomainReAttachHostScsiDevices(driver, vm->def->name, &hostdev, 1);
|
||||
qemuDomainReAttachHostSCSIDevices(driver, vm->def->name, &hostdev, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -3123,7 +3123,7 @@ cleanup:
|
||||
}
|
||||
|
||||
static int
|
||||
qemuDomainDetachHostPciDevice(virQEMUDriverPtr driver,
|
||||
qemuDomainDetachHostPCIDevice(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr vm,
|
||||
virDomainHostdevDefPtr detach)
|
||||
{
|
||||
@ -3160,7 +3160,7 @@ qemuDomainDetachHostPciDevice(virQEMUDriverPtr driver,
|
||||
}
|
||||
|
||||
static int
|
||||
qemuDomainDetachHostUsbDevice(virQEMUDriverPtr driver,
|
||||
qemuDomainDetachHostUSBDevice(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr vm,
|
||||
virDomainHostdevDefPtr detach)
|
||||
{
|
||||
@ -3189,7 +3189,7 @@ qemuDomainDetachHostUsbDevice(virQEMUDriverPtr driver,
|
||||
}
|
||||
|
||||
static int
|
||||
qemuDomainDetachHostScsiDevice(virQEMUDriverPtr driver,
|
||||
qemuDomainDetachHostSCSIDevice(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr vm,
|
||||
virDomainHostdevDefPtr detach)
|
||||
{
|
||||
@ -3249,13 +3249,13 @@ qemuDomainDetachThisHostDevice(virQEMUDriverPtr driver,
|
||||
|
||||
switch (detach->source.subsys.type) {
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
|
||||
ret = qemuDomainDetachHostPciDevice(driver, vm, detach);
|
||||
ret = qemuDomainDetachHostPCIDevice(driver, vm, detach);
|
||||
break;
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
|
||||
ret = qemuDomainDetachHostUsbDevice(driver, vm, detach);
|
||||
ret = qemuDomainDetachHostUSBDevice(driver, vm, detach);
|
||||
break;
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
|
||||
ret = qemuDomainDetachHostScsiDevice(driver, vm, detach);
|
||||
ret = qemuDomainDetachHostSCSIDevice(driver, vm, detach);
|
||||
break;
|
||||
default:
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
|
@ -3158,14 +3158,14 @@ qemuProcessReconnect(void *opaque)
|
||||
priv->agentError = true;
|
||||
}
|
||||
|
||||
if (qemuUpdateActivePciHostdevs(driver, obj->def) < 0) {
|
||||
if (qemuUpdateActivePCIHostdevs(driver, obj->def) < 0) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (qemuUpdateActiveUsbHostdevs(driver, obj->def) < 0)
|
||||
if (qemuUpdateActiveUSBHostdevs(driver, obj->def) < 0)
|
||||
goto error;
|
||||
|
||||
if (qemuUpdateActiveScsiHostdevs(driver, obj->def) < 0)
|
||||
if (qemuUpdateActiveSCSIHostdevs(driver, obj->def) < 0)
|
||||
goto error;
|
||||
|
||||
if (qemuConnectCgroup(driver, obj) < 0)
|
||||
|
@ -131,7 +131,7 @@ virHostdevManagerGetDefault(void)
|
||||
}
|
||||
|
||||
static virPCIDeviceListPtr
|
||||
virHostdevGetPciHostDeviceList(virDomainHostdevDefPtr *hostdevs, int nhostdevs)
|
||||
virHostdevGetPCIHostDeviceList(virDomainHostdevDefPtr *hostdevs, int nhostdevs)
|
||||
{
|
||||
virPCIDeviceListPtr list;
|
||||
size_t i;
|
||||
@ -183,7 +183,7 @@ virHostdevGetPciHostDeviceList(virDomainHostdevDefPtr *hostdevs, int nhostdevs)
|
||||
|
||||
|
||||
/*
|
||||
* virHostdevGetActivePciHostDeviceList - make a new list with a *copy* of
|
||||
* virHostdevGetActivePCIHostDeviceList - make a new list with a *copy* of
|
||||
* every virPCIDevice object that is found on the activePciHostdevs
|
||||
* list *and* is in the hostdev list for this domain.
|
||||
*
|
||||
@ -192,7 +192,7 @@ virHostdevGetPciHostDeviceList(virDomainHostdevDefPtr *hostdevs, int nhostdevs)
|
||||
* Pre-condition: activePciHostdevs is locked
|
||||
*/
|
||||
static virPCIDeviceListPtr
|
||||
virHostdevGetActivePciHostDeviceList(virHostdevManagerPtr mgr,
|
||||
virHostdevGetActivePCIHostDeviceList(virHostdevManagerPtr mgr,
|
||||
virDomainHostdevDefPtr *hostdevs,
|
||||
int nhostdevs)
|
||||
{
|
||||
@ -226,7 +226,7 @@ virHostdevGetActivePciHostDeviceList(virHostdevManagerPtr mgr,
|
||||
}
|
||||
|
||||
static int
|
||||
virHostdevPciSysfsPath(virDomainHostdevDefPtr hostdev,
|
||||
virHostdevPCISysfsPath(virDomainHostdevDefPtr hostdev,
|
||||
char **sysfs_path)
|
||||
{
|
||||
virPCIDeviceAddress config_address;
|
||||
@ -246,7 +246,7 @@ virHostdevIsVirtualFunction(virDomainHostdevDefPtr hostdev)
|
||||
char *sysfs_path = NULL;
|
||||
int ret = -1;
|
||||
|
||||
if (virHostdevPciSysfsPath(hostdev, &sysfs_path) < 0)
|
||||
if (virHostdevPCISysfsPath(hostdev, &sysfs_path) < 0)
|
||||
return ret;
|
||||
|
||||
ret = virPCIIsVirtualFunction(sysfs_path);
|
||||
@ -264,7 +264,7 @@ virHostdevNetDevice(virDomainHostdevDefPtr hostdev, char **linkdev,
|
||||
int ret = -1;
|
||||
char *sysfs_path = NULL;
|
||||
|
||||
if (virHostdevPciSysfsPath(hostdev, &sysfs_path) < 0)
|
||||
if (virHostdevPCISysfsPath(hostdev, &sysfs_path) < 0)
|
||||
return ret;
|
||||
|
||||
if (virPCIIsVirtualFunction(sysfs_path) == 1) {
|
||||
@ -468,7 +468,7 @@ virHostdevPreparePCIDevices(virHostdevManagerPtr hostdev_mgr,
|
||||
virObjectLock(hostdev_mgr->activePciHostdevs);
|
||||
virObjectLock(hostdev_mgr->inactivePciHostdevs);
|
||||
|
||||
if (!(pcidevs = virHostdevGetPciHostDeviceList(hostdevs, nhostdevs)))
|
||||
if (!(pcidevs = virHostdevGetPCIHostDeviceList(hostdevs, nhostdevs)))
|
||||
goto cleanup;
|
||||
|
||||
/* We have to use 9 loops here. *All* devices must
|
||||
@ -654,7 +654,7 @@ cleanup:
|
||||
* are locked
|
||||
*/
|
||||
static void
|
||||
virHostdevReattachPciDevice(virPCIDevicePtr dev, virHostdevManagerPtr mgr)
|
||||
virHostdevReattachPCIDevice(virPCIDevicePtr dev, virHostdevManagerPtr mgr)
|
||||
{
|
||||
/* If the device is not managed and was attached to guest
|
||||
* successfully, it must have been inactive.
|
||||
@ -702,7 +702,7 @@ virHostdevReAttachPCIDevices(virHostdevManagerPtr hostdev_mgr,
|
||||
virObjectLock(hostdev_mgr->activePciHostdevs);
|
||||
virObjectLock(hostdev_mgr->inactivePciHostdevs);
|
||||
|
||||
if (!(pcidevs = virHostdevGetActivePciHostDeviceList(hostdev_mgr,
|
||||
if (!(pcidevs = virHostdevGetActivePCIHostDeviceList(hostdev_mgr,
|
||||
hostdevs,
|
||||
nhostdevs))) {
|
||||
virErrorPtr err = virGetLastError();
|
||||
@ -765,7 +765,7 @@ virHostdevReAttachPCIDevices(virHostdevManagerPtr hostdev_mgr,
|
||||
|
||||
while (virPCIDeviceListCount(pcidevs) > 0) {
|
||||
virPCIDevicePtr dev = virPCIDeviceListStealIndex(pcidevs, 0);
|
||||
virHostdevReattachPciDevice(dev, hostdev_mgr);
|
||||
virHostdevReattachPCIDevice(dev, hostdev_mgr);
|
||||
}
|
||||
|
||||
virObjectUnref(pcidevs);
|
||||
@ -775,7 +775,7 @@ cleanup:
|
||||
}
|
||||
|
||||
int
|
||||
virHostdevUpdateActivePciHostdevs(virHostdevManagerPtr mgr,
|
||||
virHostdevUpdateActivePCIHostdevs(virHostdevManagerPtr mgr,
|
||||
const char *drv_name,
|
||||
virDomainDefPtr def)
|
||||
{
|
||||
@ -834,7 +834,7 @@ cleanup:
|
||||
}
|
||||
|
||||
int
|
||||
virHostdevUpdateActiveUsbHostdevs(virHostdevManagerPtr mgr,
|
||||
virHostdevUpdateActiveUSBHostdevs(virHostdevManagerPtr mgr,
|
||||
const char *drv_name,
|
||||
virDomainDefPtr def)
|
||||
{
|
||||
@ -877,7 +877,7 @@ cleanup:
|
||||
}
|
||||
|
||||
int
|
||||
virHostdevUpdateActiveScsiHostdevs(virHostdevManagerPtr mgr,
|
||||
virHostdevUpdateActiveSCSIHostdevs(virHostdevManagerPtr mgr,
|
||||
const char *drv_name,
|
||||
virDomainDefPtr def)
|
||||
{
|
||||
@ -926,7 +926,7 @@ cleanup:
|
||||
}
|
||||
|
||||
static int
|
||||
virHostdevMarkUsbHostdevs(virHostdevManagerPtr mgr,
|
||||
virHostdevMarkUSBHostdevs(virHostdevManagerPtr mgr,
|
||||
const char *drv_name,
|
||||
const char *dom_name,
|
||||
virUSBDeviceListPtr list)
|
||||
@ -1123,7 +1123,7 @@ virHostdevPrepareUSBDevices(virHostdevManagerPtr hostdev_mgr,
|
||||
* and add them do driver list. However, if something goes
|
||||
* wrong, perform rollback.
|
||||
*/
|
||||
if (virHostdevMarkUsbHostdevs(hostdev_mgr, drv_name, dom_name, list) < 0)
|
||||
if (virHostdevMarkUSBHostdevs(hostdev_mgr, drv_name, dom_name, list) < 0)
|
||||
goto cleanup;
|
||||
|
||||
/* Loop 2: Temporary list was successfully merged with
|
||||
@ -1254,7 +1254,7 @@ cleanup:
|
||||
}
|
||||
|
||||
void
|
||||
virHostdevReAttachUsbHostdevs(virHostdevManagerPtr hostdev_mgr,
|
||||
virHostdevReAttachUSBHostdevs(virHostdevManagerPtr hostdev_mgr,
|
||||
const char *drv_name,
|
||||
const char *dom_name,
|
||||
virDomainHostdevDefPtr *hostdevs,
|
||||
@ -1320,7 +1320,7 @@ virHostdevReAttachUsbHostdevs(virHostdevManagerPtr hostdev_mgr,
|
||||
}
|
||||
|
||||
void
|
||||
virHostdevReAttachScsiHostdevs(virHostdevManagerPtr hostdev_mgr,
|
||||
virHostdevReAttachSCSIHostdevs(virHostdevManagerPtr hostdev_mgr,
|
||||
const char *drv_name,
|
||||
const char *dom_name,
|
||||
virDomainHostdevDefPtr *hostdevs,
|
||||
@ -1383,7 +1383,7 @@ virHostdevReAttachScsiHostdevs(virHostdevManagerPtr hostdev_mgr,
|
||||
}
|
||||
|
||||
int
|
||||
virHostdevPciNodeDeviceDetach(virHostdevManagerPtr hostdev_mgr,
|
||||
virHostdevPCINodeDeviceDetach(virHostdevManagerPtr hostdev_mgr,
|
||||
virPCIDevicePtr pci)
|
||||
{
|
||||
int ret = -1;
|
||||
@ -1404,7 +1404,7 @@ out:
|
||||
}
|
||||
|
||||
int
|
||||
virHostdevPciNodeDeviceReAttach(virHostdevManagerPtr hostdev_mgr,
|
||||
virHostdevPCINodeDeviceReAttach(virHostdevManagerPtr hostdev_mgr,
|
||||
virPCIDevicePtr pci)
|
||||
{
|
||||
virPCIDevicePtr other;
|
||||
@ -1445,7 +1445,7 @@ out:
|
||||
}
|
||||
|
||||
int
|
||||
virHostdevPciNodeDeviceReset(virHostdevManagerPtr hostdev_mgr,
|
||||
virHostdevPCINodeDeviceReset(virHostdevManagerPtr hostdev_mgr,
|
||||
virPCIDevicePtr pci)
|
||||
{
|
||||
int ret = -1;
|
||||
|
@ -79,36 +79,36 @@ virHostdevReAttachPCIDevices(virHostdevManagerPtr hostdev_mgr,
|
||||
int nhostdevs,
|
||||
const char *oldStateDir);
|
||||
void
|
||||
virHostdevReAttachUsbHostdevs(virHostdevManagerPtr hostdev_mgr,
|
||||
virHostdevReAttachUSBHostdevs(virHostdevManagerPtr hostdev_mgr,
|
||||
const char *drv_name,
|
||||
const char *dom_name,
|
||||
virDomainHostdevDefPtr *hostdevs,
|
||||
int nhostdevs);
|
||||
void
|
||||
virHostdevReAttachScsiHostdevs(virHostdevManagerPtr hostdev_mgr,
|
||||
virHostdevReAttachSCSIHostdevs(virHostdevManagerPtr hostdev_mgr,
|
||||
const char *drv_name,
|
||||
const char *dom_name,
|
||||
virDomainHostdevDefPtr *hostdevs,
|
||||
int nhostdevs);
|
||||
int
|
||||
virHostdevUpdateActivePciHostdevs(virHostdevManagerPtr mgr,
|
||||
virHostdevUpdateActivePCIHostdevs(virHostdevManagerPtr mgr,
|
||||
const char *drv_name,
|
||||
virDomainDefPtr def);
|
||||
int
|
||||
virHostdevUpdateActiveUsbHostdevs(virHostdevManagerPtr mgr,
|
||||
virHostdevUpdateActiveUSBHostdevs(virHostdevManagerPtr mgr,
|
||||
const char *drv_name,
|
||||
virDomainDefPtr def);
|
||||
int
|
||||
virHostdevUpdateActiveScsiHostdevs(virHostdevManagerPtr mgr,
|
||||
virHostdevUpdateActiveSCSIHostdevs(virHostdevManagerPtr mgr,
|
||||
const char *drv_name,
|
||||
virDomainDefPtr def);
|
||||
|
||||
/* functions used by NodeDevDetach/Reattach/Reset */
|
||||
int virHostdevPciNodeDeviceDetach(virHostdevManagerPtr mgr,
|
||||
int virHostdevPCINodeDeviceDetach(virHostdevManagerPtr mgr,
|
||||
virPCIDevicePtr pci);
|
||||
int virHostdevPciNodeDeviceReAttach(virHostdevManagerPtr mgr,
|
||||
int virHostdevPCINodeDeviceReAttach(virHostdevManagerPtr mgr,
|
||||
virPCIDevicePtr pci);
|
||||
int virHostdevPciNodeDeviceReset(virHostdevManagerPtr mgr,
|
||||
int virHostdevPCINodeDeviceReset(virHostdevManagerPtr mgr,
|
||||
virPCIDevicePtr pci);
|
||||
|
||||
#endif /* __VIR_HOSTDEV_H__ */
|
||||
|
Loading…
Reference in New Issue
Block a user