virtio-net: announce self by guest
commitf57fcf706342f8545d77a538c4319b752511f672
authorJason Wang <jasowang@redhat.com>
Tue, 20 May 2014 06:01:44 +0000 (20 14:01 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 19 Jun 2014 13:41:54 +0000 (19 16:41 +0300)
tree0ab95c86be87b3f579801139595c8147a9ce6868
parent508e1180d3e8371a902ba721d2c9e1ee04c33a15
virtio-net: announce self by guest

It's hard to track all mac addresses and their configurations (e.g
vlan or ipv6) in qemu. Without this information, it's impossible to
build proper garp packet after migration. The only possible solution
to this is let guest (who knows all configurations) to do this.

So, this patch introduces a new readonly config status bit of virtio-net,
VIRTIO_NET_S_ANNOUNCE which is used to notify guest to announce
presence of its link through config update interrupt.When guest has
done the announcement, it should ack the notification through
VIRTIO_NET_CTRL_ANNOUNCE_ACK cmd. This feature is negotiated by a new
feature bit VIRTIO_NET_F_ANNOUNCE (which has already been supported by
Linux guest).

During load, a counter of announcing rounds is set so that after the vm is
running it can trigger rounds of config interrupts to notify the guest to build
and send the correct garps.

Cc: Liuyongan <liuyongan@huawei.com>
Cc: Amos Kong <akong@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/net/virtio-net.c
include/hw/i386/pc.h
include/hw/virtio/virtio-net.h