提交 ff89e9b9 编写于 作者: L Laine Stump

conf: move virDomainDeviceInfo definition from domain_conf.h to device_conf.h

Also moves all the subordinate structs. This is necessary due to a new
inline function that will be defined in device_conf.h, and also makes
sense, because it is the *device* info that's in the struct. (Actually
a lot more stuff from domain_conf.h could move to this newer file, but
I didn't want to disturb any more than necessary).
上级 997be5c2
/* /*
* device_conf.h: device XML handling entry points * device_conf.h: device XML handling entry points
* *
* Copyright (C) 2006-2012, 2014-2015 Red Hat, Inc. * Copyright (C) 2006-2012, 2014-2016 Red Hat, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
...@@ -72,6 +72,115 @@ typedef enum { ...@@ -72,6 +72,115 @@ typedef enum {
VIR_ENUM_DECL(virNetDevFeature) VIR_ENUM_DECL(virNetDevFeature)
typedef enum {
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_SERIAL,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCID,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_ISA,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DIMM,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_LAST
} virDomainDeviceAddressType;
typedef struct _virDomainDeviceDriveAddress {
unsigned int controller;
unsigned int bus;
unsigned int target;
unsigned int unit;
} virDomainDeviceDriveAddress, *virDomainDeviceDriveAddressPtr;
typedef struct _virDomainDeviceVirtioSerialAddress {
unsigned int controller;
unsigned int bus;
unsigned int port;
} virDomainDeviceVirtioSerialAddress, *virDomainDeviceVirtioSerialAddressPtr;
# define VIR_DOMAIN_DEVICE_CCW_MAX_CSSID 254
# define VIR_DOMAIN_DEVICE_CCW_MAX_SSID 3
# define VIR_DOMAIN_DEVICE_CCW_MAX_DEVNO 65535
typedef struct _virDomainDeviceCCWAddress {
unsigned int cssid;
unsigned int ssid;
unsigned int devno;
bool assigned;
} virDomainDeviceCCWAddress, *virDomainDeviceCCWAddressPtr;
typedef struct _virDomainDeviceCcidAddress {
unsigned int controller;
unsigned int slot;
} virDomainDeviceCcidAddress, *virDomainDeviceCcidAddressPtr;
typedef struct _virDomainDeviceUSBAddress {
unsigned int bus;
char *port;
} virDomainDeviceUSBAddress, *virDomainDeviceUSBAddressPtr;
typedef struct _virDomainDeviceSpaprVioAddress {
unsigned long long reg;
bool has_reg;
} virDomainDeviceSpaprVioAddress, *virDomainDeviceSpaprVioAddressPtr;
typedef enum {
VIR_DOMAIN_CONTROLLER_MASTER_NONE,
VIR_DOMAIN_CONTROLLER_MASTER_USB,
VIR_DOMAIN_CONTROLLER_MASTER_LAST
} virDomainControllerMaster;
typedef struct _virDomainDeviceUSBMaster {
unsigned int startport;
} virDomainDeviceUSBMaster, *virDomainDeviceUSBMasterPtr;
typedef struct _virDomainDeviceISAAddress {
unsigned int iobase;
unsigned int irq;
} virDomainDeviceISAAddress, *virDomainDeviceISAAddressPtr;
typedef struct _virDomainDeviceDimmAddress {
unsigned int slot;
unsigned long long base;
} virDomainDeviceDimmAddress, *virDomainDeviceDimmAddressPtr;
typedef struct _virDomainDeviceInfo {
/* If adding to this struct, ensure that
* virDomainDeviceInfoIsSet() is updated
* to consider the new fields
*/
char *alias;
int type; /* virDomainDeviceAddressType */
union {
virPCIDeviceAddress pci;
virDomainDeviceDriveAddress drive;
virDomainDeviceVirtioSerialAddress vioserial;
virDomainDeviceCcidAddress ccid;
virDomainDeviceUSBAddress usb;
virDomainDeviceSpaprVioAddress spaprvio;
virDomainDeviceCCWAddress ccw;
virDomainDeviceISAAddress isa;
virDomainDeviceDimmAddress dimm;
} addr;
int mastertype;
union {
virDomainDeviceUSBMaster usb;
} master;
/* rombar and romfile are only used for pci hostdev and network
* devices. */
int rombar; /* enum virTristateSwitch */
char *romfile;
/* bootIndex is only used for disk, network interface, hostdev
* and redirdev devices */
unsigned int bootIndex;
} virDomainDeviceInfo, *virDomainDeviceInfoPtr;
int virPCIDeviceAddressIsValid(virPCIDeviceAddressPtr addr, int virPCIDeviceAddressIsValid(virPCIDeviceAddressPtr addr,
bool report); bool report);
......
...@@ -243,135 +243,6 @@ typedef enum { ...@@ -243,135 +243,6 @@ typedef enum {
VIR_ENUM_DECL(virDomainOS) VIR_ENUM_DECL(virDomainOS)
typedef enum {
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_SERIAL,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCID,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_ISA,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DIMM,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_LAST
} virDomainDeviceAddressType;
typedef struct _virDomainDeviceDriveAddress virDomainDeviceDriveAddress;
typedef virDomainDeviceDriveAddress *virDomainDeviceDriveAddressPtr;
struct _virDomainDeviceDriveAddress {
unsigned int controller;
unsigned int bus;
unsigned int target;
unsigned int unit;
};
typedef struct _virDomainDeviceVirtioSerialAddress virDomainDeviceVirtioSerialAddress;
typedef virDomainDeviceVirtioSerialAddress *virDomainDeviceVirtioSerialAddressPtr;
struct _virDomainDeviceVirtioSerialAddress {
unsigned int controller;
unsigned int bus;
unsigned int port;
};
# define VIR_DOMAIN_DEVICE_CCW_MAX_CSSID 254
# define VIR_DOMAIN_DEVICE_CCW_MAX_SSID 3
# define VIR_DOMAIN_DEVICE_CCW_MAX_DEVNO 65535
typedef struct _virDomainDeviceCCWAddress virDomainDeviceCCWAddress;
typedef virDomainDeviceCCWAddress *virDomainDeviceCCWAddressPtr;
struct _virDomainDeviceCCWAddress {
unsigned int cssid;
unsigned int ssid;
unsigned int devno;
bool assigned;
};
typedef struct _virDomainDeviceCcidAddress virDomainDeviceCcidAddress;
typedef virDomainDeviceCcidAddress *virDomainDeviceCcidAddressPtr;
struct _virDomainDeviceCcidAddress {
unsigned int controller;
unsigned int slot;
};
typedef struct _virDomainDeviceUSBAddress virDomainDeviceUSBAddress;
typedef virDomainDeviceUSBAddress *virDomainDeviceUSBAddressPtr;
struct _virDomainDeviceUSBAddress {
unsigned int bus;
char *port;
};
typedef struct _virDomainDeviceSpaprVioAddress virDomainDeviceSpaprVioAddress;
typedef virDomainDeviceSpaprVioAddress *virDomainDeviceSpaprVioAddressPtr;
struct _virDomainDeviceSpaprVioAddress {
unsigned long long reg;
bool has_reg;
};
typedef enum {
VIR_DOMAIN_CONTROLLER_MASTER_NONE,
VIR_DOMAIN_CONTROLLER_MASTER_USB,
VIR_DOMAIN_CONTROLLER_MASTER_LAST
} virDomainControllerMaster;
typedef struct _virDomainDeviceUSBMaster virDomainDeviceUSBMaster;
typedef virDomainDeviceUSBMaster *virDomainDeviceUSBMasterPtr;
struct _virDomainDeviceUSBMaster {
unsigned int startport;
};
typedef struct _virDomainDeviceISAAddress virDomainDeviceISAAddress;
typedef virDomainDeviceISAAddress *virDomainDeviceISAAddressPtr;
struct _virDomainDeviceISAAddress {
unsigned int iobase;
unsigned int irq;
};
typedef struct _virDomainDeviceDimmAddress virDomainDeviceDimmAddress;
typedef virDomainDeviceDimmAddress *virDomainDeviceDimmAddressPtr;
struct _virDomainDeviceDimmAddress {
unsigned int slot;
unsigned long long base;
};
typedef struct _virDomainDeviceInfo virDomainDeviceInfo;
typedef virDomainDeviceInfo *virDomainDeviceInfoPtr;
struct _virDomainDeviceInfo {
/* If adding to this struct, ensure that
* virDomainDeviceInfoIsSet() is updated
* to consider the new fields
*/
char *alias;
int type; /* virDomainDeviceAddressType */
union {
virPCIDeviceAddress pci;
virDomainDeviceDriveAddress drive;
virDomainDeviceVirtioSerialAddress vioserial;
virDomainDeviceCcidAddress ccid;
virDomainDeviceUSBAddress usb;
virDomainDeviceSpaprVioAddress spaprvio;
virDomainDeviceCCWAddress ccw;
virDomainDeviceISAAddress isa;
virDomainDeviceDimmAddress dimm;
} addr;
int mastertype;
union {
virDomainDeviceUSBMaster usb;
} master;
/* rombar and romfile are only used for pci hostdev and network
* devices. */
int rombar; /* enum virTristateSwitch */
char *romfile;
/* bootIndex is only used for disk, network interface, hostdev
* and redirdev devices */
unsigned int bootIndex;
};
typedef struct _virDomainHostdevOrigStates virDomainHostdevOrigStates; typedef struct _virDomainHostdevOrigStates virDomainHostdevOrigStates;
typedef virDomainHostdevOrigStates *virDomainHostdevOrigStatesPtr; typedef virDomainHostdevOrigStates *virDomainHostdevOrigStatesPtr;
struct _virDomainHostdevOrigStates { struct _virDomainHostdevOrigStates {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册