qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: zhanghailiang <zhang.zhanghailiang@huawei.com>
Cc: aliguori@amazon.com, mst@redhat.com, jasowang@redhat.com,
	luonengjun@huawei.com, peter.huangpeng@huawei.com,
	qemu-devel@nongnu.org, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH V4] net: Forbid dealing with packets when VM is not running
Date: Mon, 1 Sep 2014 19:40:18 +0100	[thread overview]
Message-ID: <20140901184018.GA27759@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1409040377-12088-1-git-send-email-zhang.zhanghailiang@huawei.com>

[-- Attachment #1: Type: text/plain, Size: 1518 bytes --]

On Tue, Aug 26, 2014 at 04:06:17PM +0800, zhanghailiang wrote:
> 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>
> ---
>  v4:
> - The action of flush queued packets is unnecessary, remove this.
>   (Thanks for the help of Jason Wang and Stefan). 
> 
>  v3:
> - change the 'vmstate' to 'vm_running'
> 
>  v2:
> - remove the superfluous check of nc->received_disabled 
> ---
> 
>  net/net.c | 7 +++++++
>  1 file changed, 7 insertions(+)

Thanks, applied to my net tree:
https://github.com/stefanha/qemu/commits/net

Stefan

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

  parent reply	other threads:[~2014-09-01 18:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-26  8:06 [Qemu-devel] [PATCH V4] net: Forbid dealing with packets when VM is not running zhanghailiang
2014-08-27  5:16 ` Jason Wang
2014-08-27 10:28 ` Juan Quintela
2014-08-27 11:53 ` Michael S. Tsirkin
2014-08-27 11:59   ` Michael S. Tsirkin
2014-08-28  0:38     ` zhanghailiang
2014-09-01 18:40 ` Stefan Hajnoczi [this message]
2014-09-02  9:06   ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140901184018.GA27759@stefanha-thinkpad.redhat.com \
    --to=stefanha@gmail.com \
    --cc=aliguori@amazon.com \
    --cc=jasowang@redhat.com \
    --cc=luonengjun@huawei.com \
    --cc=mst@redhat.com \
    --cc=peter.huangpeng@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=zhang.zhanghailiang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).