[PATCH v5 0/2] bhyve: support 'isa' controller for LPC

Changes from v4: - Document 'isa' controller type in docs/formatdomain.html.in. While here, add 'xenbus' which was also missing. Roman Bogorodskiy (2): conf: add 'isa' controller type bhyve: support 'isa' controller for LPC docs/formatdomain.html.in | 6 ++-- docs/schemas/domaincommon.rng | 6 ++++ src/bhyve/bhyve_command.c | 27 +++++++------- src/bhyve/bhyve_device.c | 23 +++++++++--- src/bhyve/bhyve_domain.c | 25 +++++++++++-- src/bhyve/bhyve_domain.h | 2 -- 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 + ...ml2argv-addr-isa-controller-on-slot-1.args | 10 ++++++ ...2argv-addr-isa-controller-on-slot-1.ldargs | 3 ++ ...xml2argv-addr-isa-controller-on-slot-1.xml | 26 ++++++++++++++ ...l2argv-addr-isa-controller-on-slot-31.args | 10 ++++++ ...argv-addr-isa-controller-on-slot-31.ldargs | 3 ++ ...ml2argv-addr-isa-controller-on-slot-31.xml | 26 ++++++++++++++ ...argv-addr-non-isa-controller-on-slot-1.xml | 23 ++++++++++++ .../bhyvexml2argv-console.args | 2 +- .../bhyvexml2argv-isa-controller.args | 10 ++++++ .../bhyvexml2argv-isa-controller.ldargs | 3 ++ .../bhyvexml2argv-isa-controller.xml | 24 +++++++++++++ ...bhyvexml2argv-isa-multiple-controllers.xml | 25 +++++++++++++ .../bhyvexml2argv-serial-grub-nocons.args | 2 +- .../bhyvexml2argv-serial-grub.args | 2 +- .../bhyvexml2argv-serial.args | 2 +- .../bhyvexml2argvdata/bhyvexml2argv-uefi.args | 4 +-- .../bhyvexml2argv-vnc-autoport.args | 4 +-- .../bhyvexml2argv-vnc-vgaconf-io.args | 4 +-- .../bhyvexml2argv-vnc-vgaconf-off.args | 4 +-- .../bhyvexml2argv-vnc-vgaconf-on.args | 4 +-- .../bhyvexml2argvdata/bhyvexml2argv-vnc.args | 4 +-- tests/bhyvexml2argvtest.c | 5 +++ ...l2xmlout-addr-isa-controller-on-slot-1.xml | 36 +++++++++++++++++++ ...2xmlout-addr-isa-controller-on-slot-31.xml | 36 +++++++++++++++++++ .../bhyvexml2xmlout-console.xml | 3 ++ .../bhyvexml2xmlout-isa-controller.xml | 36 +++++++++++++++++++ .../bhyvexml2xmlout-serial-grub-nocons.xml | 3 ++ .../bhyvexml2xmlout-serial-grub.xml | 3 ++ .../bhyvexml2xmlout-serial.xml | 3 ++ .../bhyvexml2xmlout-vnc-autoport.xml | 3 ++ .../bhyvexml2xmlout-vnc-vgaconf-io.xml | 3 ++ .../bhyvexml2xmlout-vnc-vgaconf-off.xml | 3 ++ .../bhyvexml2xmlout-vnc-vgaconf-on.xml | 3 ++ .../bhyvexml2xmlout-vnc.xml | 3 ++ tests/bhyvexml2xmltest.c | 3 ++ 48 files changed, 409 insertions(+), 40 deletions(-) create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.args create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.ldargs create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.args create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.ldargs create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-non-isa-controller-on-slot-1.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.args create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.ldargs create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-multiple-controllers.xml create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-1.xml create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-31.xml create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-isa-controller.xml -- 2.27.0

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@gmail.com> --- docs/formatdomain.html.in | 6 +++--- 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 + 9 files changed, 31 insertions(+), 3 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 6b67a09bb3..f70e5abab8 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -4706,9 +4706,9 @@ <p> Each controller has a mandatory attribute <code>type</code>, - which must be one of 'ide', 'fdc', 'scsi', 'sata', 'usb', - 'ccid', 'virtio-serial' or 'pci', and a mandatory - attribute <code>index</code> which is the decimal integer + which must be one of 'ide', 'fdc', 'scsi', 'sata', 'usb', 'ccid', 'virtio-serial', + 'xenbus', 'pci', or 'isa' (<span class="since">since 6.7.0</span>), + and a mandatory attribute <code>index</code> which is the decimal integer describing in which order the bus controller is encountered (for use in <code>controller</code> attributes of <code><address></code> elements). diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 8cbbd7e6e9..11793a5ef5 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2416,6 +2416,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 386b04b5b8..44b7a524ec 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -399,6 +399,7 @@ VIR_ENUM_IMPL(virDomainController, "usb", "pci", "xenbus", + "isa", ); VIR_ENUM_IMPL(virDomainControllerModelPCI, @@ -444,6 +445,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", @@ -2318,6 +2322,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; } @@ -10994,6 +10999,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; } @@ -11013,6 +11020,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 6e9da298b4..e193cf9c5f 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -595,6 +595,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; @@ -686,6 +687,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 || \ @@ -3558,6 +3565,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 839c93bfb4..391b3ea892 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2679,6 +2679,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 2058290870..733141d9e4 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4891,6 +4891,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 058cbda2a2..4e548d2f43 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -677,6 +677,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 488f258d00..5434c9e4c7 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3220,6 +3220,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 15f8eb074a..9b38963e2a 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

On Sat, Aug 01, 2020 at 10:16:56AM +0400, Roman Bogorodskiy wrote:
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@gmail.com> --- docs/formatdomain.html.in | 6 +++--- 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 + 9 files changed, 31 insertions(+), 3 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On a Saturday in 2020, Roman Bogorodskiy wrote:
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@gmail.com> --- docs/formatdomain.html.in | 6 +++--- 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 + 9 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 6b67a09bb3..f70e5abab8 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -4706,9 +4706,9 @@
<p> Each controller has a mandatory attribute <code>type</code>, - which must be one of 'ide', 'fdc', 'scsi', 'sata', 'usb', - 'ccid', 'virtio-serial' or 'pci', and a mandatory - attribute <code>index</code> which is the decimal integer + which must be one of 'ide', 'fdc', 'scsi', 'sata', 'usb', 'ccid', 'virtio-serial', + 'xenbus', 'pci', or 'isa' (<span class="since">since 6.7.0</span>),
this will be: isa (:since:`since 6.8.0`) in the .rst version
+ and a mandatory attribute <code>index</code> which is the decimal integer describing in which order the bus controller is encountered (for use in <code>controller</code> attributes of <code><address></code> elements).
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

Support modeling of the 'isa' controller for bhyve. User can manually define any PCI slot for the 'isa' controller, including PCI slot 1, but other devices are not allowed to use this address. When domain configuration requires the 'isa' controller to be present, automatically add it on domain post-parse stage. Now, as this controller is always available when needed, it's not necessary to implicitly add it to the bhyve command line, so remove bhyveBuildLPCArgStr(). Also, make bhyveDomainDefNeedsISAController() static as it's no longer used outside of bhyve_domain.c. As more than one ISA controller is not supported by bhyve, and multiple controllers with the same index are forbidden, so forbid ISA controllers with non-zero index for bhyve. Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com> --- src/bhyve/bhyve_command.c | 27 +++++++------- src/bhyve/bhyve_device.c | 23 +++++++++--- src/bhyve/bhyve_domain.c | 25 +++++++++++-- src/bhyve/bhyve_domain.h | 2 -- ...ml2argv-addr-isa-controller-on-slot-1.args | 10 ++++++ ...2argv-addr-isa-controller-on-slot-1.ldargs | 3 ++ ...xml2argv-addr-isa-controller-on-slot-1.xml | 26 ++++++++++++++ ...l2argv-addr-isa-controller-on-slot-31.args | 10 ++++++ ...argv-addr-isa-controller-on-slot-31.ldargs | 3 ++ ...ml2argv-addr-isa-controller-on-slot-31.xml | 26 ++++++++++++++ ...argv-addr-non-isa-controller-on-slot-1.xml | 23 ++++++++++++ .../bhyvexml2argv-console.args | 2 +- .../bhyvexml2argv-isa-controller.args | 10 ++++++ .../bhyvexml2argv-isa-controller.ldargs | 3 ++ .../bhyvexml2argv-isa-controller.xml | 24 +++++++++++++ ...bhyvexml2argv-isa-multiple-controllers.xml | 25 +++++++++++++ .../bhyvexml2argv-serial-grub-nocons.args | 2 +- .../bhyvexml2argv-serial-grub.args | 2 +- .../bhyvexml2argv-serial.args | 2 +- .../bhyvexml2argvdata/bhyvexml2argv-uefi.args | 4 +-- .../bhyvexml2argv-vnc-autoport.args | 4 +-- .../bhyvexml2argv-vnc-vgaconf-io.args | 4 +-- .../bhyvexml2argv-vnc-vgaconf-off.args | 4 +-- .../bhyvexml2argv-vnc-vgaconf-on.args | 4 +-- .../bhyvexml2argvdata/bhyvexml2argv-vnc.args | 4 +-- tests/bhyvexml2argvtest.c | 5 +++ ...l2xmlout-addr-isa-controller-on-slot-1.xml | 36 +++++++++++++++++++ ...2xmlout-addr-isa-controller-on-slot-31.xml | 36 +++++++++++++++++++ .../bhyvexml2xmlout-console.xml | 3 ++ .../bhyvexml2xmlout-isa-controller.xml | 36 +++++++++++++++++++ .../bhyvexml2xmlout-serial-grub-nocons.xml | 3 ++ .../bhyvexml2xmlout-serial-grub.xml | 3 ++ .../bhyvexml2xmlout-serial.xml | 3 ++ .../bhyvexml2xmlout-vnc-autoport.xml | 3 ++ .../bhyvexml2xmlout-vnc-vgaconf-io.xml | 3 ++ .../bhyvexml2xmlout-vnc-vgaconf-off.xml | 3 ++ .../bhyvexml2xmlout-vnc-vgaconf-on.xml | 3 ++ .../bhyvexml2xmlout-vnc.xml | 3 ++ tests/bhyvexml2xmltest.c | 3 ++ 39 files changed, 378 insertions(+), 37 deletions(-) create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.args create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.ldargs create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.args create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.ldargs create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-non-isa-controller-on-slot-1.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.args create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.ldargs create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-multiple-controllers.xml create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-1.xml create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-31.xml create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-isa-controller.xml diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c index 22d0b24ec4..2a3e10d649 100644 --- a/src/bhyve/bhyve_command.c +++ b/src/bhyve/bhyve_command.c @@ -329,7 +329,8 @@ bhyveBuildControllerArgStr(const virDomainDef *def, virDomainControllerDefPtr controller, bhyveConnPtr driver, virCommandPtr cmd, - unsigned *nusbcontrollers) + unsigned *nusbcontrollers, + unsigned *nisacontrollers) { switch (controller->type) { case VIR_DOMAIN_CONTROLLER_TYPE_PCI: @@ -354,18 +355,20 @@ bhyveBuildControllerArgStr(const virDomainDef *def, if (bhyveBuildUSBControllerArgStr(def, controller, cmd) < 0) return -1; break; + case VIR_DOMAIN_CONTROLLER_TYPE_ISA: + if (++*nisacontrollers > 1) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("only single ISA controller is supported")); + return -1; + } + virCommandAddArg(cmd, "-s"); + virCommandAddArgFormat(cmd, "%d:0,lpc", + controller->info.addr.pci.slot); + break; } return 0; } -static int -bhyveBuildLPCArgStr(const virDomainDef *def G_GNUC_UNUSED, - virCommandPtr cmd) -{ - virCommandAddArgList(cmd, "-s", "1,lpc", NULL); - return 0; -} - static int bhyveBuildGraphicsArgStr(const virDomainDef *def, virDomainGraphicsDefPtr graphics, @@ -490,6 +493,7 @@ virBhyveProcessBuildBhyveCmd(bhyveConnPtr driver, virDomainDefPtr def, virCommandPtr cmd = virCommandNew(BHYVE); size_t i; unsigned nusbcontrollers = 0; + unsigned nisacontrollers = 0; unsigned nvcpus = virDomainDefGetVcpus(def); /* CPUs */ @@ -595,7 +599,7 @@ virBhyveProcessBuildBhyveCmd(bhyveConnPtr driver, virDomainDefPtr def, /* Devices */ for (i = 0; i < def->ncontrollers; i++) { if (bhyveBuildControllerArgStr(def, def->controllers[i], driver, cmd, - &nusbcontrollers) < 0) + &nusbcontrollers, &nisacontrollers) < 0) goto error; } for (i = 0; i < def->nnets; i++) { @@ -619,9 +623,6 @@ virBhyveProcessBuildBhyveCmd(bhyveConnPtr driver, virDomainDefPtr def, } } - if (bhyveDomainDefNeedsISAController(def)) - bhyveBuildLPCArgStr(def, cmd); - if (bhyveBuildConsoleArgStr(def, cmd) < 0) goto error; diff --git a/src/bhyve/bhyve_device.c b/src/bhyve/bhyve_device.c index fc52280361..52a055f205 100644 --- a/src/bhyve/bhyve_device.c +++ b/src/bhyve/bhyve_device.c @@ -46,10 +46,16 @@ bhyveCollectPCIAddress(virDomainDefPtr def G_GNUC_UNUSED, if (addr->slot == 0) { return 0; } else if (addr->slot == 1) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("PCI bus 0 slot 1 is reserved for the implicit " - "LPC PCI-ISA bridge")); - return -1; + if (!(device->type == VIR_DOMAIN_DEVICE_CONTROLLER && + device->data.controller->type == VIR_DOMAIN_CONTROLLER_TYPE_ISA)) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("PCI bus 0 slot 1 is reserved for the implicit " + "LPC PCI-ISA bridge")); + return -1; + } else { + /* We reserve slot 1 for LPC in bhyveAssignDevicePCISlots(), so exit early */ + return 0; + } } } @@ -101,6 +107,15 @@ bhyveAssignDevicePCISlots(virDomainDefPtr def, return -1; } + for (i = 0; i < def->ncontrollers; i++) { + if ((def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_ISA) && + virDeviceInfoPCIAddressIsWanted(&def->controllers[i]->info)) { + def->controllers[i]->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI; + def->controllers[i]->info.addr.pci = lpc_addr; + break; + } + } + for (i = 0; i < def->ncontrollers; i++) { if ((def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI) || (def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_SATA) || diff --git a/src/bhyve/bhyve_domain.c b/src/bhyve/bhyve_domain.c index 95d6ffd31c..91994c3da5 100644 --- a/src/bhyve/bhyve_domain.c +++ b/src/bhyve/bhyve_domain.c @@ -59,13 +59,13 @@ virDomainXMLPrivateDataCallbacks virBhyveDriverPrivateDataCallbacks = { .free = bhyveDomainObjPrivateFree, }; -bool +static bool bhyveDomainDefNeedsISAController(virDomainDefPtr def) { if (def->os.bootloader == NULL && def->os.loader) return true; - if (def->nserials) + if (def->nserials || def->nconsoles) return true; if (def->ngraphics && def->nvideos) @@ -95,6 +95,11 @@ bhyveDomainDefPostParse(virDomainDefPtr def, VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT) < 0) return -1; + if (bhyveDomainDefNeedsISAController(def)) + if (virDomainDefMaybeAddController(def, VIR_DOMAIN_CONTROLLER_TYPE_ISA, 0, + VIR_DOMAIN_CONTROLLER_MODEL_ISA_DEFAULT) < 0) + return -1; + return 0; } @@ -191,10 +196,26 @@ virBhyveDriverCreateXMLConf(bhyveConnPtr driver) NULL, NULL); } + +static int +bhyveDomainDeviceDefValidate(const virDomainDeviceDef *dev, + const virDomainDef *def G_GNUC_UNUSED, + void *opaque G_GNUC_UNUSED) +{ + if (dev->type == VIR_DOMAIN_DEVICE_CONTROLLER && + dev->data.controller->type == VIR_DOMAIN_CONTROLLER_TYPE_ISA && + dev->data.controller->idx != 0) { + return -1; + } + + return 0; +} + virDomainDefParserConfig virBhyveDriverDomainDefParserConfig = { .devicesPostParseCallback = bhyveDomainDeviceDefPostParse, .domainPostParseCallback = bhyveDomainDefPostParse, .assignAddressesCallback = bhyveDomainDefAssignAddresses, + .deviceValidateCallback = bhyveDomainDeviceDefValidate, }; static void diff --git a/src/bhyve/bhyve_domain.h b/src/bhyve/bhyve_domain.h index e985278041..4e2b11b8de 100644 --- a/src/bhyve/bhyve_domain.h +++ b/src/bhyve/bhyve_domain.h @@ -39,5 +39,3 @@ virDomainXMLOptionPtr virBhyveDriverCreateXMLConf(bhyveConnPtr); extern virDomainXMLPrivateDataCallbacks virBhyveDriverPrivateDataCallbacks; extern virDomainDefParserConfig virBhyveDriverDomainDefParserConfig; extern virXMLNamespace virBhyveDriverDomainXMLNamespace; - -bool bhyveDomainDefNeedsISAController(virDomainDefPtr def); diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.args b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.args new file mode 100644 index 0000000000..910d1bbcfa --- /dev/null +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.args @@ -0,0 +1,10 @@ +/usr/sbin/bhyve \ +-c 1 \ +-m 214 \ +-u \ +-H \ +-P \ +-s 0:0,hostbridge \ +-s 1:0,lpc \ +-s 2:0,ahci,hd:/tmp/freebsd.img \ +-s 3:0,virtio-net,faketapdev,mac=52:54:00:b9:94:02 bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.ldargs b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.ldargs new file mode 100644 index 0000000000..32538b558e --- /dev/null +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.ldargs @@ -0,0 +1,3 @@ +/usr/sbin/bhyveload \ +-m 214 \ +-d /tmp/freebsd.img bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.xml b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.xml new file mode 100644 index 0000000000..4a72ca65a1 --- /dev/null +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.xml @@ -0,0 +1,26 @@ +<domain type='bhyve'> + <name>bhyve</name> + <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid> + <memory>219136</memory> + <vcpu>1</vcpu> + <os> + <type>hvm</type> + </os> + <devices> + <controller type='isa' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </controller> + <disk type='file'> + <driver name='file' type='raw'/> + <source file='/tmp/freebsd.img'/> + <target dev='hda' bus='sata'/> + <address type='drive' controller='0' bus='0' target='2' unit='0'/> + </disk> + <interface type='bridge'> + <mac address='52:54:00:b9:94:02'/> + <model type='virtio'/> + <source bridge="virbr0"/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </interface> + </devices> +</domain> diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.args b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.args new file mode 100644 index 0000000000..ee833eb460 --- /dev/null +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.args @@ -0,0 +1,10 @@ +/usr/sbin/bhyve \ +-c 1 \ +-m 214 \ +-u \ +-H \ +-P \ +-s 0:0,hostbridge \ +-s 31:0,lpc \ +-s 2:0,ahci,hd:/tmp/freebsd.img \ +-s 3:0,virtio-net,faketapdev,mac=52:54:00:b9:94:02 bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.ldargs b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.ldargs new file mode 100644 index 0000000000..32538b558e --- /dev/null +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.ldargs @@ -0,0 +1,3 @@ +/usr/sbin/bhyveload \ +-m 214 \ +-d /tmp/freebsd.img bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.xml b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.xml new file mode 100644 index 0000000000..3b8e8a3664 --- /dev/null +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.xml @@ -0,0 +1,26 @@ +<domain type='bhyve'> + <name>bhyve</name> + <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid> + <memory>219136</memory> + <vcpu>1</vcpu> + <os> + <type>hvm</type> + </os> + <devices> + <controller type='isa' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x0'/> + </controller> + <disk type='file'> + <driver name='file' type='raw'/> + <source file='/tmp/freebsd.img'/> + <target dev='hda' bus='sata'/> + <address type='drive' controller='0' bus='0' target='2' unit='0'/> + </disk> + <interface type='bridge'> + <mac address='52:54:00:b9:94:02'/> + <model type='virtio'/> + <source bridge="virbr0"/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </interface> + </devices> +</domain> diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-addr-non-isa-controller-on-slot-1.xml b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-non-isa-controller-on-slot-1.xml new file mode 100644 index 0000000000..88ad9aebb7 --- /dev/null +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-non-isa-controller-on-slot-1.xml @@ -0,0 +1,23 @@ +<domain type='bhyve'> + <name>bhyve</name> + <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid> + <memory>219136</memory> + <vcpu>1</vcpu> + <os> + <type>hvm</type> + </os> + <devices> + <disk type='file'> + <driver name='file' type='raw'/> + <source file='/tmp/freebsd.img'/> + <target dev='hda' bus='sata'/> + <address type='drive' controller='0' bus='0' target='2' unit='0'/> + </disk> + <interface type='bridge'> + <mac address='52:54:00:b9:94:02'/> + <model type='virtio'/> + <source bridge="virbr0"/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </interface> + </devices> +</domain> diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-console.args b/tests/bhyvexml2argvdata/bhyvexml2argv-console.args index 6ab91ae7e4..25fbd4727e 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-console.args +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-console.args @@ -5,7 +5,7 @@ -H \ -P \ -s 0:0,hostbridge \ +-s 1:0,lpc \ -s 2:0,ahci,hd:/tmp/freebsd.img \ -s 3:0,virtio-net,faketapdev,mac=52:54:00:b1:42:eb \ --s 1,lpc \ -l com1,/dev/nmdm0A bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.args b/tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.args new file mode 100644 index 0000000000..910d1bbcfa --- /dev/null +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.args @@ -0,0 +1,10 @@ +/usr/sbin/bhyve \ +-c 1 \ +-m 214 \ +-u \ +-H \ +-P \ +-s 0:0,hostbridge \ +-s 1:0,lpc \ +-s 2:0,ahci,hd:/tmp/freebsd.img \ +-s 3:0,virtio-net,faketapdev,mac=52:54:00:b9:94:02 bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.ldargs b/tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.ldargs new file mode 100644 index 0000000000..32538b558e --- /dev/null +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.ldargs @@ -0,0 +1,3 @@ +/usr/sbin/bhyveload \ +-m 214 \ +-d /tmp/freebsd.img bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.xml b/tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.xml new file mode 100644 index 0000000000..279ac6669a --- /dev/null +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.xml @@ -0,0 +1,24 @@ +<domain type='bhyve'> + <name>bhyve</name> + <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid> + <memory>219136</memory> + <vcpu>1</vcpu> + <os> + <type>hvm</type> + </os> + <devices> + <controller type='isa' index='0'/> + <disk type='file'> + <driver name='file' type='raw'/> + <source file='/tmp/freebsd.img'/> + <target dev='hda' bus='sata'/> + <address type='drive' controller='0' bus='0' target='2' unit='0'/> + </disk> + <interface type='bridge'> + <mac address='52:54:00:b9:94:02'/> + <model type='virtio'/> + <source bridge="virbr0"/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </interface> + </devices> +</domain> diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-isa-multiple-controllers.xml b/tests/bhyvexml2argvdata/bhyvexml2argv-isa-multiple-controllers.xml new file mode 100644 index 0000000000..d087d5fb4c --- /dev/null +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-isa-multiple-controllers.xml @@ -0,0 +1,25 @@ +<domain type='bhyve'> + <name>bhyve</name> + <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid> + <memory>219136</memory> + <vcpu>1</vcpu> + <os> + <type>hvm</type> + </os> + <devices> + <controller type='isa' index='1'/> + <controller type='isa' index='2'/> + <disk type='file'> + <driver name='file' type='raw'/> + <source file='/tmp/freebsd.img'/> + <target dev='hda' bus='sata'/> + <address type='drive' controller='0' bus='0' target='2' unit='0'/> + </disk> + <interface type='bridge'> + <mac address='52:54:00:b9:94:02'/> + <model type='virtio'/> + <source bridge="virbr0"/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </interface> + </devices> +</domain> diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub-nocons.args b/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub-nocons.args index 42a278208d..02846cb893 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub-nocons.args +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub-nocons.args @@ -5,7 +5,7 @@ -H \ -P \ -s 0:0,hostbridge \ +-s 1:0,lpc \ -s 2:0,ahci-hd,/tmp/freebsd.img \ -s 3:0,virtio-net,faketapdev,mac=52:54:00:a7:cd:5b \ --s 1,lpc \ -l com1,/dev/nmdm0A bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub.args b/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub.args index 313724dc90..e4712b448c 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub.args +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub.args @@ -5,7 +5,7 @@ -H \ -P \ -s 0:0,hostbridge \ +-s 1:0,lpc \ -s 2:0,ahci,hd:/tmp/freebsd.img \ -s 3:0,virtio-net,faketapdev,mac=52:54:00:f0:72:11 \ --s 1,lpc \ -l com1,/dev/nmdm0A bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-serial.args b/tests/bhyvexml2argvdata/bhyvexml2argv-serial.args index 059e457072..f45a190137 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-serial.args +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-serial.args @@ -5,7 +5,7 @@ -H \ -P \ -s 0:0,hostbridge \ +-s 1:0,lpc \ -s 2:0,ahci,hd:/tmp/freebsd.img \ -s 3:0,virtio-net,faketapdev,mac=52:54:00:4f:f3:5b \ --s 1,lpc \ -l com1,/dev/nmdm0A bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-uefi.args b/tests/bhyvexml2argvdata/bhyvexml2argv-uefi.args index 8ff8673ed4..937b066e8c 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-uefi.args +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-uefi.args @@ -6,6 +6,6 @@ -P \ -s 0:0,hostbridge \ -l bootrom,/path/to/test.fd \ +-s 1:0,lpc \ -s 2:0,ahci,hd:/tmp/freebsd.img \ --s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \ --s 1,lpc bhyve +-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-autoport.args b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-autoport.args index 039526ff35..551469dabe 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-autoport.args +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-autoport.args @@ -6,7 +6,7 @@ -P \ -s 0:0,hostbridge \ -l bootrom,/path/to/test.fd \ +-s 1:0,lpc \ -s 2:0,ahci,hd:/tmp/freebsd.img \ -s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \ --s 4:0,fbuf,tcp=127.0.0.1:5900 \ --s 1,lpc bhyve +-s 4:0,fbuf,tcp=127.0.0.1:5900 bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf-io.args b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf-io.args index da37971009..47022e84cf 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf-io.args +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf-io.args @@ -6,7 +6,7 @@ -P \ -s 0:0,hostbridge \ -l bootrom,/path/to/test.fd \ +-s 1:0,lpc \ -s 2:0,ahci,hd:/tmp/freebsd.img \ -s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \ --s 4:0,fbuf,tcp=127.0.0.1:5904,vga=io \ --s 1,lpc bhyve +-s 4:0,fbuf,tcp=127.0.0.1:5904,vga=io bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf-off.args b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf-off.args index 70347ee0b6..923098f3db 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf-off.args +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf-off.args @@ -6,7 +6,7 @@ -P \ -s 0:0,hostbridge \ -l bootrom,/path/to/test.fd \ +-s 1:0,lpc \ -s 2:0,ahci,hd:/tmp/freebsd.img \ -s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \ --s 4:0,fbuf,tcp=127.0.0.1:5904,vga=off \ --s 1,lpc bhyve +-s 4:0,fbuf,tcp=127.0.0.1:5904,vga=off bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf-on.args b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf-on.args index d0e1d81e2a..9225f5d133 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf-on.args +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf-on.args @@ -6,7 +6,7 @@ -P \ -s 0:0,hostbridge \ -l bootrom,/path/to/test.fd \ +-s 1:0,lpc \ -s 2:0,ahci,hd:/tmp/freebsd.img \ -s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \ --s 4:0,fbuf,tcp=127.0.0.1:5904,vga=on \ --s 1,lpc bhyve +-s 4:0,fbuf,tcp=127.0.0.1:5904,vga=on bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc.args b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc.args index 90889b8f39..cd7a543265 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc.args +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc.args @@ -6,7 +6,7 @@ -P \ -s 0:0,hostbridge \ -l bootrom,/path/to/test.fd \ +-s 1:0,lpc \ -s 2:0,ahci,hd:/tmp/freebsd.img \ -s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \ --s 4:0,fbuf,tcp=127.0.0.1:5904 \ --s 1,lpc bhyve +-s 4:0,fbuf,tcp=127.0.0.1:5904 bhyve diff --git a/tests/bhyvexml2argvtest.c b/tests/bhyvexml2argvtest.c index 9e7eb218b8..6e8b62dc9b 100644 --- a/tests/bhyvexml2argvtest.c +++ b/tests/bhyvexml2argvtest.c @@ -210,6 +210,8 @@ mymain(void) DO_TEST_FAILURE("cputopology-nvcpu-mismatch"); DO_TEST("commandline"); DO_TEST("msrs"); + DO_TEST("isa-controller"); + DO_TEST_FAILURE("isa-multiple-controllers"); /* Address allocation tests */ DO_TEST("addr-single-sata-disk"); @@ -217,6 +219,9 @@ mymain(void) DO_TEST("addr-more-than-32-sata-disks"); DO_TEST("addr-single-virtio-disk"); DO_TEST("addr-multiple-virtio-disks"); + DO_TEST("addr-isa-controller-on-slot-1"); + DO_TEST("addr-isa-controller-on-slot-31"); + DO_TEST_FAILURE("addr-non-isa-controller-on-slot-1"); /* The same without 32 devs per controller support */ driver.bhyvecaps ^= BHYVE_CAP_AHCI32SLOT; diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-1.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-1.xml new file mode 100644 index 0000000000..c1424a65e6 --- /dev/null +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-1.xml @@ -0,0 +1,36 @@ +<domain type='bhyve'> + <name>bhyve</name> + <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid> + <memory unit='KiB'>219136</memory> + <currentMemory unit='KiB'>219136</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='x86_64'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <disk type='file' device='disk'> + <driver name='file' type='raw'/> + <source file='/tmp/freebsd.img'/> + <target dev='hda' bus='sata'/> + <address type='drive' controller='0' bus='0' target='2' unit='0'/> + </disk> + <controller type='isa' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <controller type='sata' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> + </controller> + <interface type='bridge'> + <mac address='52:54:00:b9:94:02'/> + <source bridge='virbr0'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </interface> + </devices> +</domain> diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-31.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-31.xml new file mode 100644 index 0000000000..f99c5b6431 --- /dev/null +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-31.xml @@ -0,0 +1,36 @@ +<domain type='bhyve'> + <name>bhyve</name> + <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid> + <memory unit='KiB'>219136</memory> + <currentMemory unit='KiB'>219136</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='x86_64'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <disk type='file' device='disk'> + <driver name='file' type='raw'/> + <source file='/tmp/freebsd.img'/> + <target dev='hda' bus='sata'/> + <address type='drive' controller='0' bus='0' target='2' unit='0'/> + </disk> + <controller type='isa' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <controller type='sata' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> + </controller> + <interface type='bridge'> + <mac address='52:54:00:b9:94:02'/> + <source bridge='virbr0'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </interface> + </devices> +</domain> diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-console.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-console.xml index 78d4d30016..5309bdc7cf 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-console.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-console.xml @@ -20,6 +20,9 @@ <address type='drive' controller='0' bus='0' target='2' unit='0'/> </disk> <controller type='pci' index='0' model='pci-root'/> + <controller type='isa' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </controller> <controller type='sata' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </controller> diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-isa-controller.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-isa-controller.xml new file mode 100644 index 0000000000..c1424a65e6 --- /dev/null +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-isa-controller.xml @@ -0,0 +1,36 @@ +<domain type='bhyve'> + <name>bhyve</name> + <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid> + <memory unit='KiB'>219136</memory> + <currentMemory unit='KiB'>219136</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='x86_64'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <disk type='file' device='disk'> + <driver name='file' type='raw'/> + <source file='/tmp/freebsd.img'/> + <target dev='hda' bus='sata'/> + <address type='drive' controller='0' bus='0' target='2' unit='0'/> + </disk> + <controller type='isa' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <controller type='sata' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> + </controller> + <interface type='bridge'> + <mac address='52:54:00:b9:94:02'/> + <source bridge='virbr0'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </interface> + </devices> +</domain> diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub-nocons.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub-nocons.xml index 845cb09e9f..f89d678abd 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub-nocons.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub-nocons.xml @@ -20,6 +20,9 @@ <address type='drive' controller='0' bus='0' target='2' unit='0'/> </disk> <controller type='pci' index='0' model='pci-root'/> + <controller type='isa' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </controller> <controller type='sata' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </controller> diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub.xml index 6c8fda32af..29a36499f5 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub.xml @@ -20,6 +20,9 @@ <address type='drive' controller='0' bus='0' target='2' unit='0'/> </disk> <controller type='pci' index='0' model='pci-root'/> + <controller type='isa' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </controller> <controller type='sata' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </controller> diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial.xml index eb50cc05ad..ec03da2bfe 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial.xml @@ -20,6 +20,9 @@ <address type='drive' controller='0' bus='0' target='2' unit='0'/> </disk> <controller type='pci' index='0' model='pci-root'/> + <controller type='isa' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </controller> <controller type='sata' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </controller> diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-autoport.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-autoport.xml index d6cfe76b70..041ab4e319 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-autoport.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-autoport.xml @@ -21,6 +21,9 @@ <address type='drive' controller='0' bus='0' target='2' unit='0'/> </disk> <controller type='pci' index='0' model='pci-root'/> + <controller type='isa' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </controller> <controller type='sata' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </controller> diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf-io.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf-io.xml index 9e470e432e..58e71282e7 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf-io.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf-io.xml @@ -21,6 +21,9 @@ <address type='drive' controller='0' bus='0' target='2' unit='0'/> </disk> <controller type='pci' index='0' model='pci-root'/> + <controller type='isa' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </controller> <controller type='sata' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </controller> diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf-off.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf-off.xml index 89c4ceac57..2c37762edb 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf-off.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf-off.xml @@ -21,6 +21,9 @@ <address type='drive' controller='0' bus='0' target='2' unit='0'/> </disk> <controller type='pci' index='0' model='pci-root'/> + <controller type='isa' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </controller> <controller type='sata' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </controller> diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf-on.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf-on.xml index 86d8939364..a9f37dca66 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf-on.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf-on.xml @@ -21,6 +21,9 @@ <address type='drive' controller='0' bus='0' target='2' unit='0'/> </disk> <controller type='pci' index='0' model='pci-root'/> + <controller type='isa' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </controller> <controller type='sata' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </controller> diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc.xml index 9e470e432e..58e71282e7 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc.xml @@ -21,6 +21,9 @@ <address type='drive' controller='0' bus='0' target='2' unit='0'/> </disk> <controller type='pci' index='0' model='pci-root'/> + <controller type='isa' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </controller> <controller type='sata' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </controller> diff --git a/tests/bhyvexml2xmltest.c b/tests/bhyvexml2xmltest.c index a0c20a14c1..cc04f8e3ce 100644 --- a/tests/bhyvexml2xmltest.c +++ b/tests/bhyvexml2xmltest.c @@ -110,6 +110,7 @@ mymain(void) DO_TEST_DIFFERENT("vnc-autoport"); DO_TEST_DIFFERENT("commandline"); DO_TEST_DIFFERENT("msrs"); + DO_TEST_DIFFERENT("isa-controller"); /* Address allocation tests */ DO_TEST_DIFFERENT("addr-single-sata-disk"); @@ -117,6 +118,8 @@ mymain(void) DO_TEST_DIFFERENT("addr-more-than-32-sata-disks"); DO_TEST_DIFFERENT("addr-single-virtio-disk"); DO_TEST_DIFFERENT("addr-multiple-virtio-disks"); + DO_TEST_DIFFERENT("addr-isa-controller-on-slot-1"); + DO_TEST_DIFFERENT("addr-isa-controller-on-slot-31"); /* The same without 32 devs per controller support */ driver.bhyvecaps ^= BHYVE_CAP_AHCI32SLOT; -- 2.27.0

On Sat, Aug 01, 2020 at 10:16:57AM +0400, Roman Bogorodskiy wrote:
Support modeling of the 'isa' controller for bhyve. User can manually define any PCI slot for the 'isa' controller, including PCI slot 1, but other devices are not allowed to use this address.
When domain configuration requires the 'isa' controller to be present, automatically add it on domain post-parse stage.
Now, as this controller is always available when needed, it's not necessary to implicitly add it to the bhyve command line, so remove bhyveBuildLPCArgStr().
Also, make bhyveDomainDefNeedsISAController() static as it's no longer used outside of bhyve_domain.c.
As more than one ISA controller is not supported by bhyve, and multiple controllers with the same index are forbidden, so forbid ISA controllers with non-zero index for bhyve.
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com> --- src/bhyve/bhyve_command.c | 27 +++++++------- src/bhyve/bhyve_device.c | 23 +++++++++--- src/bhyve/bhyve_domain.c | 25 +++++++++++-- src/bhyve/bhyve_domain.h | 2 -- ...ml2argv-addr-isa-controller-on-slot-1.args | 10 ++++++ ...2argv-addr-isa-controller-on-slot-1.ldargs | 3 ++ ...xml2argv-addr-isa-controller-on-slot-1.xml | 26 ++++++++++++++ ...l2argv-addr-isa-controller-on-slot-31.args | 10 ++++++ ...argv-addr-isa-controller-on-slot-31.ldargs | 3 ++ ...ml2argv-addr-isa-controller-on-slot-31.xml | 26 ++++++++++++++ ...argv-addr-non-isa-controller-on-slot-1.xml | 23 ++++++++++++ .../bhyvexml2argv-console.args | 2 +- .../bhyvexml2argv-isa-controller.args | 10 ++++++ .../bhyvexml2argv-isa-controller.ldargs | 3 ++ .../bhyvexml2argv-isa-controller.xml | 24 +++++++++++++ ...bhyvexml2argv-isa-multiple-controllers.xml | 25 +++++++++++++ .../bhyvexml2argv-serial-grub-nocons.args | 2 +- .../bhyvexml2argv-serial-grub.args | 2 +- .../bhyvexml2argv-serial.args | 2 +- .../bhyvexml2argvdata/bhyvexml2argv-uefi.args | 4 +-- .../bhyvexml2argv-vnc-autoport.args | 4 +-- .../bhyvexml2argv-vnc-vgaconf-io.args | 4 +-- .../bhyvexml2argv-vnc-vgaconf-off.args | 4 +-- .../bhyvexml2argv-vnc-vgaconf-on.args | 4 +-- .../bhyvexml2argvdata/bhyvexml2argv-vnc.args | 4 +-- tests/bhyvexml2argvtest.c | 5 +++ ...l2xmlout-addr-isa-controller-on-slot-1.xml | 36 +++++++++++++++++++ ...2xmlout-addr-isa-controller-on-slot-31.xml | 36 +++++++++++++++++++ .../bhyvexml2xmlout-console.xml | 3 ++ .../bhyvexml2xmlout-isa-controller.xml | 36 +++++++++++++++++++ .../bhyvexml2xmlout-serial-grub-nocons.xml | 3 ++ .../bhyvexml2xmlout-serial-grub.xml | 3 ++ .../bhyvexml2xmlout-serial.xml | 3 ++ .../bhyvexml2xmlout-vnc-autoport.xml | 3 ++ .../bhyvexml2xmlout-vnc-vgaconf-io.xml | 3 ++ .../bhyvexml2xmlout-vnc-vgaconf-off.xml | 3 ++ .../bhyvexml2xmlout-vnc-vgaconf-on.xml | 3 ++ .../bhyvexml2xmlout-vnc.xml | 3 ++ tests/bhyvexml2xmltest.c | 3 ++ 39 files changed, 378 insertions(+), 37 deletions(-) create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.args create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.ldargs create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.args create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.ldargs create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-non-isa-controller-on-slot-1.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.args create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.ldargs create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-multiple-controllers.xml create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-1.xml create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-31.xml create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-isa-controller.xml
diff --git a/src/bhyve/bhyve_device.c b/src/bhyve/bhyve_device.c index fc52280361..52a055f205 100644 --- a/src/bhyve/bhyve_device.c +++ b/src/bhyve/bhyve_device.c @@ -46,10 +46,16 @@ bhyveCollectPCIAddress(virDomainDefPtr def G_GNUC_UNUSED, if (addr->slot == 0) { return 0; } else if (addr->slot == 1) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("PCI bus 0 slot 1 is reserved for the implicit " - "LPC PCI-ISA bridge")); - return -1; + if (!(device->type == VIR_DOMAIN_DEVICE_CONTROLLER && + device->data.controller->type == VIR_DOMAIN_CONTROLLER_TYPE_ISA)) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("PCI bus 0 slot 1 is reserved for the implicit " + "LPC PCI-ISA bridge")); + return -1; + } else { + /* We reserve slot 1 for LPC in bhyveAssignDevicePCISlots(), so exit early */ + return 0; + }
I forgot to respond to your followup comments on v4 https://www.redhat.com/archives/libvir-list/2020-July/msg01761.html
IIUC, this series makes it possible to put the TPC in a different slot, so does it still make sense to forbid use of slot 1 as a hardcoded rule ?
IIRC, the idea behind that is to give some time window for users to allow moving guests from the new version to the old one. If we allow to use slot 1, it won't be possible to move the guest to the old libvirt as it will complain slot 1 should be used only for LPC.
If the user has decided to move their LPC to a slot != 1, then it is already impossible to migrate the guest to an old libvirt. If the user wants to explicitly specify another device in slot 1, then we should not prevent that. We just need to make sure that if no LPC is in the XML, and no other device explicitly has slot 1, then make sure to auto-assign LPC in slot 1 not some other device. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

Daniel P. Berrangé wrote:
On Sat, Aug 01, 2020 at 10:16:57AM +0400, Roman Bogorodskiy wrote:
Support modeling of the 'isa' controller for bhyve. User can manually define any PCI slot for the 'isa' controller, including PCI slot 1, but other devices are not allowed to use this address.
When domain configuration requires the 'isa' controller to be present, automatically add it on domain post-parse stage.
Now, as this controller is always available when needed, it's not necessary to implicitly add it to the bhyve command line, so remove bhyveBuildLPCArgStr().
Also, make bhyveDomainDefNeedsISAController() static as it's no longer used outside of bhyve_domain.c.
As more than one ISA controller is not supported by bhyve, and multiple controllers with the same index are forbidden, so forbid ISA controllers with non-zero index for bhyve.
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com> --- src/bhyve/bhyve_command.c | 27 +++++++------- src/bhyve/bhyve_device.c | 23 +++++++++--- src/bhyve/bhyve_domain.c | 25 +++++++++++-- src/bhyve/bhyve_domain.h | 2 -- ...ml2argv-addr-isa-controller-on-slot-1.args | 10 ++++++ ...2argv-addr-isa-controller-on-slot-1.ldargs | 3 ++ ...xml2argv-addr-isa-controller-on-slot-1.xml | 26 ++++++++++++++ ...l2argv-addr-isa-controller-on-slot-31.args | 10 ++++++ ...argv-addr-isa-controller-on-slot-31.ldargs | 3 ++ ...ml2argv-addr-isa-controller-on-slot-31.xml | 26 ++++++++++++++ ...argv-addr-non-isa-controller-on-slot-1.xml | 23 ++++++++++++ .../bhyvexml2argv-console.args | 2 +- .../bhyvexml2argv-isa-controller.args | 10 ++++++ .../bhyvexml2argv-isa-controller.ldargs | 3 ++ .../bhyvexml2argv-isa-controller.xml | 24 +++++++++++++ ...bhyvexml2argv-isa-multiple-controllers.xml | 25 +++++++++++++ .../bhyvexml2argv-serial-grub-nocons.args | 2 +- .../bhyvexml2argv-serial-grub.args | 2 +- .../bhyvexml2argv-serial.args | 2 +- .../bhyvexml2argvdata/bhyvexml2argv-uefi.args | 4 +-- .../bhyvexml2argv-vnc-autoport.args | 4 +-- .../bhyvexml2argv-vnc-vgaconf-io.args | 4 +-- .../bhyvexml2argv-vnc-vgaconf-off.args | 4 +-- .../bhyvexml2argv-vnc-vgaconf-on.args | 4 +-- .../bhyvexml2argvdata/bhyvexml2argv-vnc.args | 4 +-- tests/bhyvexml2argvtest.c | 5 +++ ...l2xmlout-addr-isa-controller-on-slot-1.xml | 36 +++++++++++++++++++ ...2xmlout-addr-isa-controller-on-slot-31.xml | 36 +++++++++++++++++++ .../bhyvexml2xmlout-console.xml | 3 ++ .../bhyvexml2xmlout-isa-controller.xml | 36 +++++++++++++++++++ .../bhyvexml2xmlout-serial-grub-nocons.xml | 3 ++ .../bhyvexml2xmlout-serial-grub.xml | 3 ++ .../bhyvexml2xmlout-serial.xml | 3 ++ .../bhyvexml2xmlout-vnc-autoport.xml | 3 ++ .../bhyvexml2xmlout-vnc-vgaconf-io.xml | 3 ++ .../bhyvexml2xmlout-vnc-vgaconf-off.xml | 3 ++ .../bhyvexml2xmlout-vnc-vgaconf-on.xml | 3 ++ .../bhyvexml2xmlout-vnc.xml | 3 ++ tests/bhyvexml2xmltest.c | 3 ++ 39 files changed, 378 insertions(+), 37 deletions(-) create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.args create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.ldargs create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.args create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.ldargs create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-non-isa-controller-on-slot-1.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.args create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.ldargs create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-multiple-controllers.xml create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-1.xml create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-31.xml create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-isa-controller.xml
diff --git a/src/bhyve/bhyve_device.c b/src/bhyve/bhyve_device.c index fc52280361..52a055f205 100644 --- a/src/bhyve/bhyve_device.c +++ b/src/bhyve/bhyve_device.c @@ -46,10 +46,16 @@ bhyveCollectPCIAddress(virDomainDefPtr def G_GNUC_UNUSED, if (addr->slot == 0) { return 0; } else if (addr->slot == 1) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("PCI bus 0 slot 1 is reserved for the implicit " - "LPC PCI-ISA bridge")); - return -1; + if (!(device->type == VIR_DOMAIN_DEVICE_CONTROLLER && + device->data.controller->type == VIR_DOMAIN_CONTROLLER_TYPE_ISA)) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("PCI bus 0 slot 1 is reserved for the implicit " + "LPC PCI-ISA bridge")); + return -1; + } else { + /* We reserve slot 1 for LPC in bhyveAssignDevicePCISlots(), so exit early */ + return 0; + }
I forgot to respond to your followup comments on v4 https://www.redhat.com/archives/libvir-list/2020-July/msg01761.html
IIUC, this series makes it possible to put the TPC in a different slot, so does it still make sense to forbid use of slot 1 as a hardcoded rule ?
IIRC, the idea behind that is to give some time window for users to allow moving guests from the new version to the old one. If we allow to use slot 1, it won't be possible to move the guest to the old libvirt as it will complain slot 1 should be used only for LPC.
If the user has decided to move their LPC to a slot != 1, then it is already impossible to migrate the guest to an old libvirt.
If the user wants to explicitly specify another device in slot 1, then we should not prevent that.
We just need to make sure that if no LPC is in the XML, and no other device explicitly has slot 1, then make sure to auto-assign LPC in slot 1 not some other device.
I've started playing with that and remembered some more corner cases. To elaborate on your example, i.e. "no explicit LPC in XML AND no other device explicitly on slot 1": these conditions are not specific enough to tell whether an LPC device will be added or not. In case if the LPC device was not explicitly specified by a user, the bhyve driver tries to add it if it's needed (it's required for serial console, bootloader, and video devices; see bhyveDomainDefNeedsISAController()). Otherwise a domain will start without the LPC device. This could lead to a case when a user starts a domain in configuration that does not require LPC device, but has e.g. a network device on a PCI controller that's auto-assigned to slot 1. Later user decides to change the configuration and adds a video device, which requires LPC. This will lead to addresses changes, as LPC will go to slot 1 and a network device's controller will go from slot 1 to slot 2, which could be troublesome in some guest OSes.
Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Roman Bogorodskiy

On Wed, Sep 16, 2020 at 07:14:39PM +0400, Roman Bogorodskiy wrote:
Daniel P. Berrangé wrote:
On Sat, Aug 01, 2020 at 10:16:57AM +0400, Roman Bogorodskiy wrote:
Support modeling of the 'isa' controller for bhyve. User can manually define any PCI slot for the 'isa' controller, including PCI slot 1, but other devices are not allowed to use this address.
When domain configuration requires the 'isa' controller to be present, automatically add it on domain post-parse stage.
Now, as this controller is always available when needed, it's not necessary to implicitly add it to the bhyve command line, so remove bhyveBuildLPCArgStr().
Also, make bhyveDomainDefNeedsISAController() static as it's no longer used outside of bhyve_domain.c.
As more than one ISA controller is not supported by bhyve, and multiple controllers with the same index are forbidden, so forbid ISA controllers with non-zero index for bhyve.
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com> --- src/bhyve/bhyve_command.c | 27 +++++++------- src/bhyve/bhyve_device.c | 23 +++++++++--- src/bhyve/bhyve_domain.c | 25 +++++++++++-- src/bhyve/bhyve_domain.h | 2 -- ...ml2argv-addr-isa-controller-on-slot-1.args | 10 ++++++ ...2argv-addr-isa-controller-on-slot-1.ldargs | 3 ++ ...xml2argv-addr-isa-controller-on-slot-1.xml | 26 ++++++++++++++ ...l2argv-addr-isa-controller-on-slot-31.args | 10 ++++++ ...argv-addr-isa-controller-on-slot-31.ldargs | 3 ++ ...ml2argv-addr-isa-controller-on-slot-31.xml | 26 ++++++++++++++ ...argv-addr-non-isa-controller-on-slot-1.xml | 23 ++++++++++++ .../bhyvexml2argv-console.args | 2 +- .../bhyvexml2argv-isa-controller.args | 10 ++++++ .../bhyvexml2argv-isa-controller.ldargs | 3 ++ .../bhyvexml2argv-isa-controller.xml | 24 +++++++++++++ ...bhyvexml2argv-isa-multiple-controllers.xml | 25 +++++++++++++ .../bhyvexml2argv-serial-grub-nocons.args | 2 +- .../bhyvexml2argv-serial-grub.args | 2 +- .../bhyvexml2argv-serial.args | 2 +- .../bhyvexml2argvdata/bhyvexml2argv-uefi.args | 4 +-- .../bhyvexml2argv-vnc-autoport.args | 4 +-- .../bhyvexml2argv-vnc-vgaconf-io.args | 4 +-- .../bhyvexml2argv-vnc-vgaconf-off.args | 4 +-- .../bhyvexml2argv-vnc-vgaconf-on.args | 4 +-- .../bhyvexml2argvdata/bhyvexml2argv-vnc.args | 4 +-- tests/bhyvexml2argvtest.c | 5 +++ ...l2xmlout-addr-isa-controller-on-slot-1.xml | 36 +++++++++++++++++++ ...2xmlout-addr-isa-controller-on-slot-31.xml | 36 +++++++++++++++++++ .../bhyvexml2xmlout-console.xml | 3 ++ .../bhyvexml2xmlout-isa-controller.xml | 36 +++++++++++++++++++ .../bhyvexml2xmlout-serial-grub-nocons.xml | 3 ++ .../bhyvexml2xmlout-serial-grub.xml | 3 ++ .../bhyvexml2xmlout-serial.xml | 3 ++ .../bhyvexml2xmlout-vnc-autoport.xml | 3 ++ .../bhyvexml2xmlout-vnc-vgaconf-io.xml | 3 ++ .../bhyvexml2xmlout-vnc-vgaconf-off.xml | 3 ++ .../bhyvexml2xmlout-vnc-vgaconf-on.xml | 3 ++ .../bhyvexml2xmlout-vnc.xml | 3 ++ tests/bhyvexml2xmltest.c | 3 ++ 39 files changed, 378 insertions(+), 37 deletions(-) create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.args create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.ldargs create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.args create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.ldargs create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-non-isa-controller-on-slot-1.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.args create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.ldargs create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-multiple-controllers.xml create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-1.xml create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-31.xml create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-isa-controller.xml
diff --git a/src/bhyve/bhyve_device.c b/src/bhyve/bhyve_device.c index fc52280361..52a055f205 100644 --- a/src/bhyve/bhyve_device.c +++ b/src/bhyve/bhyve_device.c @@ -46,10 +46,16 @@ bhyveCollectPCIAddress(virDomainDefPtr def G_GNUC_UNUSED, if (addr->slot == 0) { return 0; } else if (addr->slot == 1) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("PCI bus 0 slot 1 is reserved for the implicit " - "LPC PCI-ISA bridge")); - return -1; + if (!(device->type == VIR_DOMAIN_DEVICE_CONTROLLER && + device->data.controller->type == VIR_DOMAIN_CONTROLLER_TYPE_ISA)) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("PCI bus 0 slot 1 is reserved for the implicit " + "LPC PCI-ISA bridge")); + return -1; + } else { + /* We reserve slot 1 for LPC in bhyveAssignDevicePCISlots(), so exit early */ + return 0; + }
I forgot to respond to your followup comments on v4 https://www.redhat.com/archives/libvir-list/2020-July/msg01761.html
IIUC, this series makes it possible to put the TPC in a different slot, so does it still make sense to forbid use of slot 1 as a hardcoded rule ?
IIRC, the idea behind that is to give some time window for users to allow moving guests from the new version to the old one. If we allow to use slot 1, it won't be possible to move the guest to the old libvirt as it will complain slot 1 should be used only for LPC.
If the user has decided to move their LPC to a slot != 1, then it is already impossible to migrate the guest to an old libvirt.
If the user wants to explicitly specify another device in slot 1, then we should not prevent that.
We just need to make sure that if no LPC is in the XML, and no other device explicitly has slot 1, then make sure to auto-assign LPC in slot 1 not some other device.
I've started playing with that and remembered some more corner cases.
To elaborate on your example, i.e. "no explicit LPC in XML AND no other device explicitly on slot 1": these conditions are not specific enough to tell whether an LPC device will be added or not.
In case if the LPC device was not explicitly specified by a user, the bhyve driver tries to add it if it's needed (it's required for serial console, bootloader, and video devices; see bhyveDomainDefNeedsISAController()). Otherwise a domain will start without the LPC device.
This could lead to a case when a user starts a domain in configuration that does not require LPC device, but has e.g. a network device on a PCI controller that's auto-assigned to slot 1.
Later user decides to change the configuration and adds a video device, which requires LPC. This will lead to addresses changes, as LPC will go to slot 1 and a network device's controller will go from slot 1 to slot 2, which could be troublesome in some guest OSes.
First of all, lets me clear that we're talking about persistent guests here, not transient guests. With a persistent guest, the PCI addresses are assigned at the time the XML arrives in virDomainDefineXML. If nothing requires the LPC at this time, then a NIC could get given slot 1. This is recorded in the persistent XML. If the user later uses 'virsh edit' to modify the XML and add a video device, libvirt will see that the NIC is already on slot 1. It will thus have to give the LPC slot 2 (or whatever is free). The NIC will not move from slot 1, as that slot is considered taken at this time. The same is true if using virDomainAttachDevice to add a video card. Any modifications to the XML must never change addresses that are currently recorded in the XML, only ever place devices in new unused slots. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

Daniel P. Berrangé wrote:
On Wed, Sep 16, 2020 at 07:14:39PM +0400, Roman Bogorodskiy wrote:
Daniel P. Berrangé wrote:
On Sat, Aug 01, 2020 at 10:16:57AM +0400, Roman Bogorodskiy wrote:
Support modeling of the 'isa' controller for bhyve. User can manually define any PCI slot for the 'isa' controller, including PCI slot 1, but other devices are not allowed to use this address.
When domain configuration requires the 'isa' controller to be present, automatically add it on domain post-parse stage.
Now, as this controller is always available when needed, it's not necessary to implicitly add it to the bhyve command line, so remove bhyveBuildLPCArgStr().
Also, make bhyveDomainDefNeedsISAController() static as it's no longer used outside of bhyve_domain.c.
As more than one ISA controller is not supported by bhyve, and multiple controllers with the same index are forbidden, so forbid ISA controllers with non-zero index for bhyve.
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com> --- src/bhyve/bhyve_command.c | 27 +++++++------- src/bhyve/bhyve_device.c | 23 +++++++++--- src/bhyve/bhyve_domain.c | 25 +++++++++++-- src/bhyve/bhyve_domain.h | 2 -- ...ml2argv-addr-isa-controller-on-slot-1.args | 10 ++++++ ...2argv-addr-isa-controller-on-slot-1.ldargs | 3 ++ ...xml2argv-addr-isa-controller-on-slot-1.xml | 26 ++++++++++++++ ...l2argv-addr-isa-controller-on-slot-31.args | 10 ++++++ ...argv-addr-isa-controller-on-slot-31.ldargs | 3 ++ ...ml2argv-addr-isa-controller-on-slot-31.xml | 26 ++++++++++++++ ...argv-addr-non-isa-controller-on-slot-1.xml | 23 ++++++++++++ .../bhyvexml2argv-console.args | 2 +- .../bhyvexml2argv-isa-controller.args | 10 ++++++ .../bhyvexml2argv-isa-controller.ldargs | 3 ++ .../bhyvexml2argv-isa-controller.xml | 24 +++++++++++++ ...bhyvexml2argv-isa-multiple-controllers.xml | 25 +++++++++++++ .../bhyvexml2argv-serial-grub-nocons.args | 2 +- .../bhyvexml2argv-serial-grub.args | 2 +- .../bhyvexml2argv-serial.args | 2 +- .../bhyvexml2argvdata/bhyvexml2argv-uefi.args | 4 +-- .../bhyvexml2argv-vnc-autoport.args | 4 +-- .../bhyvexml2argv-vnc-vgaconf-io.args | 4 +-- .../bhyvexml2argv-vnc-vgaconf-off.args | 4 +-- .../bhyvexml2argv-vnc-vgaconf-on.args | 4 +-- .../bhyvexml2argvdata/bhyvexml2argv-vnc.args | 4 +-- tests/bhyvexml2argvtest.c | 5 +++ ...l2xmlout-addr-isa-controller-on-slot-1.xml | 36 +++++++++++++++++++ ...2xmlout-addr-isa-controller-on-slot-31.xml | 36 +++++++++++++++++++ .../bhyvexml2xmlout-console.xml | 3 ++ .../bhyvexml2xmlout-isa-controller.xml | 36 +++++++++++++++++++ .../bhyvexml2xmlout-serial-grub-nocons.xml | 3 ++ .../bhyvexml2xmlout-serial-grub.xml | 3 ++ .../bhyvexml2xmlout-serial.xml | 3 ++ .../bhyvexml2xmlout-vnc-autoport.xml | 3 ++ .../bhyvexml2xmlout-vnc-vgaconf-io.xml | 3 ++ .../bhyvexml2xmlout-vnc-vgaconf-off.xml | 3 ++ .../bhyvexml2xmlout-vnc-vgaconf-on.xml | 3 ++ .../bhyvexml2xmlout-vnc.xml | 3 ++ tests/bhyvexml2xmltest.c | 3 ++ 39 files changed, 378 insertions(+), 37 deletions(-) create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.args create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.ldargs create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.args create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.ldargs create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-non-isa-controller-on-slot-1.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.args create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.ldargs create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-multiple-controllers.xml create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-1.xml create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-31.xml create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-isa-controller.xml
diff --git a/src/bhyve/bhyve_device.c b/src/bhyve/bhyve_device.c index fc52280361..52a055f205 100644 --- a/src/bhyve/bhyve_device.c +++ b/src/bhyve/bhyve_device.c @@ -46,10 +46,16 @@ bhyveCollectPCIAddress(virDomainDefPtr def G_GNUC_UNUSED, if (addr->slot == 0) { return 0; } else if (addr->slot == 1) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("PCI bus 0 slot 1 is reserved for the implicit " - "LPC PCI-ISA bridge")); - return -1; + if (!(device->type == VIR_DOMAIN_DEVICE_CONTROLLER && + device->data.controller->type == VIR_DOMAIN_CONTROLLER_TYPE_ISA)) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("PCI bus 0 slot 1 is reserved for the implicit " + "LPC PCI-ISA bridge")); + return -1; + } else { + /* We reserve slot 1 for LPC in bhyveAssignDevicePCISlots(), so exit early */ + return 0; + }
I forgot to respond to your followup comments on v4 https://www.redhat.com/archives/libvir-list/2020-July/msg01761.html
IIUC, this series makes it possible to put the TPC in a different slot, so does it still make sense to forbid use of slot 1 as a hardcoded rule ?
IIRC, the idea behind that is to give some time window for users to allow moving guests from the new version to the old one. If we allow to use slot 1, it won't be possible to move the guest to the old libvirt as it will complain slot 1 should be used only for LPC.
If the user has decided to move their LPC to a slot != 1, then it is already impossible to migrate the guest to an old libvirt.
If the user wants to explicitly specify another device in slot 1, then we should not prevent that.
We just need to make sure that if no LPC is in the XML, and no other device explicitly has slot 1, then make sure to auto-assign LPC in slot 1 not some other device.
I've started playing with that and remembered some more corner cases.
To elaborate on your example, i.e. "no explicit LPC in XML AND no other device explicitly on slot 1": these conditions are not specific enough to tell whether an LPC device will be added or not.
In case if the LPC device was not explicitly specified by a user, the bhyve driver tries to add it if it's needed (it's required for serial console, bootloader, and video devices; see bhyveDomainDefNeedsISAController()). Otherwise a domain will start without the LPC device.
This could lead to a case when a user starts a domain in configuration that does not require LPC device, but has e.g. a network device on a PCI controller that's auto-assigned to slot 1.
Later user decides to change the configuration and adds a video device, which requires LPC. This will lead to addresses changes, as LPC will go to slot 1 and a network device's controller will go from slot 1 to slot 2, which could be troublesome in some guest OSes.
First of all, lets me clear that we're talking about persistent guests here, not transient guests.
With a persistent guest, the PCI addresses are assigned at the time the XML arrives in virDomainDefineXML. If nothing requires the LPC at this time, then a NIC could get given slot 1. This is recorded in the persistent XML.
If the user later uses 'virsh edit' to modify the XML and add a video device, libvirt will see that the NIC is already on slot 1. It will thus have to give the LPC slot 2 (or whatever is free). The NIC will not move from slot 1, as that slot is considered taken at this time.
The same is true if using virDomainAttachDevice to add a video card. Any modifications to the XML must never change addresses that are currently recorded in the XML, only ever place devices in new unused slots.
Sorry, I should have stated that I was assuming that LPC always gets slot 1 assigned if it has no address explicitly assigned by the user in the XML. In my understanding, some guests are picky about what slot LPC is assigned to (and it seems that slot 1 and slot 31 are the most common safe options). In this case we're letting user to resolve it in a way they think fits better their specific needs, correct? In other words, in context of address allocation, we treat LPC like any other device, with the only difference that we start address allocation from it, so it gets slot 1 if it has no address specified and the slot 1 is still free?
Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Roman Bogorodskiy

On Thu, Sep 17, 2020 at 05:48:38PM +0400, Roman Bogorodskiy wrote:
Daniel P. Berrangé wrote:
On Wed, Sep 16, 2020 at 07:14:39PM +0400, Roman Bogorodskiy wrote:
Daniel P. Berrangé wrote:
On Sat, Aug 01, 2020 at 10:16:57AM +0400, Roman Bogorodskiy wrote:
diff --git a/src/bhyve/bhyve_device.c b/src/bhyve/bhyve_device.c index fc52280361..52a055f205 100644 --- a/src/bhyve/bhyve_device.c +++ b/src/bhyve/bhyve_device.c @@ -46,10 +46,16 @@ bhyveCollectPCIAddress(virDomainDefPtr def G_GNUC_UNUSED, if (addr->slot == 0) { return 0; } else if (addr->slot == 1) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("PCI bus 0 slot 1 is reserved for the implicit " - "LPC PCI-ISA bridge")); - return -1; + if (!(device->type == VIR_DOMAIN_DEVICE_CONTROLLER && + device->data.controller->type == VIR_DOMAIN_CONTROLLER_TYPE_ISA)) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("PCI bus 0 slot 1 is reserved for the implicit " + "LPC PCI-ISA bridge")); + return -1; + } else { + /* We reserve slot 1 for LPC in bhyveAssignDevicePCISlots(), so exit early */ + return 0; + }
I forgot to respond to your followup comments on v4 https://www.redhat.com/archives/libvir-list/2020-July/msg01761.html
IIUC, this series makes it possible to put the TPC in a different slot, so does it still make sense to forbid use of slot 1 as a hardcoded rule ?
IIRC, the idea behind that is to give some time window for users to allow moving guests from the new version to the old one. If we allow to use slot 1, it won't be possible to move the guest to the old libvirt as it will complain slot 1 should be used only for LPC.
If the user has decided to move their LPC to a slot != 1, then it is already impossible to migrate the guest to an old libvirt.
If the user wants to explicitly specify another device in slot 1, then we should not prevent that.
We just need to make sure that if no LPC is in the XML, and no other device explicitly has slot 1, then make sure to auto-assign LPC in slot 1 not some other device.
I've started playing with that and remembered some more corner cases.
To elaborate on your example, i.e. "no explicit LPC in XML AND no other device explicitly on slot 1": these conditions are not specific enough to tell whether an LPC device will be added or not.
In case if the LPC device was not explicitly specified by a user, the bhyve driver tries to add it if it's needed (it's required for serial console, bootloader, and video devices; see bhyveDomainDefNeedsISAController()). Otherwise a domain will start without the LPC device.
This could lead to a case when a user starts a domain in configuration that does not require LPC device, but has e.g. a network device on a PCI controller that's auto-assigned to slot 1.
Later user decides to change the configuration and adds a video device, which requires LPC. This will lead to addresses changes, as LPC will go to slot 1 and a network device's controller will go from slot 1 to slot 2, which could be troublesome in some guest OSes.
First of all, lets me clear that we're talking about persistent guests here, not transient guests.
With a persistent guest, the PCI addresses are assigned at the time the XML arrives in virDomainDefineXML. If nothing requires the LPC at this time, then a NIC could get given slot 1. This is recorded in the persistent XML.
If the user later uses 'virsh edit' to modify the XML and add a video device, libvirt will see that the NIC is already on slot 1. It will thus have to give the LPC slot 2 (or whatever is free). The NIC will not move from slot 1, as that slot is considered taken at this time.
The same is true if using virDomainAttachDevice to add a video card. Any modifications to the XML must never change addresses that are currently recorded in the XML, only ever place devices in new unused slots.
Sorry, I should have stated that I was assuming that LPC always gets slot 1 assigned if it has no address explicitly assigned by the user in the XML.
In my understanding, some guests are picky about what slot LPC is assigned to (and it seems that slot 1 and slot 31 are the most common safe options). In this case we're letting user to resolve it in a way they think fits better their specific needs, correct?
In other words, in context of address allocation, we treat LPC like any other device, with the only difference that we start address allocation from it, so it gets slot 1 if it has no address specified and the slot 1 is still free?
Ok, so it sounds like if the user has explicitly used slot 1 for some arbitrary device we should allow that, but if libvirt is assigning slots, it should never use slot 1 except for the LPC Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

Daniel P. Berrangé wrote:
On Thu, Sep 17, 2020 at 05:48:38PM +0400, Roman Bogorodskiy wrote:
Daniel P. Berrangé wrote:
On Wed, Sep 16, 2020 at 07:14:39PM +0400, Roman Bogorodskiy wrote:
Daniel P. Berrangé wrote:
On Sat, Aug 01, 2020 at 10:16:57AM +0400, Roman Bogorodskiy wrote:
diff --git a/src/bhyve/bhyve_device.c b/src/bhyve/bhyve_device.c index fc52280361..52a055f205 100644 --- a/src/bhyve/bhyve_device.c +++ b/src/bhyve/bhyve_device.c @@ -46,10 +46,16 @@ bhyveCollectPCIAddress(virDomainDefPtr def G_GNUC_UNUSED, if (addr->slot == 0) { return 0; } else if (addr->slot == 1) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("PCI bus 0 slot 1 is reserved for the implicit " - "LPC PCI-ISA bridge")); - return -1; + if (!(device->type == VIR_DOMAIN_DEVICE_CONTROLLER && + device->data.controller->type == VIR_DOMAIN_CONTROLLER_TYPE_ISA)) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("PCI bus 0 slot 1 is reserved for the implicit " + "LPC PCI-ISA bridge")); + return -1; + } else { + /* We reserve slot 1 for LPC in bhyveAssignDevicePCISlots(), so exit early */ + return 0; + }
I forgot to respond to your followup comments on v4 https://www.redhat.com/archives/libvir-list/2020-July/msg01761.html
> > IIUC, this series makes it possible to put the TPC in a different > slot, so does it still make sense to forbid use of slot 1 as a > hardcoded rule ?
IIRC, the idea behind that is to give some time window for users to allow moving guests from the new version to the old one. If we allow to use slot 1, it won't be possible to move the guest to the old libvirt as it will complain slot 1 should be used only for LPC.
If the user has decided to move their LPC to a slot != 1, then it is already impossible to migrate the guest to an old libvirt.
If the user wants to explicitly specify another device in slot 1, then we should not prevent that.
We just need to make sure that if no LPC is in the XML, and no other device explicitly has slot 1, then make sure to auto-assign LPC in slot 1 not some other device.
I've started playing with that and remembered some more corner cases.
To elaborate on your example, i.e. "no explicit LPC in XML AND no other device explicitly on slot 1": these conditions are not specific enough to tell whether an LPC device will be added or not.
In case if the LPC device was not explicitly specified by a user, the bhyve driver tries to add it if it's needed (it's required for serial console, bootloader, and video devices; see bhyveDomainDefNeedsISAController()). Otherwise a domain will start without the LPC device.
This could lead to a case when a user starts a domain in configuration that does not require LPC device, but has e.g. a network device on a PCI controller that's auto-assigned to slot 1.
Later user decides to change the configuration and adds a video device, which requires LPC. This will lead to addresses changes, as LPC will go to slot 1 and a network device's controller will go from slot 1 to slot 2, which could be troublesome in some guest OSes.
First of all, lets me clear that we're talking about persistent guests here, not transient guests.
With a persistent guest, the PCI addresses are assigned at the time the XML arrives in virDomainDefineXML. If nothing requires the LPC at this time, then a NIC could get given slot 1. This is recorded in the persistent XML.
If the user later uses 'virsh edit' to modify the XML and add a video device, libvirt will see that the NIC is already on slot 1. It will thus have to give the LPC slot 2 (or whatever is free). The NIC will not move from slot 1, as that slot is considered taken at this time.
The same is true if using virDomainAttachDevice to add a video card. Any modifications to the XML must never change addresses that are currently recorded in the XML, only ever place devices in new unused slots.
Sorry, I should have stated that I was assuming that LPC always gets slot 1 assigned if it has no address explicitly assigned by the user in the XML.
In my understanding, some guests are picky about what slot LPC is assigned to (and it seems that slot 1 and slot 31 are the most common safe options). In this case we're letting user to resolve it in a way they think fits better their specific needs, correct?
In other words, in context of address allocation, we treat LPC like any other device, with the only difference that we start address allocation from it, so it gets slot 1 if it has no address specified and the slot 1 is still free?
Ok, so it sounds like if the user has explicitly used slot 1 for some arbitrary device we should allow that, but if libvirt is assigning slots, it should never use slot 1 except for the LPC
Going back to my example (slightly adjusted), when the user creates a configuration that does not require LPC, and explicitly assigns some other device to slot 1, and then updates the configuration in a way that LPC becomes required, the LPC device will be assigned to the next free slot available. If that doesn't work for this specific configuration, it's fair to expect user to fix that assuming the user knows what they're doing by interfering into address allocations. The fix will be a trivial swap of devices between slot 1 and the slot allocated for LPC, without affecting other device addresses. This looks like a logical and expected behavior to me, I'll update the series accordingly. Thanks Roman Bogorodskiy

On Thu, Sep 17, 2020 at 06:55:36PM +0400, Roman Bogorodskiy wrote:
Daniel P. Berrangé wrote:
On Thu, Sep 17, 2020 at 05:48:38PM +0400, Roman Bogorodskiy wrote:
Daniel P. Berrangé wrote:
On Wed, Sep 16, 2020 at 07:14:39PM +0400, Roman Bogorodskiy wrote:
Daniel P. Berrangé wrote:
On Sat, Aug 01, 2020 at 10:16:57AM +0400, Roman Bogorodskiy wrote: > diff --git a/src/bhyve/bhyve_device.c b/src/bhyve/bhyve_device.c > index fc52280361..52a055f205 100644 > --- a/src/bhyve/bhyve_device.c > +++ b/src/bhyve/bhyve_device.c > @@ -46,10 +46,16 @@ bhyveCollectPCIAddress(virDomainDefPtr def G_GNUC_UNUSED, > if (addr->slot == 0) { > return 0; > } else if (addr->slot == 1) { > - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", > - _("PCI bus 0 slot 1 is reserved for the implicit " > - "LPC PCI-ISA bridge")); > - return -1; > + if (!(device->type == VIR_DOMAIN_DEVICE_CONTROLLER && > + device->data.controller->type == VIR_DOMAIN_CONTROLLER_TYPE_ISA)) { > + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", > + _("PCI bus 0 slot 1 is reserved for the implicit " > + "LPC PCI-ISA bridge")); > + return -1; > + } else { > + /* We reserve slot 1 for LPC in bhyveAssignDevicePCISlots(), so exit early */ > + return 0; > + }
I forgot to respond to your followup comments on v4 https://www.redhat.com/archives/libvir-list/2020-July/msg01761.html
> > > > IIUC, this series makes it possible to put the TPC in a different > > slot, so does it still make sense to forbid use of slot 1 as a > > hardcoded rule ? > > IIRC, the idea behind that is to give some time window for users to > allow moving guests from the new version to the old one. If we allow to > use slot 1, it won't be possible to move the guest to the old libvirt as > it will complain slot 1 should be used only for LPC.
If the user has decided to move their LPC to a slot != 1, then it is already impossible to migrate the guest to an old libvirt.
If the user wants to explicitly specify another device in slot 1, then we should not prevent that.
We just need to make sure that if no LPC is in the XML, and no other device explicitly has slot 1, then make sure to auto-assign LPC in slot 1 not some other device.
I've started playing with that and remembered some more corner cases.
To elaborate on your example, i.e. "no explicit LPC in XML AND no other device explicitly on slot 1": these conditions are not specific enough to tell whether an LPC device will be added or not.
In case if the LPC device was not explicitly specified by a user, the bhyve driver tries to add it if it's needed (it's required for serial console, bootloader, and video devices; see bhyveDomainDefNeedsISAController()). Otherwise a domain will start without the LPC device.
This could lead to a case when a user starts a domain in configuration that does not require LPC device, but has e.g. a network device on a PCI controller that's auto-assigned to slot 1.
Later user decides to change the configuration and adds a video device, which requires LPC. This will lead to addresses changes, as LPC will go to slot 1 and a network device's controller will go from slot 1 to slot 2, which could be troublesome in some guest OSes.
First of all, lets me clear that we're talking about persistent guests here, not transient guests.
With a persistent guest, the PCI addresses are assigned at the time the XML arrives in virDomainDefineXML. If nothing requires the LPC at this time, then a NIC could get given slot 1. This is recorded in the persistent XML.
If the user later uses 'virsh edit' to modify the XML and add a video device, libvirt will see that the NIC is already on slot 1. It will thus have to give the LPC slot 2 (or whatever is free). The NIC will not move from slot 1, as that slot is considered taken at this time.
The same is true if using virDomainAttachDevice to add a video card. Any modifications to the XML must never change addresses that are currently recorded in the XML, only ever place devices in new unused slots.
Sorry, I should have stated that I was assuming that LPC always gets slot 1 assigned if it has no address explicitly assigned by the user in the XML.
In my understanding, some guests are picky about what slot LPC is assigned to (and it seems that slot 1 and slot 31 are the most common safe options). In this case we're letting user to resolve it in a way they think fits better their specific needs, correct?
In other words, in context of address allocation, we treat LPC like any other device, with the only difference that we start address allocation from it, so it gets slot 1 if it has no address specified and the slot 1 is still free?
Ok, so it sounds like if the user has explicitly used slot 1 for some arbitrary device we should allow that, but if libvirt is assigning slots, it should never use slot 1 except for the LPC
Going back to my example (slightly adjusted), when the user creates a configuration that does not require LPC, and explicitly assigns some other device to slot 1, and then updates the configuration in a way that LPC becomes required, the LPC device will be assigned to the next free slot available.
If that doesn't work for this specific configuration, it's fair to expect user to fix that assuming the user knows what they're doing by interfering into address allocations. The fix will be a trivial swap of devices between slot 1 and the slot allocated for LPC, without affecting other device addresses.
Yes, if libvirt is auto-assigning all addresses, then we need to "just work", but if the user manually assigns some or all addresses, it is their responsibility if things break.
This looks like a logical and expected behavior to me, I'll update the series accordingly.
ok Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On a Saturday in 2020, Roman Bogorodskiy wrote:
Support modeling of the 'isa' controller for bhyve. User can manually define any PCI slot for the 'isa' controller, including PCI slot 1, but other devices are not allowed to use this address.
When domain configuration requires the 'isa' controller to be present, automatically add it on domain post-parse stage.
Now, as this controller is always available when needed, it's not necessary to implicitly add it to the bhyve command line, so remove bhyveBuildLPCArgStr().
Also, make bhyveDomainDefNeedsISAController() static as it's no longer used outside of bhyve_domain.c.
As more than one ISA controller is not supported by bhyve, and multiple controllers with the same index are forbidden, so forbid ISA controllers with non-zero index for bhyve.
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com> --- src/bhyve/bhyve_command.c | 27 +++++++------- src/bhyve/bhyve_device.c | 23 +++++++++--- src/bhyve/bhyve_domain.c | 25 +++++++++++-- src/bhyve/bhyve_domain.h | 2 -- ...ml2argv-addr-isa-controller-on-slot-1.args | 10 ++++++ ...2argv-addr-isa-controller-on-slot-1.ldargs | 3 ++ ...xml2argv-addr-isa-controller-on-slot-1.xml | 26 ++++++++++++++ ...l2argv-addr-isa-controller-on-slot-31.args | 10 ++++++ ...argv-addr-isa-controller-on-slot-31.ldargs | 3 ++ ...ml2argv-addr-isa-controller-on-slot-31.xml | 26 ++++++++++++++ ...argv-addr-non-isa-controller-on-slot-1.xml | 23 ++++++++++++ .../bhyvexml2argv-console.args | 2 +- .../bhyvexml2argv-isa-controller.args | 10 ++++++ .../bhyvexml2argv-isa-controller.ldargs | 3 ++ .../bhyvexml2argv-isa-controller.xml | 24 +++++++++++++ ...bhyvexml2argv-isa-multiple-controllers.xml | 25 +++++++++++++ .../bhyvexml2argv-serial-grub-nocons.args | 2 +- .../bhyvexml2argv-serial-grub.args | 2 +- .../bhyvexml2argv-serial.args | 2 +- .../bhyvexml2argvdata/bhyvexml2argv-uefi.args | 4 +-- .../bhyvexml2argv-vnc-autoport.args | 4 +-- .../bhyvexml2argv-vnc-vgaconf-io.args | 4 +-- .../bhyvexml2argv-vnc-vgaconf-off.args | 4 +-- .../bhyvexml2argv-vnc-vgaconf-on.args | 4 +-- .../bhyvexml2argvdata/bhyvexml2argv-vnc.args | 4 +-- tests/bhyvexml2argvtest.c | 5 +++ ...l2xmlout-addr-isa-controller-on-slot-1.xml | 36 +++++++++++++++++++ ...2xmlout-addr-isa-controller-on-slot-31.xml | 36 +++++++++++++++++++ .../bhyvexml2xmlout-console.xml | 3 ++ .../bhyvexml2xmlout-isa-controller.xml | 36 +++++++++++++++++++ .../bhyvexml2xmlout-serial-grub-nocons.xml | 3 ++ .../bhyvexml2xmlout-serial-grub.xml | 3 ++ .../bhyvexml2xmlout-serial.xml | 3 ++ .../bhyvexml2xmlout-vnc-autoport.xml | 3 ++ .../bhyvexml2xmlout-vnc-vgaconf-io.xml | 3 ++ .../bhyvexml2xmlout-vnc-vgaconf-off.xml | 3 ++ .../bhyvexml2xmlout-vnc-vgaconf-on.xml | 3 ++ .../bhyvexml2xmlout-vnc.xml | 3 ++ tests/bhyvexml2xmltest.c | 3 ++ 39 files changed, 378 insertions(+), 37 deletions(-) create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.args create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.ldargs create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.args create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.ldargs create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-non-isa-controller-on-slot-1.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.args create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.ldargs create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-multiple-controllers.xml create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-1.xml create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-31.xml create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-isa-controller.xml
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

Roman Bogorodskiy wrote:
Changes from v4:
- Document 'isa' controller type in docs/formatdomain.html.in. While here, add 'xenbus' which was also missing.
Roman Bogorodskiy (2): conf: add 'isa' controller type bhyve: support 'isa' controller for LPC
docs/formatdomain.html.in | 6 ++-- docs/schemas/domaincommon.rng | 6 ++++ src/bhyve/bhyve_command.c | 27 +++++++------- src/bhyve/bhyve_device.c | 23 +++++++++--- src/bhyve/bhyve_domain.c | 25 +++++++++++-- src/bhyve/bhyve_domain.h | 2 -- 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 + ...ml2argv-addr-isa-controller-on-slot-1.args | 10 ++++++ ...2argv-addr-isa-controller-on-slot-1.ldargs | 3 ++ ...xml2argv-addr-isa-controller-on-slot-1.xml | 26 ++++++++++++++ ...l2argv-addr-isa-controller-on-slot-31.args | 10 ++++++ ...argv-addr-isa-controller-on-slot-31.ldargs | 3 ++ ...ml2argv-addr-isa-controller-on-slot-31.xml | 26 ++++++++++++++ ...argv-addr-non-isa-controller-on-slot-1.xml | 23 ++++++++++++ .../bhyvexml2argv-console.args | 2 +- .../bhyvexml2argv-isa-controller.args | 10 ++++++ .../bhyvexml2argv-isa-controller.ldargs | 3 ++ .../bhyvexml2argv-isa-controller.xml | 24 +++++++++++++ ...bhyvexml2argv-isa-multiple-controllers.xml | 25 +++++++++++++ .../bhyvexml2argv-serial-grub-nocons.args | 2 +- .../bhyvexml2argv-serial-grub.args | 2 +- .../bhyvexml2argv-serial.args | 2 +- .../bhyvexml2argvdata/bhyvexml2argv-uefi.args | 4 +-- .../bhyvexml2argv-vnc-autoport.args | 4 +-- .../bhyvexml2argv-vnc-vgaconf-io.args | 4 +-- .../bhyvexml2argv-vnc-vgaconf-off.args | 4 +-- .../bhyvexml2argv-vnc-vgaconf-on.args | 4 +-- .../bhyvexml2argvdata/bhyvexml2argv-vnc.args | 4 +-- tests/bhyvexml2argvtest.c | 5 +++ ...l2xmlout-addr-isa-controller-on-slot-1.xml | 36 +++++++++++++++++++ ...2xmlout-addr-isa-controller-on-slot-31.xml | 36 +++++++++++++++++++ .../bhyvexml2xmlout-console.xml | 3 ++ .../bhyvexml2xmlout-isa-controller.xml | 36 +++++++++++++++++++ .../bhyvexml2xmlout-serial-grub-nocons.xml | 3 ++ .../bhyvexml2xmlout-serial-grub.xml | 3 ++ .../bhyvexml2xmlout-serial.xml | 3 ++ .../bhyvexml2xmlout-vnc-autoport.xml | 3 ++ .../bhyvexml2xmlout-vnc-vgaconf-io.xml | 3 ++ .../bhyvexml2xmlout-vnc-vgaconf-off.xml | 3 ++ .../bhyvexml2xmlout-vnc-vgaconf-on.xml | 3 ++ .../bhyvexml2xmlout-vnc.xml | 3 ++ tests/bhyvexml2xmltest.c | 3 ++ 48 files changed, 409 insertions(+), 40 deletions(-) create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.args create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.ldargs create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.args create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.ldargs create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-non-isa-controller-on-slot-1.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.args create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.ldargs create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-multiple-controllers.xml create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-1.xml create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-31.xml create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-isa-controller.xml
ping? Roman Bogorodskiy
participants (3)
-
Daniel P. Berrangé
-
Ján Tomko
-
Roman Bogorodskiy