[libvirt] [PATCH for-4.0 v2] virtio: Provide version-specific variants of virtio PCI devices

Eduardo Habkost ehabkost at redhat.com
Tue Nov 20 00:44:54 UTC 2018


On Thu, Nov 15, 2018 at 11:50:56AM +0100, Cornelia Huck wrote:
> On Thu, 15 Nov 2018 10:05:59 +0000
> Daniel P. Berrangé <berrange at redhat.com> wrote:
> 
> > On Wed, Nov 14, 2018 at 09:38:31PM -0200, Eduardo Habkost wrote:
> > > Many of the current virtio-*-pci device types actually represent
> > > 3 different types of devices:
> > > * virtio 1.0 non-transitional devices
> > > * virtio 1.0 transitional devices
> > > * virtio 0.9 ("legacy device" in virtio 1.0 terminology)
> > > 
> > > That would be just an annoyance if it didn't break our device/bus
> > > compatibility QMP interfaces.  With this multi-purpose device
> > > type, there's no way to tell management software that
> > > transitional devices and legacy devices require a Conventional
> > > PCI bus.
> > > 
> > > The multi-purpose device types would also prevent us from telling
> > > management software what's the PCI vendor/device ID for them,
> > > because their PCI IDs change at runtime depending on the bus
> > > where they were plugged.
> > > 
> > > This patch adds separate device types for each of those virtio
> > > device flavors:
> > > 
> > > - virtio-*-pci: the existing multi-purpose device types
> > >   - Configurable using `disable-legacy` and `disable-modern`
> > >     properties
> > >   - Legacy driver support is automatically enabled/disabled
> > >     depending on the bus where it is plugged
> > >   - Supports Conventional PCI and PCI Express buses
> > >     (but Conventional PCI is incompatible with
> > >     disable-legacy=off)
> > >   - Changes PCI vendor/device IDs at runtime
> > > - virtio-*-pci-transitional: virtio-1.0 device supporting legacy drivers
> 
> It's a virtio-1 (not 1.0) device. Otherwise, I like this terminology
> better.
> 
> > >   - Supports Conventional PCI buses only, because
> > >     it has a PIO BAR  
> > 
> > Am I right in thinking that this is basically identical
> > to virtio-*-pci, aside from only being valid for PCI
> > buses ?
> > 
> > IOW, libvirt can expose this device even if QEMU does
> > not support it, by simply using the existing device
> > type and only ever placing it in a PCI bus ?
> > 
> > If libvirt did this compatibility approach, can you
> > confirm this would be live migration state compatible.
> > 
> > ie can live migrate virtio-*-pci -> virtio-*-pci-transitional,
> > provided only PCI bus was used.
> 
> It also needs to make sure that neither disable-legacy nor
> disable-modern is set. Then this would have a compatible state AFAICS.
> 
> > 
> > > - virtio-*-pci-non-transitional: modern-only
> > >   - Supports both Conventional PCI and PCI Express buses  
> > 
> > IIUC, libvirt can again provide compatibility with old
> > QEMU by simply using the existing device type and setting
> > disable-legacy ?  Can you confirm this would be live
> > migration compatible
> > 
> >   virtio-*-pci + disable-legacy -> virtio-*pci-non-transitional
> 
> I think yes.

This is exactly how it is implemented internally, but I'm not
promising that this will be kept compatible forever.  And I
wouldn't like to make that promise unless there's an important
use case for that.

We could easily ensure it will be compatible in pc-4.0 and older,
though.  Would that be enough for the use case we have in mind?

-- 
Eduardo




More information about the libvir-list mailing list