qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] forbid dealing with net packets when VM is not running
@ 2014-08-14  6:13 zhanghailiang
  2014-08-14  6:13 ` [Qemu-devel] [PATCH 1/3] net: Forbid dealing with " zhanghailiang
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: zhanghailiang @ 2014-08-14  6:13 UTC (permalink / raw)
  To: qemu-devel
  Cc: peter.maydell, stefanha, mst, luonengjun, peter.huangpeng,
	aliguori, akong, zhanghailiang

Hi,

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,
The new dirty RAM related to the packets will be missed,
And this will lead serious network fault in VM.

We have discussed this question long time ago, you can find it in
http://qemu.11.n7.nabble.com/PATCH-e1000-rtl8139-forbid-dealing-with-packets-when-VM-is-paused-td261168.html

The problem is still remain, we can reproduct the bug as the follow 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 repeatly 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'.

This patch set is to solve this problem, and according to the suggestion of 
Peter Maydell and Stefan Hajnoczi, we implement this in net layer of qemu.

PS.
In the old discussion, Michael S. Tsirkin advanced that other devices may have 
the same problem, he suggested to stop all io threads with the VM when VM
is not running.

I have test serial, virtio-console, etc. And did not find any obvious fault in
the migration scene. 
Also the scheme of stopping all io threads is complex and maybe a lot work to do.

And for now i think it is ok to fix the obvious net bug first.


Thanks,
zhanghailiang

zhanghailiang (3):
  net: forbid dealing with packets when VM is not running
  net: Flush queues when runstate changes back to running
  virtio-net: Remove checking vm state in virtio_net_can_receive

 hw/net/virtio-net.c |  4 ----
 include/net/net.h   |  2 ++
 net/net.c           | 28 ++++++++++++++++++++++++++++
 3 files changed, 30 insertions(+), 4 deletions(-)

-- 
1.7.12.4

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-08-18  0:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-14  6:13 [Qemu-devel] [PATCH 0/3] forbid dealing with net packets when VM is not running zhanghailiang
2014-08-14  6:13 ` [Qemu-devel] [PATCH 1/3] net: Forbid dealing with " zhanghailiang
2014-08-14  6:13 ` [Qemu-devel] [PATCH 2/3] net: Flush queues when runstate changes back to running zhanghailiang
2014-08-14  7:12   ` Gonglei (Arei)
2014-08-14  8:24     ` zhanghailiang
2014-08-14 10:05   ` Michael S. Tsirkin
2014-08-18  0:45     ` zhanghailiang
2014-08-14 10:09   ` Michael S. Tsirkin
2014-08-18  0:46     ` zhanghailiang
2014-08-14  6:13 ` [Qemu-devel] [PATCH 3/3] virtio-net: Remove checking vm state in virtio_net_can_receive zhanghailiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).