mirror of https://gitee.com/openkylin/libvirt.git
Replace Pci with PCI throughout
Since it is an abbreviation, PCI should always be fully capitalized or full lower case, never Pci. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
edfe82c7f9
commit
3cfa19da22
|
@ -32,7 +32,7 @@
|
||||||
|
|
||||||
#define VIR_FROM_THIS VIR_FROM_DEVICE
|
#define VIR_FROM_THIS VIR_FROM_DEVICE
|
||||||
|
|
||||||
VIR_ENUM_IMPL(virDeviceAddressPciMulti,
|
VIR_ENUM_IMPL(virDeviceAddressPCIMulti,
|
||||||
VIR_DEVICE_ADDRESS_PCI_MULTI_LAST,
|
VIR_DEVICE_ADDRESS_PCI_MULTI_LAST,
|
||||||
"default",
|
"default",
|
||||||
"on",
|
"on",
|
||||||
|
@ -91,7 +91,7 @@ virDevicePCIAddressParseXML(xmlNodePtr node,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (multi &&
|
if (multi &&
|
||||||
((addr->multi = virDeviceAddressPciMultiTypeFromString(multi)) <= 0)) {
|
((addr->multi = virDeviceAddressPCIMultiTypeFromString(multi)) <= 0)) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("Unknown value '%s' for <address> 'multifunction' attribute"),
|
_("Unknown value '%s' for <address> 'multifunction' attribute"),
|
||||||
multi);
|
multi);
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
# include "virthread.h"
|
# include "virthread.h"
|
||||||
# include "virbuffer.h"
|
# include "virbuffer.h"
|
||||||
|
|
||||||
enum virDeviceAddressPciMulti {
|
enum virDeviceAddressPCIMulti {
|
||||||
VIR_DEVICE_ADDRESS_PCI_MULTI_DEFAULT = 0,
|
VIR_DEVICE_ADDRESS_PCI_MULTI_DEFAULT = 0,
|
||||||
VIR_DEVICE_ADDRESS_PCI_MULTI_ON,
|
VIR_DEVICE_ADDRESS_PCI_MULTI_ON,
|
||||||
VIR_DEVICE_ADDRESS_PCI_MULTI_OFF,
|
VIR_DEVICE_ADDRESS_PCI_MULTI_OFF,
|
||||||
|
@ -47,7 +47,7 @@ struct _virDevicePCIAddress {
|
||||||
unsigned int bus;
|
unsigned int bus;
|
||||||
unsigned int slot;
|
unsigned int slot;
|
||||||
unsigned int function;
|
unsigned int function;
|
||||||
int multi; /* enum virDomainDeviceAddressPciMulti */
|
int multi; /* enum virDomainDeviceAddressPCIMulti */
|
||||||
};
|
};
|
||||||
|
|
||||||
int virDevicePCIAddressIsValid(virDevicePCIAddressPtr addr);
|
int virDevicePCIAddressIsValid(virDevicePCIAddressPtr addr);
|
||||||
|
@ -63,6 +63,6 @@ bool virDevicePCIAddressEqual(virDevicePCIAddress *addr1,
|
||||||
virDevicePCIAddress *addr2);
|
virDevicePCIAddress *addr2);
|
||||||
|
|
||||||
|
|
||||||
VIR_ENUM_DECL(virDeviceAddressPciMulti)
|
VIR_ENUM_DECL(virDeviceAddressPCIMulti)
|
||||||
|
|
||||||
#endif /* __DEVICE_CONF_H__ */
|
#endif /* __DEVICE_CONF_H__ */
|
||||||
|
|
|
@ -597,7 +597,7 @@ VIR_ENUM_IMPL(virDomainHostdevSubsys, VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST,
|
||||||
"pci",
|
"pci",
|
||||||
"scsi")
|
"scsi")
|
||||||
|
|
||||||
VIR_ENUM_IMPL(virDomainHostdevSubsysPciBackend,
|
VIR_ENUM_IMPL(virDomainHostdevSubsysPCIBackend,
|
||||||
VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_LAST,
|
VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_LAST,
|
||||||
"default",
|
"default",
|
||||||
"kvm",
|
"kvm",
|
||||||
|
@ -609,7 +609,7 @@ VIR_ENUM_IMPL(virDomainHostdevCaps, VIR_DOMAIN_HOSTDEV_CAPS_TYPE_LAST,
|
||||||
"misc",
|
"misc",
|
||||||
"net")
|
"net")
|
||||||
|
|
||||||
VIR_ENUM_IMPL(virDomainPciRombarMode,
|
VIR_ENUM_IMPL(virDomainPCIRombarMode,
|
||||||
VIR_DOMAIN_PCI_ROMBAR_LAST,
|
VIR_DOMAIN_PCI_ROMBAR_LAST,
|
||||||
"default",
|
"default",
|
||||||
"on",
|
"on",
|
||||||
|
@ -3164,7 +3164,7 @@ virDomainDeviceInfoFormat(virBufferPtr buf,
|
||||||
virBufferAddLit(buf, "<rom");
|
virBufferAddLit(buf, "<rom");
|
||||||
if (info->rombar) {
|
if (info->rombar) {
|
||||||
|
|
||||||
const char *rombar = virDomainPciRombarModeTypeToString(info->rombar);
|
const char *rombar = virDomainPCIRombarModeTypeToString(info->rombar);
|
||||||
|
|
||||||
if (!rombar) {
|
if (!rombar) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
@ -3196,7 +3196,7 @@ virDomainDeviceInfoFormat(virBufferPtr buf,
|
||||||
info->addr.pci.function);
|
info->addr.pci.function);
|
||||||
if (info->addr.pci.multi) {
|
if (info->addr.pci.multi) {
|
||||||
virBufferAsprintf(buf, " multifunction='%s'",
|
virBufferAsprintf(buf, " multifunction='%s'",
|
||||||
virDeviceAddressPciMultiTypeToString(info->addr.pci.multi));
|
virDeviceAddressPCIMultiTypeToString(info->addr.pci.multi));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -3681,7 +3681,7 @@ virDomainDeviceInfoParseXML(xmlNodePtr node,
|
||||||
if (rom) {
|
if (rom) {
|
||||||
char *rombar = virXMLPropString(rom, "bar");
|
char *rombar = virXMLPropString(rom, "bar");
|
||||||
if (rombar &&
|
if (rombar &&
|
||||||
((info->rombar = virDomainPciRombarModeTypeFromString(rombar)) <= 0)) {
|
((info->rombar = virDomainPCIRombarModeTypeFromString(rombar)) <= 0)) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("unknown rom bar value '%s'"), rombar);
|
_("unknown rom bar value '%s'"), rombar);
|
||||||
VIR_FREE(rombar);
|
VIR_FREE(rombar);
|
||||||
|
@ -3939,7 +3939,7 @@ virDomainHostdevSubsysUSBDefParseXML(xmlNodePtr node,
|
||||||
* </origstates>
|
* </origstates>
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
virDomainHostdevSubsysPciOrigStatesDefParseXML(xmlNodePtr node,
|
virDomainHostdevSubsysPCIOrigStatesDefParseXML(xmlNodePtr node,
|
||||||
virDomainHostdevOrigStatesPtr def)
|
virDomainHostdevOrigStatesPtr def)
|
||||||
{
|
{
|
||||||
xmlNodePtr cur;
|
xmlNodePtr cur;
|
||||||
|
@ -3967,7 +3967,7 @@ virDomainHostdevSubsysPciOrigStatesDefParseXML(xmlNodePtr node,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
virDomainHostdevSubsysPciDefParseXML(xmlNodePtr node,
|
virDomainHostdevSubsysPCIDefParseXML(xmlNodePtr node,
|
||||||
virDomainHostdevDefPtr def,
|
virDomainHostdevDefPtr def,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
|
@ -4000,7 +4000,7 @@ virDomainHostdevSubsysPciDefParseXML(xmlNodePtr node,
|
||||||
} else if ((flags & VIR_DOMAIN_XML_INTERNAL_PCI_ORIG_STATES) &&
|
} else if ((flags & VIR_DOMAIN_XML_INTERNAL_PCI_ORIG_STATES) &&
|
||||||
xmlStrEqual(cur->name, BAD_CAST "origstates")) {
|
xmlStrEqual(cur->name, BAD_CAST "origstates")) {
|
||||||
virDomainHostdevOrigStatesPtr states = &def->origstates;
|
virDomainHostdevOrigStatesPtr states = &def->origstates;
|
||||||
if (virDomainHostdevSubsysPciOrigStatesDefParseXML(cur, states) < 0)
|
if (virDomainHostdevSubsysPCIOrigStatesDefParseXML(cur, states) < 0)
|
||||||
goto out;
|
goto out;
|
||||||
} else {
|
} else {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
@ -4320,12 +4320,12 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
|
||||||
|
|
||||||
switch (def->source.subsys.type) {
|
switch (def->source.subsys.type) {
|
||||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
|
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
|
||||||
if (virDomainHostdevSubsysPciDefParseXML(sourcenode, def, flags) < 0)
|
if (virDomainHostdevSubsysPCIDefParseXML(sourcenode, def, flags) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
backend = VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT;
|
backend = VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT;
|
||||||
if ((backendStr = virXPathString("string(./driver/@name)", ctxt)) &&
|
if ((backendStr = virXPathString("string(./driver/@name)", ctxt)) &&
|
||||||
(((backend = virDomainHostdevSubsysPciBackendTypeFromString(backendStr)) < 0) ||
|
(((backend = virDomainHostdevSubsysPCIBackendTypeFromString(backendStr)) < 0) ||
|
||||||
backend == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT)) {
|
backend == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT)) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("Unknown PCI device <driver name='%s'/> "
|
_("Unknown PCI device <driver name='%s'/> "
|
||||||
|
@ -15327,7 +15327,7 @@ virDomainHostdevDefFormatSubsys(virBufferPtr buf,
|
||||||
{
|
{
|
||||||
if (def->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI &&
|
if (def->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI &&
|
||||||
def->source.subsys.u.pci.backend != VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT) {
|
def->source.subsys.u.pci.backend != VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT) {
|
||||||
const char *backend = virDomainHostdevSubsysPciBackendTypeToString(def->source.subsys.u.pci.backend);
|
const char *backend = virDomainHostdevSubsysPCIBackendTypeToString(def->source.subsys.u.pci.backend);
|
||||||
|
|
||||||
if (!backend) {
|
if (!backend) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
|
|
@ -218,7 +218,7 @@ enum virDomainDeviceAddressType {
|
||||||
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_LAST
|
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_LAST
|
||||||
};
|
};
|
||||||
|
|
||||||
enum virDomainPciRombarMode {
|
enum virDomainPCIRombarMode {
|
||||||
VIR_DOMAIN_PCI_ROMBAR_DEFAULT = 0,
|
VIR_DOMAIN_PCI_ROMBAR_DEFAULT = 0,
|
||||||
VIR_DOMAIN_PCI_ROMBAR_ON,
|
VIR_DOMAIN_PCI_ROMBAR_ON,
|
||||||
VIR_DOMAIN_PCI_ROMBAR_OFF,
|
VIR_DOMAIN_PCI_ROMBAR_OFF,
|
||||||
|
@ -322,7 +322,7 @@ struct _virDomainDeviceInfo {
|
||||||
} master;
|
} master;
|
||||||
/* rombar and romfile are only used for pci hostdev and network
|
/* rombar and romfile are only used for pci hostdev and network
|
||||||
* devices. */
|
* devices. */
|
||||||
int rombar; /* enum virDomainPciRombarMode */
|
int rombar; /* enum virDomainPCIRombarMode */
|
||||||
char *romfile;
|
char *romfile;
|
||||||
/* bootIndex is only used for disk, network interface, hostdev
|
/* bootIndex is only used for disk, network interface, hostdev
|
||||||
* and redirdev devices */
|
* and redirdev devices */
|
||||||
|
@ -386,9 +386,9 @@ typedef enum {
|
||||||
VIR_DOMAIN_HOSTDEV_PCI_BACKEND_XEN, /* force legacy xen style, use pciback */
|
VIR_DOMAIN_HOSTDEV_PCI_BACKEND_XEN, /* force legacy xen style, use pciback */
|
||||||
|
|
||||||
VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_LAST
|
VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_LAST
|
||||||
} virDomainHostdevSubsysPciBackendType;
|
} virDomainHostdevSubsysPCIBackendType;
|
||||||
|
|
||||||
VIR_ENUM_DECL(virDomainHostdevSubsysPciBackend)
|
VIR_ENUM_DECL(virDomainHostdevSubsysPCIBackend)
|
||||||
|
|
||||||
typedef struct _virDomainHostdevSubsys virDomainHostdevSubsys;
|
typedef struct _virDomainHostdevSubsys virDomainHostdevSubsys;
|
||||||
typedef virDomainHostdevSubsys *virDomainHostdevSubsysPtr;
|
typedef virDomainHostdevSubsys *virDomainHostdevSubsysPtr;
|
||||||
|
@ -406,7 +406,7 @@ struct _virDomainHostdevSubsys {
|
||||||
} usb;
|
} usb;
|
||||||
struct {
|
struct {
|
||||||
virDevicePCIAddress addr; /* host address */
|
virDevicePCIAddress addr; /* host address */
|
||||||
int backend; /* enum virDomainHostdevSubsysPciBackendType */
|
int backend; /* enum virDomainHostdevSubsysPCIBackendType */
|
||||||
} pci;
|
} pci;
|
||||||
struct {
|
struct {
|
||||||
char *adapter;
|
char *adapter;
|
||||||
|
@ -708,9 +708,9 @@ struct _virDomainVirtioSerialOpts {
|
||||||
int vectors; /* -1 == undef */
|
int vectors; /* -1 == undef */
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct _virDomainPciControllerOpts virDomainPciControllerOpts;
|
typedef struct _virDomainPCIControllerOpts virDomainPCIControllerOpts;
|
||||||
typedef virDomainPciControllerOpts *virDomainPciControllerOptsPtr;
|
typedef virDomainPCIControllerOpts *virDomainPCIControllerOptsPtr;
|
||||||
struct _virDomainPciControllerOpts {
|
struct _virDomainPCIControllerOpts {
|
||||||
bool pcihole64;
|
bool pcihole64;
|
||||||
unsigned long pcihole64size;
|
unsigned long pcihole64size;
|
||||||
};
|
};
|
||||||
|
@ -723,7 +723,7 @@ struct _virDomainControllerDef {
|
||||||
unsigned int queues;
|
unsigned int queues;
|
||||||
union {
|
union {
|
||||||
virDomainVirtioSerialOpts vioserial;
|
virDomainVirtioSerialOpts vioserial;
|
||||||
virDomainPciControllerOpts pciopts;
|
virDomainPCIControllerOpts pciopts;
|
||||||
} opts;
|
} opts;
|
||||||
virDomainDeviceInfo info;
|
virDomainDeviceInfo info;
|
||||||
};
|
};
|
||||||
|
@ -2582,7 +2582,7 @@ VIR_ENUM_DECL(virDomainVideo)
|
||||||
VIR_ENUM_DECL(virDomainHostdevMode)
|
VIR_ENUM_DECL(virDomainHostdevMode)
|
||||||
VIR_ENUM_DECL(virDomainHostdevSubsys)
|
VIR_ENUM_DECL(virDomainHostdevSubsys)
|
||||||
VIR_ENUM_DECL(virDomainHostdevCaps)
|
VIR_ENUM_DECL(virDomainHostdevCaps)
|
||||||
VIR_ENUM_DECL(virDomainPciRombarMode)
|
VIR_ENUM_DECL(virDomainPCIRombarMode)
|
||||||
VIR_ENUM_DECL(virDomainHub)
|
VIR_ENUM_DECL(virDomainHub)
|
||||||
VIR_ENUM_DECL(virDomainRedirdevBus)
|
VIR_ENUM_DECL(virDomainRedirdevBus)
|
||||||
VIR_ENUM_DECL(virDomainInput)
|
VIR_ENUM_DECL(virDomainInput)
|
||||||
|
|
|
@ -988,7 +988,7 @@ virNodeDevCapUSBDevParseXML(xmlXPathContextPtr ctxt,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
virNodeDevCapPciDevIommuGroupParseXML(xmlXPathContextPtr ctxt,
|
virNodeDevCapPCIDevIommuGroupParseXML(xmlXPathContextPtr ctxt,
|
||||||
xmlNodePtr iommuGroupNode,
|
xmlNodePtr iommuGroupNode,
|
||||||
union _virNodeDevCapData *data)
|
union _virNodeDevCapData *data)
|
||||||
{
|
{
|
||||||
|
@ -1045,7 +1045,7 @@ virNodeDevCapPciDevIommuGroupParseXML(xmlXPathContextPtr ctxt,
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
virNodeDevCapPciDevParseXML(xmlXPathContextPtr ctxt,
|
virNodeDevCapPCIDevParseXML(xmlXPathContextPtr ctxt,
|
||||||
virNodeDeviceDefPtr def,
|
virNodeDeviceDefPtr def,
|
||||||
xmlNodePtr node,
|
xmlNodePtr node,
|
||||||
union _virNodeDevCapData *data)
|
union _virNodeDevCapData *data)
|
||||||
|
@ -1096,7 +1096,7 @@ virNodeDevCapPciDevParseXML(xmlXPathContextPtr ctxt,
|
||||||
data->pci_dev.product_name = virXPathString("string(./product[1])", ctxt);
|
data->pci_dev.product_name = virXPathString("string(./product[1])", ctxt);
|
||||||
|
|
||||||
if ((iommuGroupNode = virXPathNode("./iommuGroup[1]", ctxt))) {
|
if ((iommuGroupNode = virXPathNode("./iommuGroup[1]", ctxt))) {
|
||||||
if (virNodeDevCapPciDevIommuGroupParseXML(ctxt, iommuGroupNode,
|
if (virNodeDevCapPCIDevIommuGroupParseXML(ctxt, iommuGroupNode,
|
||||||
data) < 0) {
|
data) < 0) {
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -1186,7 +1186,7 @@ virNodeDevCapsDefParseXML(xmlXPathContextPtr ctxt,
|
||||||
ret = virNodeDevCapSystemParseXML(ctxt, def, node, &caps->data);
|
ret = virNodeDevCapSystemParseXML(ctxt, def, node, &caps->data);
|
||||||
break;
|
break;
|
||||||
case VIR_NODE_DEV_CAP_PCI_DEV:
|
case VIR_NODE_DEV_CAP_PCI_DEV:
|
||||||
ret = virNodeDevCapPciDevParseXML(ctxt, def, node, &caps->data);
|
ret = virNodeDevCapPCIDevParseXML(ctxt, def, node, &caps->data);
|
||||||
break;
|
break;
|
||||||
case VIR_NODE_DEV_CAP_USB_DEV:
|
case VIR_NODE_DEV_CAP_USB_DEV:
|
||||||
ret = virNodeDevCapUSBDevParseXML(ctxt, def, node, &caps->data);
|
ret = virNodeDevCapUSBDevParseXML(ctxt, def, node, &caps->data);
|
||||||
|
|
|
@ -77,8 +77,8 @@ virCPUModeTypeToString;
|
||||||
|
|
||||||
|
|
||||||
# conf/device_conf.h
|
# conf/device_conf.h
|
||||||
virDeviceAddressPciMultiTypeFromString;
|
virDeviceAddressPCIMultiTypeFromString;
|
||||||
virDeviceAddressPciMultiTypeToString;
|
virDeviceAddressPCIMultiTypeToString;
|
||||||
virDevicePCIAddressEqual;
|
virDevicePCIAddressEqual;
|
||||||
virDevicePCIAddressFormat;
|
virDevicePCIAddressFormat;
|
||||||
virDevicePCIAddressIsValid;
|
virDevicePCIAddressIsValid;
|
||||||
|
@ -270,7 +270,7 @@ virDomainHostdevFind;
|
||||||
virDomainHostdevInsert;
|
virDomainHostdevInsert;
|
||||||
virDomainHostdevModeTypeToString;
|
virDomainHostdevModeTypeToString;
|
||||||
virDomainHostdevRemove;
|
virDomainHostdevRemove;
|
||||||
virDomainHostdevSubsysPciBackendTypeToString;
|
virDomainHostdevSubsysPCIBackendTypeToString;
|
||||||
virDomainHostdevSubsysTypeToString;
|
virDomainHostdevSubsysTypeToString;
|
||||||
virDomainHubTypeFromString;
|
virDomainHubTypeFromString;
|
||||||
virDomainHubTypeToString;
|
virDomainHubTypeToString;
|
||||||
|
@ -342,8 +342,8 @@ virDomainObjSetState;
|
||||||
virDomainObjTaint;
|
virDomainObjTaint;
|
||||||
virDomainPausedReasonTypeFromString;
|
virDomainPausedReasonTypeFromString;
|
||||||
virDomainPausedReasonTypeToString;
|
virDomainPausedReasonTypeToString;
|
||||||
virDomainPciRombarModeTypeFromString;
|
virDomainPCIRombarModeTypeFromString;
|
||||||
virDomainPciRombarModeTypeToString;
|
virDomainPCIRombarModeTypeToString;
|
||||||
virDomainPMStateTypeFromString;
|
virDomainPMStateTypeFromString;
|
||||||
virDomainPMStateTypeToString;
|
virDomainPMStateTypeToString;
|
||||||
virDomainPMSuspendedReasonTypeFromString;
|
virDomainPMSuspendedReasonTypeFromString;
|
||||||
|
|
|
@ -1179,7 +1179,7 @@ libxlDriverConfigGet(libxlDriverPrivatePtr driver)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
libxlMakePci(virDomainHostdevDefPtr hostdev, libxl_device_pci *pcidev)
|
libxlMakePCI(virDomainHostdevDefPtr hostdev, libxl_device_pci *pcidev)
|
||||||
{
|
{
|
||||||
if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS)
|
if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -1195,7 +1195,7 @@ libxlMakePci(virDomainHostdevDefPtr hostdev, libxl_device_pci *pcidev)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
libxlMakePciList(virDomainDefPtr def, libxl_domain_config *d_config)
|
libxlMakePCIList(virDomainDefPtr def, libxl_domain_config *d_config)
|
||||||
{
|
{
|
||||||
virDomainHostdevDefPtr *l_hostdevs = def->hostdevs;
|
virDomainHostdevDefPtr *l_hostdevs = def->hostdevs;
|
||||||
size_t nhostdevs = def->nhostdevs;
|
size_t nhostdevs = def->nhostdevs;
|
||||||
|
@ -1217,7 +1217,7 @@ libxlMakePciList(virDomainDefPtr def, libxl_domain_config *d_config)
|
||||||
|
|
||||||
libxl_device_pci_init(&x_pcidevs[j]);
|
libxl_device_pci_init(&x_pcidevs[j]);
|
||||||
|
|
||||||
if (libxlMakePci(l_hostdevs[i], &x_pcidevs[j]) < 0)
|
if (libxlMakePCI(l_hostdevs[i], &x_pcidevs[j]) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
npcidevs++;
|
npcidevs++;
|
||||||
|
@ -1322,7 +1322,7 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
|
||||||
if (libxlMakeVfbList(driver, def, d_config) < 0)
|
if (libxlMakeVfbList(driver, def, d_config) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (libxlMakePciList(def, d_config) < 0)
|
if (libxlMakePCIList(def, d_config) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
d_config->on_reboot = def->onReboot;
|
d_config->on_reboot = def->onReboot;
|
||||||
|
|
|
@ -156,7 +156,7 @@ libxlMakeVfb(libxlDriverPrivatePtr driver,
|
||||||
virDomainGraphicsDefPtr l_vfb, libxl_device_vfb *x_vfb);
|
virDomainGraphicsDefPtr l_vfb, libxl_device_vfb *x_vfb);
|
||||||
|
|
||||||
int
|
int
|
||||||
libxlMakePci(virDomainHostdevDefPtr hostdev, libxl_device_pci *pcidev);
|
libxlMakePCI(virDomainHostdevDefPtr hostdev, libxl_device_pci *pcidev);
|
||||||
|
|
||||||
int
|
int
|
||||||
libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
|
libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
|
||||||
|
|
|
@ -2610,7 +2610,7 @@ libxlDomainAttachHostPCIDevice(libxlDriverPrivatePtr driver,
|
||||||
&hostdev, 1, 0) < 0)
|
&hostdev, 1, 0) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (libxlMakePci(hostdev, &pcidev) < 0)
|
if (libxlMakePCI(hostdev, &pcidev) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (libxl_device_pci_add(priv->ctx, vm->def->id, &pcidev, 0) < 0) {
|
if (libxl_device_pci_add(priv->ctx, vm->def->id, &pcidev, 0) < 0) {
|
||||||
|
@ -2860,7 +2860,7 @@ libxlDomainDetachHostPCIDevice(libxlDriverPrivatePtr driver,
|
||||||
|
|
||||||
libxl_device_pci_init(&pcidev);
|
libxl_device_pci_init(&pcidev);
|
||||||
|
|
||||||
if (libxlMakePci(detach, &pcidev) < 0)
|
if (libxlMakePCI(detach, &pcidev) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (libxl_device_pci_remove(priv->ctx, vm->def->id, &pcidev, 0) < 0) {
|
if (libxl_device_pci_remove(priv->ctx, vm->def->id, &pcidev, 0) < 0) {
|
||||||
|
|
|
@ -3480,7 +3480,7 @@ networkAllocateActualDevice(virDomainDefPtr dom,
|
||||||
|
|
||||||
} else if (netdef->forward.type == VIR_NETWORK_FORWARD_HOSTDEV) {
|
} else if (netdef->forward.type == VIR_NETWORK_FORWARD_HOSTDEV) {
|
||||||
|
|
||||||
virDomainHostdevSubsysPciBackendType backend;
|
virDomainHostdevSubsysPCIBackendType backend;
|
||||||
|
|
||||||
iface->data.network.actual->type = actualType = VIR_DOMAIN_NET_TYPE_HOSTDEV;
|
iface->data.network.actual->type = actualType = VIR_DOMAIN_NET_TYPE_HOSTDEV;
|
||||||
if (netdef->forward.npfs > 0 && netdef->forward.nifs <= 0 &&
|
if (netdef->forward.npfs > 0 && netdef->forward.nifs <= 0 &&
|
||||||
|
|
|
@ -1456,13 +1456,13 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioNet[] = {
|
||||||
{ "event_idx", QEMU_CAPS_VIRTIO_NET_EVENT_IDX },
|
{ "event_idx", QEMU_CAPS_VIRTIO_NET_EVENT_IDX },
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsPciAssign[] = {
|
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsPCIAssign[] = {
|
||||||
{ "rombar", QEMU_CAPS_PCI_ROMBAR },
|
{ "rombar", QEMU_CAPS_PCI_ROMBAR },
|
||||||
{ "configfd", QEMU_CAPS_PCI_CONFIGFD },
|
{ "configfd", QEMU_CAPS_PCI_CONFIGFD },
|
||||||
{ "bootindex", QEMU_CAPS_PCI_BOOTINDEX },
|
{ "bootindex", QEMU_CAPS_PCI_BOOTINDEX },
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVfioPci[] = {
|
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVfioPCI[] = {
|
||||||
{ "bootindex", QEMU_CAPS_VFIO_PCI_BOOTINDEX },
|
{ "bootindex", QEMU_CAPS_VFIO_PCI_BOOTINDEX },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1493,11 +1493,11 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsSCSIGeneric[] = {
|
||||||
{ "bootindex", QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX },
|
{ "bootindex", QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX },
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsI440FXPciHost[] = {
|
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsI440FXPCIHost[] = {
|
||||||
{ "pci-hole64-size", QEMU_CAPS_I440FX_PCI_HOLE64_SIZE },
|
{ "pci-hole64-size", QEMU_CAPS_I440FX_PCI_HOLE64_SIZE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQ35PciHost[] = {
|
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQ35PCIHost[] = {
|
||||||
{ "pci-hole64-size", QEMU_CAPS_Q35_PCI_HOLE64_SIZE },
|
{ "pci-hole64-size", QEMU_CAPS_Q35_PCI_HOLE64_SIZE },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1528,12 +1528,12 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = {
|
||||||
ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBlk) },
|
ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBlk) },
|
||||||
{ "virtio-net-s390", virQEMUCapsObjectPropsVirtioNet,
|
{ "virtio-net-s390", virQEMUCapsObjectPropsVirtioNet,
|
||||||
ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioNet) },
|
ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioNet) },
|
||||||
{ "pci-assign", virQEMUCapsObjectPropsPciAssign,
|
{ "pci-assign", virQEMUCapsObjectPropsPCIAssign,
|
||||||
ARRAY_CARDINALITY(virQEMUCapsObjectPropsPciAssign) },
|
ARRAY_CARDINALITY(virQEMUCapsObjectPropsPCIAssign) },
|
||||||
{ "kvm-pci-assign", virQEMUCapsObjectPropsPciAssign,
|
{ "kvm-pci-assign", virQEMUCapsObjectPropsPCIAssign,
|
||||||
ARRAY_CARDINALITY(virQEMUCapsObjectPropsPciAssign) },
|
ARRAY_CARDINALITY(virQEMUCapsObjectPropsPCIAssign) },
|
||||||
{ "vfio-pci", virQEMUCapsObjectPropsVfioPci,
|
{ "vfio-pci", virQEMUCapsObjectPropsVfioPCI,
|
||||||
ARRAY_CARDINALITY(virQEMUCapsObjectPropsVfioPci) },
|
ARRAY_CARDINALITY(virQEMUCapsObjectPropsVfioPCI) },
|
||||||
{ "scsi-disk", virQEMUCapsObjectPropsSCSIDisk,
|
{ "scsi-disk", virQEMUCapsObjectPropsSCSIDisk,
|
||||||
ARRAY_CARDINALITY(virQEMUCapsObjectPropsSCSIDisk) },
|
ARRAY_CARDINALITY(virQEMUCapsObjectPropsSCSIDisk) },
|
||||||
{ "ide-drive", virQEMUCapsObjectPropsIDEDrive,
|
{ "ide-drive", virQEMUCapsObjectPropsIDEDrive,
|
||||||
|
@ -1546,10 +1546,10 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = {
|
||||||
ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBHost) },
|
ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBHost) },
|
||||||
{ "scsi-generic", virQEMUCapsObjectPropsSCSIGeneric,
|
{ "scsi-generic", virQEMUCapsObjectPropsSCSIGeneric,
|
||||||
ARRAY_CARDINALITY(virQEMUCapsObjectPropsSCSIGeneric) },
|
ARRAY_CARDINALITY(virQEMUCapsObjectPropsSCSIGeneric) },
|
||||||
{ "i440FX-pcihost", virQEMUCapsObjectPropsI440FXPciHost,
|
{ "i440FX-pcihost", virQEMUCapsObjectPropsI440FXPCIHost,
|
||||||
ARRAY_CARDINALITY(virQEMUCapsObjectPropsI440FXPciHost) },
|
ARRAY_CARDINALITY(virQEMUCapsObjectPropsI440FXPCIHost) },
|
||||||
{ "q35-pcihost", virQEMUCapsObjectPropsQ35PciHost,
|
{ "q35-pcihost", virQEMUCapsObjectPropsQ35PCIHost,
|
||||||
ARRAY_CARDINALITY(virQEMUCapsObjectPropsQ35PciHost) },
|
ARRAY_CARDINALITY(virQEMUCapsObjectPropsQ35PCIHost) },
|
||||||
{ "usb-storage", virQEMUCapsObjectPropsUSBStorage,
|
{ "usb-storage", virQEMUCapsObjectPropsUSBStorage,
|
||||||
ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBStorage) },
|
ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBStorage) },
|
||||||
{ "kvm-pit", virQEMUCapsObjectPropsKVMPit,
|
{ "kvm-pit", virQEMUCapsObjectPropsKVMPit,
|
||||||
|
|
|
@ -5532,7 +5532,7 @@ qemuBuildPCIHostdevDevStr(virDomainDefPtr def,
|
||||||
int backend = dev->source.subsys.u.pci.backend;
|
int backend = dev->source.subsys.u.pci.backend;
|
||||||
|
|
||||||
/* caller has to assign proper passthrough backend type */
|
/* caller has to assign proper passthrough backend type */
|
||||||
switch ((virDomainHostdevSubsysPciBackendType) backend) {
|
switch ((virDomainHostdevSubsysPCIBackendType) backend) {
|
||||||
case VIR_DOMAIN_HOSTDEV_PCI_BACKEND_KVM:
|
case VIR_DOMAIN_HOSTDEV_PCI_BACKEND_KVM:
|
||||||
virBufferAddLit(&buf, "pci-assign");
|
virBufferAddLit(&buf, "pci-assign");
|
||||||
if (configfd && *configfd)
|
if (configfd && *configfd)
|
||||||
|
@ -5546,7 +5546,7 @@ qemuBuildPCIHostdevDevStr(virDomainDefPtr def,
|
||||||
default:
|
default:
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("invalid PCI passthrough type '%s'"),
|
_("invalid PCI passthrough type '%s'"),
|
||||||
virDomainHostdevSubsysPciBackendTypeToString(backend));
|
virDomainHostdevSubsysPCIBackendTypeToString(backend));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -173,7 +173,7 @@ qemuPrepareHostdevPCICheckSupport(virDomainHostdevDefPtr *hostdevs,
|
||||||
if (hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI)
|
if (hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
switch ((virDomainHostdevSubsysPciBackendType) *backend) {
|
switch ((virDomainHostdevSubsysPCIBackendType) *backend) {
|
||||||
case VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT:
|
case VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT:
|
||||||
if (supportsPassthroughVFIO &&
|
if (supportsPassthroughVFIO &&
|
||||||
virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VFIO_PCI)) {
|
virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VFIO_PCI)) {
|
||||||
|
|
|
@ -1191,7 +1191,7 @@ qemuDomainAttachHostPCIDevice(virQEMUDriverPtr driver,
|
||||||
/* this could have been changed by qemuPrepareHostdevPCIDevices */
|
/* this could have been changed by qemuPrepareHostdevPCIDevices */
|
||||||
backend = hostdev->source.subsys.u.pci.backend;
|
backend = hostdev->source.subsys.u.pci.backend;
|
||||||
|
|
||||||
switch ((virDomainHostdevSubsysPciBackendType) backend) {
|
switch ((virDomainHostdevSubsysPCIBackendType) backend) {
|
||||||
case VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO:
|
case VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO:
|
||||||
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE_VFIO_PCI)) {
|
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE_VFIO_PCI)) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
|
|
@ -1753,7 +1753,7 @@ int qemuMonitorTextAddUSBDeviceMatch(qemuMonitorPtr mon,
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
qemuMonitorTextParsePciAddReply(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
|
qemuMonitorTextParsePCIAddReply(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
|
||||||
const char *reply,
|
const char *reply,
|
||||||
virDevicePCIAddress *addr)
|
virDevicePCIAddress *addr)
|
||||||
{
|
{
|
||||||
|
@ -1840,7 +1840,7 @@ int qemuMonitorTextAddPCIHostDevice(qemuMonitorPtr mon,
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qemuMonitorTextParsePciAddReply(mon, reply, guestAddr) < 0) {
|
if (qemuMonitorTextParsePCIAddReply(mon, reply, guestAddr) < 0) {
|
||||||
virReportError(VIR_ERR_OPERATION_FAILED,
|
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("parsing pci_add reply failed: %s"), reply);
|
_("parsing pci_add reply failed: %s"), reply);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
@ -1878,7 +1878,7 @@ int qemuMonitorTextAddPCIDisk(qemuMonitorPtr mon,
|
||||||
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0)
|
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (qemuMonitorTextParsePciAddReply(mon, reply, guestAddr) < 0) {
|
if (qemuMonitorTextParsePCIAddReply(mon, reply, guestAddr) < 0) {
|
||||||
if (!tryOldSyntax && strstr(reply, "invalid char in expression")) {
|
if (!tryOldSyntax && strstr(reply, "invalid char in expression")) {
|
||||||
VIR_FREE(reply);
|
VIR_FREE(reply);
|
||||||
VIR_FREE(cmd);
|
VIR_FREE(cmd);
|
||||||
|
@ -1915,7 +1915,7 @@ int qemuMonitorTextAddPCINetwork(qemuMonitorPtr mon,
|
||||||
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0)
|
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (qemuMonitorTextParsePciAddReply(mon, reply, guestAddr) < 0) {
|
if (qemuMonitorTextParsePCIAddReply(mon, reply, guestAddr) < 0) {
|
||||||
virReportError(VIR_ERR_OPERATION_FAILED,
|
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("parsing pci_add reply failed: %s"), reply);
|
_("parsing pci_add reply failed: %s"), reply);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
@ -2252,7 +2252,7 @@ int qemuMonitorTextAttachPCIDiskController(qemuMonitorPtr mon,
|
||||||
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0)
|
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (qemuMonitorTextParsePciAddReply(mon, reply, guestAddr) < 0) {
|
if (qemuMonitorTextParsePCIAddReply(mon, reply, guestAddr) < 0) {
|
||||||
if (!tryOldSyntax && strstr(reply, "invalid char in expression")) {
|
if (!tryOldSyntax && strstr(reply, "invalid char in expression")) {
|
||||||
VIR_FREE(reply);
|
VIR_FREE(reply);
|
||||||
VIR_FREE(cmd);
|
VIR_FREE(cmd);
|
||||||
|
|
|
@ -1072,7 +1072,7 @@ get_files(vahControl * ctl)
|
||||||
dev->source.subsys.u.pci.addr.slot,
|
dev->source.subsys.u.pci.addr.slot,
|
||||||
dev->source.subsys.u.pci.addr.function);
|
dev->source.subsys.u.pci.addr.function);
|
||||||
|
|
||||||
virDomainHostdevSubsysPciBackendType backend = dev->source.subsys.u.pci.backend;
|
virDomainHostdevSubsysPCIBackendType backend = dev->source.subsys.u.pci.backend;
|
||||||
if (backend == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO ||
|
if (backend == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO ||
|
||||||
backend == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT) {
|
backend == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT) {
|
||||||
needsVfio = true;
|
needsVfio = true;
|
||||||
|
|
|
@ -1571,7 +1571,7 @@ virHostdevPrepareDomainDevices(virHostdevManagerPtr mgr,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* @oldStateDir
|
/* @oldStateDir
|
||||||
* For upgrade purpose: see virHostdevReAttachPciHostdevs
|
* For upgrade purpose: see virHostdevReAttachPCIHostdevs
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
virHostdevReAttachDomainDevices(virHostdevManagerPtr mgr,
|
virHostdevReAttachDomainDevices(virHostdevManagerPtr mgr,
|
||||||
|
|
|
@ -2424,7 +2424,7 @@ xenUnifiedConnectDomainEventDeregisterAny(virConnectPtr conn,
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
xenUnifiedNodeDeviceGetPciInfo(virNodeDevicePtr dev,
|
xenUnifiedNodeDeviceGetPCIInfo(virNodeDevicePtr dev,
|
||||||
unsigned *domain,
|
unsigned *domain,
|
||||||
unsigned *bus,
|
unsigned *bus,
|
||||||
unsigned *slot,
|
unsigned *slot,
|
||||||
|
@ -2480,7 +2480,7 @@ xenUnifiedNodeDeviceDetachFlags(virNodeDevicePtr dev,
|
||||||
|
|
||||||
virCheckFlags(0, -1);
|
virCheckFlags(0, -1);
|
||||||
|
|
||||||
if (xenUnifiedNodeDeviceGetPciInfo(dev, &domain, &bus, &slot, &function) < 0)
|
if (xenUnifiedNodeDeviceGetPCIInfo(dev, &domain, &bus, &slot, &function) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
pci = virPCIDeviceNew(domain, bus, slot, function);
|
pci = virPCIDeviceNew(domain, bus, slot, function);
|
||||||
|
@ -2538,7 +2538,7 @@ xenUnifiedNodeDeviceAssignedDomainId(virNodeDevicePtr dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get pci bdf */
|
/* Get pci bdf */
|
||||||
if (xenUnifiedNodeDeviceGetPciInfo(dev, &domain, &bus, &slot, &function) < 0)
|
if (xenUnifiedNodeDeviceGetPCIInfo(dev, &domain, &bus, &slot, &function) < 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (virAsprintf(&bdf, "%04x:%02x:%02x.%0x",
|
if (virAsprintf(&bdf, "%04x:%02x:%02x.%0x",
|
||||||
|
@ -2574,7 +2574,7 @@ xenUnifiedNodeDeviceReAttach(virNodeDevicePtr dev)
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
int domid;
|
int domid;
|
||||||
|
|
||||||
if (xenUnifiedNodeDeviceGetPciInfo(dev, &domain, &bus, &slot, &function) < 0)
|
if (xenUnifiedNodeDeviceGetPCIInfo(dev, &domain, &bus, &slot, &function) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
pci = virPCIDeviceNew(domain, bus, slot, function);
|
pci = virPCIDeviceNew(domain, bus, slot, function);
|
||||||
|
@ -2605,7 +2605,7 @@ xenUnifiedNodeDeviceReset(virNodeDevicePtr dev)
|
||||||
unsigned domain, bus, slot, function;
|
unsigned domain, bus, slot, function;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
if (xenUnifiedNodeDeviceGetPciInfo(dev, &domain, &bus, &slot, &function) < 0)
|
if (xenUnifiedNodeDeviceGetPCIInfo(dev, &domain, &bus, &slot, &function) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
pci = virPCIDeviceNew(domain, bus, slot, function);
|
pci = virPCIDeviceNew(domain, bus, slot, function);
|
||||||
|
|
|
@ -136,10 +136,10 @@ struct fdCallback {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct pciDevice **pciDevices = NULL;
|
struct pciDevice **pciDevices = NULL;
|
||||||
size_t nPciDevices = 0;
|
size_t nPCIDevices = 0;
|
||||||
|
|
||||||
struct pciDriver **pciDrivers = NULL;
|
struct pciDriver **pciDrivers = NULL;
|
||||||
size_t nPciDrivers = 0;
|
size_t nPCIDrivers = 0;
|
||||||
|
|
||||||
struct fdCallback *callbacks = NULL;
|
struct fdCallback *callbacks = NULL;
|
||||||
size_t nCallbacks = 0;
|
size_t nCallbacks = 0;
|
||||||
|
@ -390,7 +390,7 @@ pci_device_new_from_stub(const struct pciDevice *data)
|
||||||
if (pci_device_autobind(dev) < 0)
|
if (pci_device_autobind(dev) < 0)
|
||||||
ABORT("Unable to bind: %s", data->id);
|
ABORT("Unable to bind: %s", data->id);
|
||||||
|
|
||||||
if (VIR_APPEND_ELEMENT_QUIET(pciDevices, nPciDevices, dev) < 0)
|
if (VIR_APPEND_ELEMENT_QUIET(pciDevices, nPCIDevices, dev) < 0)
|
||||||
ABORT_OOM();
|
ABORT_OOM();
|
||||||
|
|
||||||
VIR_FREE(devpath);
|
VIR_FREE(devpath);
|
||||||
|
@ -401,7 +401,7 @@ static struct pciDevice *
|
||||||
pci_device_find_by_id(const char *id)
|
pci_device_find_by_id(const char *id)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
for (i = 0; i < nPciDevices; i++) {
|
for (i = 0; i < nPCIDevices; i++) {
|
||||||
struct pciDevice *dev = pciDevices[i];
|
struct pciDevice *dev = pciDevices[i];
|
||||||
|
|
||||||
if (STREQ(dev->id, id))
|
if (STREQ(dev->id, id))
|
||||||
|
@ -479,7 +479,7 @@ pci_driver_new(const char *name, int fail, ...)
|
||||||
make_file(driverpath, "new_id", NULL, -1);
|
make_file(driverpath, "new_id", NULL, -1);
|
||||||
make_file(driverpath, "remove_id", NULL, -1);
|
make_file(driverpath, "remove_id", NULL, -1);
|
||||||
|
|
||||||
if (VIR_APPEND_ELEMENT_QUIET(pciDrivers, nPciDrivers, driver) < 0)
|
if (VIR_APPEND_ELEMENT_QUIET(pciDrivers, nPCIDrivers, driver) < 0)
|
||||||
ABORT_OOM();
|
ABORT_OOM();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -488,7 +488,7 @@ pci_driver_find_by_dev(struct pciDevice *dev)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
for (i = 0; i < nPciDrivers; i++) {
|
for (i = 0; i < nPCIDrivers; i++) {
|
||||||
struct pciDriver *driver = pciDrivers[i];
|
struct pciDriver *driver = pciDrivers[i];
|
||||||
size_t j;
|
size_t j;
|
||||||
|
|
||||||
|
@ -507,7 +507,7 @@ pci_driver_find_by_path(const char *path)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
for (i = 0; i < nPciDrivers; i++) {
|
for (i = 0; i < nPCIDrivers; i++) {
|
||||||
struct pciDriver *driver = pciDrivers[i];
|
struct pciDriver *driver = pciDrivers[i];
|
||||||
|
|
||||||
if (strstr(path, driver->name))
|
if (strstr(path, driver->name))
|
||||||
|
@ -709,7 +709,7 @@ pci_driver_handle_new_id(const char *path)
|
||||||
driver->len++;
|
driver->len++;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < nPciDevices; i++) {
|
for (i = 0; i < nPCIDevices; i++) {
|
||||||
struct pciDevice *dev = pciDevices[i];
|
struct pciDevice *dev = pciDevices[i];
|
||||||
|
|
||||||
if (!dev->driver &&
|
if (!dev->driver &&
|
||||||
|
|
Loading…
Reference in New Issue