Introduce 'isa' controller type. In domain XML it looks this way: ... <controller type='isa' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </controller> ... Currently, this is needed for the bhyve driver to allow choosing a specific PCI address for that. In bhyve, this controller is used to attach serial ports and a boot ROM. Signed-off-by: Roman Bogorodskiy <bogorodskiy@xxxxxxxxx> --- docs/schemas/domaincommon.rng | 6 ++++++ src/conf/domain_conf.c | 9 +++++++++ src/conf/domain_conf.h | 8 ++++++++ src/qemu/qemu_command.c | 1 + src/qemu/qemu_domain.c | 1 + src/qemu/qemu_domain_address.c | 1 + src/qemu/qemu_validate.c | 1 + src/vbox/vbox_common.c | 1 + 8 files changed, 28 insertions(+) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index a1d6d19e2f..4b7e460148 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2419,6 +2419,12 @@ </attribute> </optional> </group> + <!-- isa --> + <group> + <attribute name="type"> + <value>isa</value> + </attribute> + </group> <!-- pci has an optional attribute "model" --> <group> <attribute name="type"> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 4d296f7bcb..9289c147fe 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -400,6 +400,7 @@ VIR_ENUM_IMPL(virDomainController, "usb", "pci", "xenbus", + "isa", ); VIR_ENUM_IMPL(virDomainControllerModelPCI, @@ -445,6 +446,9 @@ VIR_ENUM_IMPL(virDomainControllerModelSCSI, "virtio-non-transitional", ); +VIR_ENUM_IMPL(virDomainControllerModelISA, VIR_DOMAIN_CONTROLLER_MODEL_ISA_LAST, +); + VIR_ENUM_IMPL(virDomainControllerModelUSB, VIR_DOMAIN_CONTROLLER_MODEL_USB_LAST, "piix3-uhci", @@ -2337,6 +2341,7 @@ virDomainControllerDefNew(virDomainControllerType type) case VIR_DOMAIN_CONTROLLER_TYPE_SCSI: case VIR_DOMAIN_CONTROLLER_TYPE_SATA: case VIR_DOMAIN_CONTROLLER_TYPE_CCID: + case VIR_DOMAIN_CONTROLLER_TYPE_ISA: case VIR_DOMAIN_CONTROLLER_TYPE_LAST: break; } @@ -11047,6 +11052,8 @@ virDomainControllerModelTypeFromString(const virDomainControllerDef *def, return virDomainControllerModelIDETypeFromString(model); else if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL) return virDomainControllerModelVirtioSerialTypeFromString(model); + else if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_ISA) + return virDomainControllerModelISATypeFromString(model); return -1; } @@ -11066,6 +11073,8 @@ virDomainControllerModelTypeToString(virDomainControllerDefPtr def, return virDomainControllerModelIDETypeToString(model); else if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL) return virDomainControllerModelVirtioSerialTypeToString(model); + else if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_ISA) + return virDomainControllerModelISATypeToString(model); return NULL; } diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index cf76f340ee..4724206828 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -599,6 +599,7 @@ typedef enum { VIR_DOMAIN_CONTROLLER_TYPE_USB, VIR_DOMAIN_CONTROLLER_TYPE_PCI, VIR_DOMAIN_CONTROLLER_TYPE_XENBUS, + VIR_DOMAIN_CONTROLLER_TYPE_ISA, VIR_DOMAIN_CONTROLLER_TYPE_LAST } virDomainControllerType; @@ -690,6 +691,12 @@ typedef enum { VIR_DOMAIN_CONTROLLER_MODEL_VIRTIO_SERIAL_LAST } virDomainControllerModelVirtioSerial; +typedef enum { + VIR_DOMAIN_CONTROLLER_MODEL_ISA_DEFAULT = -1, + + VIR_DOMAIN_CONTROLLER_MODEL_ISA_LAST +} virDomainControllerModelISA; + #define IS_USB2_CONTROLLER(ctrl) \ (((ctrl)->type == VIR_DOMAIN_CONTROLLER_TYPE_USB) && \ ((ctrl)->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_EHCI1 || \ @@ -3597,6 +3604,7 @@ VIR_ENUM_DECL(virDomainControllerModelSCSI); VIR_ENUM_DECL(virDomainControllerModelUSB); VIR_ENUM_DECL(virDomainControllerModelIDE); VIR_ENUM_DECL(virDomainControllerModelVirtioSerial); +VIR_ENUM_DECL(virDomainControllerModelISA); VIR_ENUM_DECL(virDomainFS); VIR_ENUM_DECL(virDomainFSDriver); VIR_ENUM_DECL(virDomainFSAccessMode); diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 0ba348e911..91b59538aa 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2681,6 +2681,7 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef, case VIR_DOMAIN_CONTROLLER_TYPE_IDE: case VIR_DOMAIN_CONTROLLER_TYPE_FDC: case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS: + case VIR_DOMAIN_CONTROLLER_TYPE_ISA: case VIR_DOMAIN_CONTROLLER_TYPE_LAST: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Unsupported controller type: %s"), diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index ac443c5ddc..a73a77f2e9 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4930,6 +4930,7 @@ qemuDomainControllerDefPostParse(virDomainControllerDefPtr cont, case VIR_DOMAIN_CONTROLLER_TYPE_IDE: case VIR_DOMAIN_CONTROLLER_TYPE_FDC: case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS: + case VIR_DOMAIN_CONTROLLER_TYPE_ISA: case VIR_DOMAIN_CONTROLLER_TYPE_LAST: break; } diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index cbf8ffddd7..61eb53ea2c 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -678,6 +678,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev, case VIR_DOMAIN_CONTROLLER_TYPE_FDC: case VIR_DOMAIN_CONTROLLER_TYPE_CCID: case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS: + case VIR_DOMAIN_CONTROLLER_TYPE_ISA: case VIR_DOMAIN_CONTROLLER_TYPE_LAST: return 0; } diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 070f1c962b..e250845991 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3241,6 +3241,7 @@ qemuValidateDomainDeviceDefController(const virDomainControllerDef *controller, case VIR_DOMAIN_CONTROLLER_TYPE_CCID: case VIR_DOMAIN_CONTROLLER_TYPE_USB: case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS: + case VIR_DOMAIN_CONTROLLER_TYPE_ISA: case VIR_DOMAIN_CONTROLLER_TYPE_LAST: break; } diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index bae62f6967..9978741a64 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -397,6 +397,7 @@ vboxSetStorageController(virDomainControllerDefPtr controller, case VIR_DOMAIN_CONTROLLER_TYPE_USB: case VIR_DOMAIN_CONTROLLER_TYPE_PCI: case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS: + case VIR_DOMAIN_CONTROLLER_TYPE_ISA: case VIR_DOMAIN_CONTROLLER_TYPE_LAST: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("The vbox driver does not support %s controller type"), -- 2.27.0