Patchwork [v5,3/3] update nc.link_down in virtio_net_load()

login
register
mail settings
Submitter Amos Kong
Date Sept. 28, 2012, 2:06 a.m.
Message ID <1348797962-18447-4-git-send-email-akong@redhat.com>
Download mbox | patch
Permalink /patch/187698/
State New
Headers show

Comments

Amos Kong - Sept. 28, 2012, 2:06 a.m.
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 <akong@redhat.com>
---
 hw/virtio-net.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

Patch

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;
 }