On Thu, 10 Oct 2024 14:29:00 +0200 Laurent Vivier <lvivier(a)redhat.com> wrote:Extract pool storage initialization loop to tap_sock_update_pool(), extract QEMU hints to tap_backend_show_hints(). Signed-off-by: Laurent Vivier <lvivier(a)redhat.com> --- passt.c | 2 +- tap.c | 56 +++++++++++++++++++++++++++++++++++++++++--------------- tap.h | 2 +- 3 files changed, 43 insertions(+), 17 deletions(-) diff --git a/passt.c b/passt.c index ad6f0bc32df6..79093ee02d62 100644 --- a/passt.c +++ b/passt.c @@ -261,7 +261,7 @@ int main(int argc, char **argv) pasta_netns_quit_init(&c); - tap_sock_init(&c); + tap_backend_init(&c); secret_init(&c); diff --git a/tap.c b/tap.c index c53a39b79e62..4b826fdf7adc 100644 --- a/tap.c +++ b/tap.c @@ -1188,11 +1188,31 @@ int tap_sock_unix_open(char *sock_path) return fd; } +/** + * tap_backend_show_hints() - Give help information to start QEMU + * @c: Execution context + */ +static void tap_backend_show_hints(struct ctx *c) +{ + switch(c->mode) {Nit: switch (c->mode) { ...+ case MODE_PASTA: + /* No hints */ + break; + case MODE_PASST: + info("\nYou can now start qemu (>= 7.2, with commit 13c6be96618c):"); + info(" kvm ... -device virtio-net-pci,netdev=s -netdev stream,id=s,server=off,addr.type=unix,addr.path=%s", + c->sock_path); + info("or qrap, for earlier qemu versions:"); + info(" ./qrap 5 kvm ... -net socket,fd=5 -net nic,model=virtio"); + break; + } +}The rest, up to this patch, looks good to me. I'm still reviewing 7/8. -- Stefano