qemu-e2k/hw/net
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
..
can
fsl_etsec hw/net/fsl_etsec/etsec.c: Switch to transaction-based ptimer API 2019-10-24 17:16:28 +01:00
rocker
allwinner_emac.c
cadence_gem.c
dp8393x.c dp8393x: manage big endian bus 2019-10-28 19:05:05 +01:00
e1000_regs.h
e1000.c
e1000e_core.c
e1000e_core.h
e1000e.c
e1000x_common.c
e1000x_common.h
eepro100.c
etraxfs_eth.c
ftgmac100.c
imx_fec.c
Kconfig net: add tulip (dec21143) driver 2019-10-29 10:28:07 +08:00
lan9118.c
lance.c
Makefile.objs net: add tulip (dec21143) driver 2019-10-29 10:28:07 +08:00
mcf_fec.c
milkymist-minimac2.c
mipsnet.c
ne2000-isa.c
ne2000-pci.c
ne2000.c
ne2000.h
net_rx_pkt.c
net_rx_pkt.h
net_tx_pkt.c
net_tx_pkt.h
opencores_eth.c
pcnet-pci.c
pcnet.c
pcnet.h
rtl8139.c
smc91c111.c
spapr_llan.c
stellaris_enet.c
sungem.c
sunhme.c
trace-events net: add tulip (dec21143) driver 2019-10-29 10:28:07 +08:00
tulip.c net: add tulip (dec21143) driver 2019-10-29 10:28:07 +08:00
tulip.h net: add tulip (dec21143) driver 2019-10-29 10:28:07 +08:00
vhost_net-stub.c
vhost_net.c vhost_net: enable packed ring support 2019-10-25 07:46:22 -04:00
virtio-net.c net/virtio: add failover support 2019-10-29 18:55:26 -04:00
vmware_utils.h
vmxnet3_defs.h
vmxnet3.c
vmxnet3.h
vmxnet_debug.h
xen_nic.c
xgmac.c
xilinx_axienet.c
xilinx_ethlite.c