]> www.infradead.org Git - users/dwmw2/qemu.git/commit
net: Forbid dealing with packets when VM is not running
authorzhanghailiang <zhang.zhanghailiang@huawei.com>
Tue, 26 Aug 2014 08:06:17 +0000 (16:06 +0800)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 10 Sep 2014 14:30:58 +0000 (09:30 -0500)
commitec48bfd57b95c7902a1a24050a698df1ed37e8f0
tree72a88531afcaf3f2fdafee8b13d55695433053b9
parenteb36f79d59c65fd934c7f12e6adff239f69f0e09
net: Forbid dealing with packets when VM is not running

For all NICs(except virtio-net) emulated by qemu,
Such as e1000, rtl8139, pcnet and ne2k_pci,
Qemu can still receive packets when VM is not running.

If this happened in *migration's* last PAUSE VM stage, but
before the end of the migration, the new receiving packets will possibly dirty
parts of RAM which has been cached in *iovec*(will be sent asynchronously) and
dirty parts of new RAM which will be missed.
This will lead serious network fault in VM.

To avoid this, we forbid receiving packets in generic net code when
VM is not running.

Bug reproduction steps:
(1) Start a VM which configured at least one NIC
(2) In VM, open several Terminal and do *Ping IP -i 0.1*
(3) Migrate the VM repeatedly between two Hosts
And the *PING* command in VM will very likely fail with message:
'Destination HOST Unreachable', the NIC in VM will stay unavailable unless you
run 'service network restart'

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit e1d64c084b2cc7e907b4e64026d8c8dba59116f8)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
net/net.c