From: Vladimir Sementsov-Ogievskiy <[email protected]>
We shouldn't call tap_read_poll() if s->fd < 0.
Let's move tap_read_poll() to the end, after check
and vhost initialization.
Fixes: c4d884bb5444 ("net/tap: support local migration with virtio-net")
Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
Message-ID: <[email protected]>
---
net/tap.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/tap.c b/net/tap.c
index d71e3dd117..8039b4e388 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -490,8 +490,6 @@ static bool tap_post_load(void *opaque, int version_id,
Error **errp)
ERRP_GUARD();
TAPState *s = opaque;
- tap_read_poll(s, true);
-
if (s->fd < 0) {
error_setg(errp, "FD was not loaded during incoming migration");
return false;
@@ -503,6 +501,7 @@ static bool tap_post_load(void *opaque, int version_id,
Error **errp)
return false;
}
+ tap_read_poll(s, true);
return true;
}
--
MST