From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51688) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCRjS-000192-Ao for qemu-devel@nongnu.org; Fri, 14 Sep 2012 04:58:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCRjO-0004ZT-4S for qemu-devel@nongnu.org; Fri, 14 Sep 2012 04:58:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39319) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCRjN-0004ZM-SG for qemu-devel@nongnu.org; Fri, 14 Sep 2012 04:58:34 -0400 Message-ID: <5052F277.7000703@redhat.com> Date: Fri, 14 Sep 2012 17:01:43 +0800 From: Jason Wang MIME-Version: 1.0 References: <504DA1A9.2000908@redhat.com> <1347526299-27407-1-git-send-email-akong@redhat.com> <505289C3.9000005@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] rtl8139: implement 8139cp link status List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: aliguori@us.ibm.com, Amos Kong , mst@redhat.com, qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com On 09/14/2012 03:30 PM, Stefan Hajnoczi wrote: > On Fri, Sep 14, 2012 at 2:34 AM, Amos Kong wrote: >> On 13/09/12 20:29, Stefan Hajnoczi wrote: >>> On Thu, Sep 13, 2012 at 9:51 AM, Amos Kong wrote: >>> Regarding migration: do we migrate the NetClient->link_down field? If >>> we only migrate the status register value then the link may actually >>> be up at the net.c level. >> >> I tried to add 'MediaStatus' to 'struct RTL8139State', and update >> 'VMStateDescription vmstate_rtl8139', then the value of MediaStatus >> will be migrated. >> >> But the idea in v2 is better. > Migrating the NIC's media status is not enough. Above I asked about > migrating nc->link_down, which determines whether net.c delivers > packets or drops them. > > Your patch migrates the NIC's media status but I believe nc->link_down > isn't being migrated and the guest will therefore receive packets from > the host! This could lead to unexpected results since the guest > thinks the link is down. > > It's not a bug in your patch, but a larger issue that needs to be > addressed for all NICs that support migration. (Unless I missed the > code that will migrate link_down.) > > Stefan A possible solution is to infer the nc->link_down from the media status register in the destination. It works without adding more codes net.c but need model specific callback functions.