Re: [PATCH v2 15/25] qemu: Support hostdev model=virtio-{non-}transitional

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2019-01-23 at 16:32 -0500, Cole Robinson wrote:
[...]
> @@ -479,12 +479,20 @@ qemuBuildVirtioDevStr(virBufferPtr buf,
>              ntmodel_cap = QEMU_CAPS_DEVICE_VIRTIO_NET_PCI_NON_TRANSITIONAL;
>              break;
>  
> +        case VIR_DOMAIN_DEVICE_HOSTDEV:
> +            if (device.data.hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST)
> +                return 0;
> +            has_tmodel = device.data.hostdev->source.subsys.u.scsi_host.model == VIR_DOMAIN_HOSTDEV_SUBSYS_SCSI_VHOST_MODEL_TYPE_VIRTIO_TRANSITIONAL;
> +            has_ntmodel = device.data.hostdev->source.subsys.u.scsi_host.model == VIR_DOMAIN_HOSTDEV_SUBSYS_SCSI_VHOST_MODEL_TYPE_VIRTIO_NON_TRANSITIONAL;
> +            tmodel_cap = QEMU_CAPS_DEVICE_VHOST_SCSI_PCI_TRANSITIONAL;
> +            ntmodel_cap = QEMU_CAPS_DEVICE_VHOST_SCSI_PCI_NON_TRANSITIONAL;
> +            break;

Same comment as for disks, and this time it would make even more
sense considering just how incredibly long some of the lines get
when you have to traverse the entire structure all in one go...

[...]
> @@ -785,11 +785,14 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev,
>              return pcieFlags;
>  
>          /* according to pbonzini, from the guest PoV vhost-scsi devices
> -         * are the same as virtio-scsi, so they should use virtioFlags
> -         * (same as virtio-scsi) to determine Express vs. legacy placement
> +         * are the same as virtio-scsi, so they should follow virtio logic
>           */
> -        if (hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST)
> +        if (hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST) {
> +            /* Transitional devices only work in conventional PCI slots */
> +            if (hostdev->source.subsys.u.scsi_host.model == VIR_DOMAIN_HOSTDEV_SUBSYS_SCSI_VHOST_MODEL_TYPE_VIRTIO_TRANSITIONAL)
> +                return pciFlags;
>              return virtioFlags;
> +        }

Using a switch statement here would be nice too.

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux