]> git.ipfire.org Git - thirdparty/qemu.git/commit
net: delay freeing peer host device
authorMichael S. Tsirkin <mst@redhat.com>
Mon, 20 Sep 2010 16:08:41 +0000 (18:08 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Tue, 12 Oct 2010 21:09:19 +0000 (16:09 -0500)
commit456496e22556203f5f9c3ff02faa7d75ef3face9
tree24ce7a02b11f89b5c3a3ba9606cad374cf31c600
parenta62e5f41204e71f375a5ba0f93f06b699003f694
net: delay freeing peer host device

With -netdev, virtio devices present offload
features to guest, depending on the backend used.
Thus, removing host netdev peer while guest is
active leads to guest-visible inconsistency and/or crashes.

As a solution, while guest (NIC) peer device exists,
we prevent the host peer from being deleted.
This patch does this by adding peer_deleted flag in nic state:
if host device is going away while guest device
is around, set this flag and keep a shell of
the host device around for as long as guest device exists.

The link is put down so all packets will get discarded.

At the moment, management can detect that device deletion
is delayed by doing info net. As a next step, we shall add
commands that control hotplug/unplug without
removing the device, and an event to report that
guest has responded to the hotplug event.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Alex Williamson <alex.williamson@redhat.com>
(cherry picked from commit a083a89d7277f3268a251ce635d9aae5559242bd)
net.c
net.h