
On Mon, Nov 19, 2018 at 10:44:54PM -0200, Eduardo Habkost wrote:
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@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?
I guess that as long as it is compat in all existing machine types, it doesn't matter what new machine types do. Libvirt would only use the back compat stuff with QEMU < 4.0, in which case you can guarantee a machine type < pc-4.0. If libvirt saw a QEMU >= 4.0, it would never use the back compat approach, so it wouldn't matter if >= pc-4.0 were not compatible. ie for live migration it would be a case of QEMU-3.1 + pc-3.1 -----> QEMU_4.0 + pc-3.1 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 :|