diff options
author | Amos Kong <akong@redhat.com> | 2012-09-28 10:06:02 +0800 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2012-10-08 13:59:40 +0200 |
commit | 9899148110627da388f82c02997bca6d678d1aa1 (patch) | |
tree | e24d881366e6ea99b351972b81c05e029763ad87 /hw | |
parent | e4b823644044de1b8070fde82d0aad8053dc3333 (diff) | |
download | hqemu-9899148110627da388f82c02997bca6d678d1aa1.zip hqemu-9899148110627da388f82c02997bca6d678d1aa1.tar.gz |
virtio-net: update nc.link_down in virtio_net_load()
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>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Diffstat (limited to 'hw')
-rw-r--r-- | 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 247d7be..8342391 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; } |