Otherwise, incoming_fds case in net_init_tap() is not covered,
and the mechanism will not work for outgoing local migration,
if VM start life from incoming local migration.

Fixes: 98a0c2127070 "net/tap: disable read polling for stopped VM"
Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
---
 net/tap.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/tap.c b/net/tap.c
index 8039b4e388c..9f829f49c1e 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -623,6 +623,9 @@ static TAPState *new_tap(NetClientState *peer,
 
     s->queue_index = queue_index;
 
+    s->enable_poll_on_resume = false;
+    s->vmstate = qemu_add_vm_change_state_handler(tap_vm_state_change, s);
+
     if (has_permit_local_migration) {
         s->permit_local_migration = permit_local_migration;
     }
@@ -968,9 +971,6 @@ static bool net_init_tap_one(const NetdevTapOptions *tap, 
NetClientState *peer,
     int sndbuf =
         (tap->has_sndbuf && tap->sndbuf) ? MIN(tap->sndbuf, INT_MAX) : INT_MAX;
 
-    s->enable_poll_on_resume = false;
-    s->vmstate = qemu_add_vm_change_state_handler(tap_vm_state_change, s);
-
     if (!tap_set_sndbuf(fd, sndbuf, sndbuf_required ? errp : NULL) &&
         sndbuf_required) {
         goto failed;
-- 
2.43.0


Reply via email to