From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57024) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMaTP-00038p-5q for qemu-devel@nongnu.org; Wed, 27 Aug 2014 06:29:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMaTK-0002CL-D4 for qemu-devel@nongnu.org; Wed, 27 Aug 2014 06:29:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15482) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMaTK-0002CH-5M for qemu-devel@nongnu.org; Wed, 27 Aug 2014 06:28:58 -0400 From: Juan Quintela In-Reply-To: <1409040377-12088-1-git-send-email-zhang.zhanghailiang@huawei.com> (zhanghailiang's message of "Tue, 26 Aug 2014 16:06:17 +0800") References: <1409040377-12088-1-git-send-email-zhang.zhanghailiang@huawei.com> Date: Wed, 27 Aug 2014 12:28:48 +0200 Message-ID: <87d2bm5iqn.fsf@troll.troll> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH V4] net: Forbid dealing with packets when VM is not running Reply-To: quintela@redhat.com 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 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 Reviewed-by: Juan Quintela It fixes the "collateral" issue than info migrate after migration has ended shows a remaining ram != 0. Thanks, Juan.