From: David Gibson <david(a)gibson.dropbear.id.au> Currently we call repair_sock_init() immediately before tap_sock_unix_init(). However, this means it will be skipped if the vhost-user control fd is passed with --fd instead of being created at a specific path. We still need the repair socket in that case. Move it, instead, to vu_init(), which has the added advantage of moving all migration related one-time init to the same place. Signed-off-by: David Gibson <david(a)gibson.dropbear.id.au> --- tap.c | 3 --- vhost_user.c | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tap.c b/tap.c index 3659aab..d1a9f52 100644 --- a/tap.c +++ b/tap.c @@ -56,7 +56,6 @@ #include "netlink.h" #include "pasta.h" #include "packet.h" -#include "repair.h" #include "tap.h" #include "log.h" #include "vhost_user.h" @@ -1362,8 +1361,6 @@ void tap_backend_init(struct ctx *c) tap_sock_tun_init(c); break; case MODE_VU: - repair_sock_init(c); - /* fall through */ case MODE_PASST: tap_sock_unix_init(c); diff --git a/vhost_user.c b/vhost_user.c index bbbf504..5df29c4 100644 --- a/vhost_user.c +++ b/vhost_user.c @@ -44,6 +44,7 @@ #include "tap.h" #include "vhost_user.h" #include "pcap.h" +#include "repair.h" /* vhost-user version we are compatible with */ #define VHOST_USER_VERSION 1 @@ -1106,8 +1107,10 @@ void vu_init(struct ctx *c) } c->vdev->log_table = NULL; c->vdev->log_call_fd = -1; + c->vdev->device_state_fd = -1; c->vdev->device_state_result = -1; + repair_sock_init(c); } -- 2.43.0