From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54291) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THPxS-0005QU-Ss for qemu-devel@nongnu.org; Thu, 27 Sep 2012 22:05:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1THPxR-0004At-UT for qemu-devel@nongnu.org; Thu, 27 Sep 2012 22:05:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23151) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THPxR-0004A8-MA for qemu-devel@nongnu.org; Thu, 27 Sep 2012 22:05:37 -0400 From: Amos Kong Date: Fri, 28 Sep 2012 10:06:02 +0800 Message-Id: <1348797962-18447-4-git-send-email-akong@redhat.com> In-Reply-To: <1348797962-18447-1-git-send-email-akong@redhat.com> References: <1348797962-18447-1-git-send-email-akong@redhat.com> Subject: [Qemu-devel] [PATCH v5 3/3] update nc.link_down in virtio_net_load() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, mst@redhat.com, stefanha@gmail.com, jasowang@redhat.com, pbonzini@redhat.com, Amos Kong nc.link_down could not be migrated, this patch updates link_down in virtio_post_load() to keep it coincident with real link status. Signed-off-by: Amos Kong --- hw/virtio-net.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/hw/virtio-net.c b/hw/virtio-net.c index 6490743..f3d4acf 100644 --- a/hw/virtio-net.c +++ b/hw/virtio-net.c @@ -973,6 +973,11 @@ static int virtio_net_load(QEMUFile *f, void *opaque, int version_id) } } n->mac_table.first_multi = i; + + /* nc.link_down can't be migrated, so infer link_down according + * to link status bit in n->status */ + n->nic->nc.link_down = (n->status & VIRTIO_NET_S_LINK_UP) == 0; + return 0; } -- 1.7.1