[PATCH v4 2/2] bhyve: support 'isa' controller for LPC
Daniel P. Berrangé
berrange at redhat.com
Mon Jul 27 13:39:12 UTC 2020
On Wed, Jul 15, 2020 at 07:25:45PM +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 at gmail.com>
> 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;
> + }
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 ?
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 :|
More information about the libvir-list
mailing list