From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOWWi-0004i7-Or for qemu-devel@nongnu.org; Mon, 01 Sep 2014 14:40:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOWWe-0005s3-7F for qemu-devel@nongnu.org; Mon, 01 Sep 2014 14:40:28 -0400 Received: from mail-wi0-x233.google.com ([2a00:1450:400c:c05::233]:40861) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOWWe-0005rz-19 for qemu-devel@nongnu.org; Mon, 01 Sep 2014 14:40:24 -0400 Received: by mail-wi0-f179.google.com with SMTP id q5so6583684wiv.0 for ; Mon, 01 Sep 2014 11:40:23 -0700 (PDT) Date: Mon, 1 Sep 2014 19:40:18 +0100 From: Stefan Hajnoczi Message-ID: <20140901184018.GA27759@stefanha-thinkpad.redhat.com> References: <1409040377-12088-1-git-send-email-zhang.zhanghailiang@huawei.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KsGdsel6WgEHnImy" Content-Disposition: inline In-Reply-To: <1409040377-12088-1-git-send-email-zhang.zhanghailiang@huawei.com> Subject: Re: [Qemu-devel] [PATCH V4] net: Forbid dealing with packets when VM is not running List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: zhanghailiang Cc: aliguori@amazon.com, mst@redhat.com, jasowang@redhat.com, luonengjun@huawei.com, peter.huangpeng@huawei.com, qemu-devel@nongnu.org, stefanha@redhat.com --KsGdsel6WgEHnImy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > 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. >=20 > To avoid this, we forbid receiving packets in generic net code when > VM is not running. >=20 > 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 unles= s you > run 'service network restart' >=20 > Signed-off-by: zhanghailiang > --- > v4: > - The action of flush queued packets is unnecessary, remove this. > (Thanks for the help of Jason Wang and Stefan).=20 >=20 > v3: > - change the 'vmstate' to 'vm_running' >=20 > v2: > - remove the superfluous check of nc->received_disabled=20 > --- >=20 > net/net.c | 7 +++++++ > 1 file changed, 7 insertions(+) Thanks, applied to my net tree: https://github.com/stefanha/qemu/commits/net Stefan --KsGdsel6WgEHnImy Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUBL2SAAoJEJykq7OBq3PIrP8IAJdi4XDAAE6bD1Xnkpy27aTf rMb9S1g2Lsr/v9e7TysnLFtWMIbrJHD2YFceHofx6FdQojla5u/DHZM4f4DSlLw/ sYKuhasnLk8YarZIwb/oRi406ogxL9snnmWnGNEJH551NeHNdbybBfgzZViRngtD dtOF6K2vGsKeMb3jMwybxgdv75lUPE6cOHrwhbY2Oo+ra656JOwhWoSOBqY1Hidw 5mS7nJUN6TaH2uwjMlDpYeerP31I4icWRaLyTIsAsf9zYbDZVsRoSElUBBqKebaw t5vKBfedDHtuvc5XFzCb/nx6Aoz8Bg2zY0OypmnPAgX0kmsTSlNi5iu+1aSndpw= =0nLd -----END PGP SIGNATURE----- --KsGdsel6WgEHnImy--