qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH v4 3/3] update nc.link_down in virtio_net_load()


From: Amos Kong
Subject: [Qemu-devel] [PATCH v4 3/3] update nc.link_down in virtio_net_load()
Date: Mon, 17 Sep 2012 10:25:36 +0800

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 <address@hidden>
---
 hw/virtio-net.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/hw/virtio-net.c b/hw/virtio-net.c
index b1998b2..e637619 100644
--- a/hw/virtio-net.c
+++ b/hw/virtio-net.c
@@ -977,6 +977,10 @@ static int virtio_net_load(QEMUFile *f, void *opaque, int 
version_id)
         }
     }
     n->mac_table.first_multi = i;
+
+    /* 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




reply via email to

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