qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH V4] net: Forbid dealing with packets when VM is


From: Stefan Hajnoczi
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
User-agent: Mutt/1.5.23 (2014-03-12)

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 <address@hidden>
> ---
>  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: pgpEj6rv9VItr.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]