qemu: add capabilities flag for failover feature

Presence of the virtio-net-pci option called "failover" indicates
support in a qemu binary of a simplistic bonding of a virtio-net
device with another PCI device. This feature allows migration of
guests that have a network device assigned to a guest with VFIO, by
creating a network bond device in the guest consisting of the
VFIO-assigned device and a virtio-net-pci device, then temporarily
(and automatically) unplugging the VFIO net device prior to migration
(and hotplugging an equivalent device on the migration
destination). (The feature is called "failover" because the bond
device uses the vfio-pci netdev for normal guest networking, but
"fails over" to the virtio-net-pci netdev once the vfio-pci device is
unplugged for migration.)

Full functioning of the feature also requires support in the
virtio-net driver in the guest OS (since that is where the bond device
resides), but if the "failover" commandline option is present for the
virtio-net-pci device in qemu, at least the qemu part of the feature
is available, and libvirt can add the proper options to both the
virtio-net-pci and vfio-pci device commandlines to indicate qemu
should attempt doing the failover during migration.

This patch just adds the qemu capabilities flag "virtio-net.failover".

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Laine Stump 2019-12-08 14:22:34 -05:00
parent 3d63a187ba
commit cad65f222f
5 changed files with 6 additions and 0 deletions

View File

@ -558,6 +558,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
/* 350 */
"i8042",
"rng-builtin",
"virtio-net.failover",
);
@ -1305,6 +1306,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioNet[] = {
{ "disable-legacy", QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY },
{ "iommu_platform", QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM },
{ "ats", QEMU_CAPS_VIRTIO_PCI_ATS },
{ "failover", QEMU_CAPS_VIRTIO_NET_FAILOVER },
};
static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsSpaprPCIHostBridge[] = {

View File

@ -539,6 +539,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
/* 350 */
QEMU_CAPS_DEVICE_I8042, /* PS/2 controller */
QEMU_CAPS_OBJECT_RNG_BUILTIN, /* -object rng-builtin */
QEMU_CAPS_VIRTIO_NET_FAILOVER, /* virtio-net-*.failover */
QEMU_CAPS_LAST /* this must always be the last item */
} virQEMUCapsFlags;

View File

@ -177,6 +177,7 @@
<flag name='drive-nvme'/>
<flag name='smp-dies'/>
<flag name='rng-builtin'/>
<flag name='virtio-net.failover'/>
<version>4001050</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>61700242</microcodeVersion>

View File

@ -221,6 +221,7 @@
<flag name='smp-dies'/>
<flag name='i8042'/>
<flag name='rng-builtin'/>
<flag name='virtio-net.failover'/>
<version>4002000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>43100242</microcodeVersion>

View File

@ -222,6 +222,7 @@
<flag name='smp-dies'/>
<flag name='i8042'/>
<flag name='rng-builtin'/>
<flag name='virtio-net.failover'/>
<version>4002050</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>43100241</microcodeVersion>