qemu-patch-raspberry4/include
Jens Freimann 9711cd0dfc net/virtio: add failover support
This patch adds support to handle failover device pairs of a virtio-net
device and a (vfio-)pci device, where the virtio-net acts as the standby
device and the (vfio-)pci device as the primary.

The general idea is that we have a pair of devices, a (vfio-)pci and a
emulated (virtio-net) device. Before migration the vfio device is
unplugged and data flows to the emulated device, on the target side
another (vfio-)pci device is plugged in to take over the data-path. In the
guest the net_failover module will pair net devices with the same MAC
address.

To achieve this we need:

1. Provide a callback function for the should_be_hidden DeviceListener.
   It is called when the primary device is plugged in. Evaluate the QOpt
   passed in to check if it is the matching primary device. It returns
   if the device should be hidden or not.
   When it should be hidden it stores the device options in the VirtioNet
   struct and the device is added once the VIRTIO_NET_F_STANDBY feature is
   negotiated during virtio feature negotiation.

   If the virtio-net devices are not realized at the time the (vfio-)pci
   devices are realized, we need to connect the devices later. This way
   we make sure primary and standby devices can be specified in any
   order.

2. Register a callback for migration status notifier. When called it
   will unplug its primary device before the migration happens.

3. Register a callback for the migration code that checks if a device
   needs to be unplugged from the guest.

Signed-off-by: Jens Freimann <jfreimann@redhat.com>
Message-Id: <20191029114905.6856-11-jfreimann@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-10-29 18:55:26 -04:00
..
authz Include generated QAPI headers less 2019-08-16 13:31:51 +02:00
block block: Add @exact parameter to bdrv_co_truncate() 2019-10-28 12:00:07 +01:00
chardev Include qemu/main-loop.h less 2019-08-16 13:31:52 +02:00
crypto crypto: define cleanup functions for use with g_autoptr 2019-08-22 10:47:12 +01:00
disas include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
exec Improvements for TARGET_PAGE_BITS_VARY 2019-10-29 08:38:04 +00:00
fpu fpu: make softfloat-macros "self-contained" 2019-08-19 12:07:13 +01:00
hw net/virtio: add failover support 2019-10-29 18:55:26 -04:00
io socket: Add num connections to qio_net_listener_open_sync() 2019-09-03 23:24:42 +02:00
libdecnumber include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
migration migration: add new migration state wait-unplug 2019-10-29 18:55:26 -04:00
monitor Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
net Include qemu/queue.h slightly less 2019-08-16 13:31:52 +02:00
qapi qapi: Make visit_next_list()'s comment less confusing 2019-09-24 11:03:44 +02:00
qemu Block patches for softfreeze: 2019-10-28 14:40:01 +00:00
qom vl: Split off user_creatable_print_help() 2019-10-14 17:12:48 +02:00
scsi scsi: explicitly list guest-recoverable sense codes 2019-07-15 11:20:42 +02:00
standard-headers linux headers: update against v5.4-rc1 2019-10-15 18:09:02 +01:00
sysemu block: Add @exact parameter to bdrv_co_truncate() 2019-10-28 12:00:07 +01:00
ui ui/egl: fix framebuffer reads 2019-09-17 13:42:02 +02:00
elf.h linux-user: elf: ELF_HWCAP for s390x 2019-06-07 14:53:26 +02:00
glib-compat.h glib: bump min required glib library version to 2.48 2019-08-22 10:46:34 +01:00
qemu-common.h exec: Split out variable page size support to exec-vary.c 2019-10-28 10:26:02 +01:00
qemu-io.h Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
trace-tcg.h trace: get rid of generated-events.h/generated-events.c 2016-10-12 09:54:52 +02:00