From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=iHTL4TOB; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id 589DE5A0627 for ; Tue, 05 May 2026 01:10:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1777936248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XnfZk6S/BU46zEOBeru8UuMSJ3yriHBrTh+GObSg7so=; b=iHTL4TOBOzUKRkjgvJ4WVFeuGvjU5ccYLFO1svt0CA4kT5fZT4M97nK3SGPDKgBZ/v7enU F3nglTyQTJldK5I1U078R8cZ8JDgKsLTNDHMZsPtC8+OCJ4W7p+UXXcAjJIoPhE08xAw1L J9cLJyxdwsWjPt+f3MsC1hrwxxG4g2E= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-367-WqiDeVylOTO-Z_GuEWpozg-1; Mon, 04 May 2026 19:10:46 -0400 X-MC-Unique: WqiDeVylOTO-Z_GuEWpozg-1 X-Mimecast-MFC-AGG-ID: WqiDeVylOTO-Z_GuEWpozg_1777936245 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-48d127eb013so4766115e9.1 for ; Mon, 04 May 2026 16:10:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777936245; x=1778541045; h=date:content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XnfZk6S/BU46zEOBeru8UuMSJ3yriHBrTh+GObSg7so=; b=sQWLKuvrGORs8Lj4Y7jW2c1RL+qzMp0W7NRCG1qqHQpYazLMz0Ed894CgTF6zGlabE 0HKKACa/Pbnb1madwOWEQd/3zgjyLbLGTMwtU46/kYT/QJ/F9Av++PMusNBLu0FeLIWT iNy9oAdzA3wASelhaWWT0qgw1ANHZ7XBtl1XYo6n1CW0FjV1braOp/jW2ncRZbvUP0On TY2bWgRXYS+wfIkrioKamVq6d1iRv1Ohe6AWKEYvjyGfJnWsFKaX1/7FPSZumsFH6VH0 bN3hkoeDytQViB22ImM9MXM82qYCDHxnc97Xg1uM+yyLixCdqNFRHEInVqUT14DQkn6C 2MMg== X-Gm-Message-State: AOJu0YzvevrFRtgH7nuIprBc1IjZ9KPdAFTVkW+ShnDOtW6fHlWRX/gd RD62Ox6sflSQYTsvDYfFGFDSKF8rMYxIu40HehNjkVrjtx7wehylb4kcUbcFeysfeNiTyPMJsmo AJijg/Rwu7Ga09LQzqbWy0rKCGX9vW38DnT1sgy6kLqSJjAPvFf6bcA== X-Gm-Gg: AeBDieur66mOzfNJqm1iNDSrKT+0l1LKtasnmmUQtQI3mReMpysYF2HZSH11FVF+1sS Formh9z6YzNVQpvhkxnIYRRGw2Z03jYOd/+jUmymzPm1lsSDm6MY81V1jytEbWk7r1OuBtQh+B7 ttsJgB8+Eq1FwgNPw9KEUOZJ+Tm7aWrfCN1zPl5zzq+OAvNYAuKeqJat1kuXYoP2dGYisapjOdx 7m5Qb3Kb+ZxSrMAUqk7S/Ke/POm+pPgdkpBzvslX6E8+f1q/Y+qn5GWpyMFZzosFxQ2qQPwzEsg kmE/tXk2u/3h1/mShNDAe+8DpCDM0yX0oo//jxyVbXScros5tGMykH2yF1+/hf95VyL/yB9FACB eJsS77rrkrgjxbQvIS4KoTEK/ruR3C/mBhsrn4PhQO2U= X-Received: by 2002:a05:600c:c082:b0:48a:5821:5ff2 with SMTP id 5b1f17b1804b1-48a9887190fmr132258355e9.8.1777936245108; Mon, 04 May 2026 16:10:45 -0700 (PDT) X-Received: by 2002:a05:600c:c082:b0:48a:5821:5ff2 with SMTP id 5b1f17b1804b1-48a9887190fmr132258135e9.8.1777936244591; Mon, 04 May 2026 16:10:44 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4502c011d0dsm580570f8f.33.2026.05.04.16.10.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2026 16:10:43 -0700 (PDT) From: Stefano Brivio To: Laurent Vivier Subject: Re: [PATCH v6 08/18] pesto: Introduce stub configuration tool Message-ID: <20260505011042.476b0f17@elisabeth> In-Reply-To: References: <20260503215601.823029-1-sbrivio@redhat.com> <20260503215601.823029-9-sbrivio@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 Date: Tue, 05 May 2026 01:10:43 +0200 (CEST) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: fDlw5R8E10jApJ66TVzVtNHNJ5Pd2E1VYlicBZRL_Wo_1777936245 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: HWOLBF37HHCRP5DZSW2DGR6PSDFVE2DL X-Message-ID-Hash: HWOLBF37HHCRP5DZSW2DGR6PSDFVE2DL X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top, Jon Maloy , David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Mon, 4 May 2026 12:51:02 +0200 Laurent Vivier wrote: > On 5/3/26 23:55, Stefano Brivio wrote: > > From: David Gibson > > > > Build a new "pesto" binary, which will become the tool to update a running > > passt/pasta's configuration. For now, we just build a stub binary which > > sets up a basic environment, parses trivial command line options but does > > nothing else. > > > > Signed-off-by: David Gibson > > Signed-off-by: Stefano Brivio > > Reviewed-by: Laurent Vivier > > One little nit below > > > --- > > .gitignore | 2 + > > Makefile | 42 +++++++++++------ > > common.h | 24 ++++++++++ > > pesto.1 | 46 +++++++++++++++++++ > > pesto.c | 132 +++++++++++++++++++++++++++++++++++++++++++++++++++++ > > pesto.h | 12 +++++ > > util.h | 12 +---- > > 7 files changed, 244 insertions(+), 26 deletions(-) > > create mode 100644 common.h > > create mode 100644 pesto.1 > > create mode 100644 pesto.c > > create mode 100644 pesto.h > > > > diff --git a/.gitignore b/.gitignore > > index 3c16adc..3e40d9f 100644 > > --- a/.gitignore > > +++ b/.gitignore > > @@ -4,9 +4,11 @@ > > /pasta > > /pasta.avx2 > > /passt-repair > > +/pesto > > /qrap > > /pasta.1 > > /seccomp.h > > +/seccomp_pesto.h > > /seccomp_repair.h > > /c*.json > > README.plain.md > > diff --git a/Makefile b/Makefile > > index 7875d23..030681b 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -47,19 +47,21 @@ PASST_SRCS = arch.c arp.c bitmap.c checksum.c conf.c dhcp.c dhcpv6.c \ > > vhost_user.c virtio.c vu_common.c > > QRAP_SRCS = qrap.c > > PASST_REPAIR_SRCS = passt-repair.c > > -SRCS = $(PASST_SRCS) $(QRAP_SRCS) $(PASST_REPAIR_SRCS) > > - > > -MANPAGES = passt.1 pasta.1 qrap.1 passt-repair.1 > > - > > -PASST_HEADERS = arch.h arp.h bitmap.h checksum.h conf.h dhcp.h dhcpv6.h \ > > - epoll_ctl.h flow.h fwd.h fwd_rule.h flow_table.h icmp.h icmp_flow.h \ > > - inany.h iov.h ip.h isolation.h lineread.h log.h migrate.h ndp.h \ > > - netlink.h packet.h passt.h pasta.h pcap.h pif.h repair.h serialise.h \ > > - siphash.h tap.h tcp.h tcp_buf.h tcp_conn.h tcp_internal.h tcp_splice.h \ > > - tcp_vu.h udp.h udp_flow.h udp_internal.h udp_vu.h util.h vhost_user.h \ > > - virtio.h vu_common.h > > +PESTO_SRCS = pesto.c > > +SRCS = $(PASST_SRCS) $(QRAP_SRCS) $(PASST_REPAIR_SRCS) $(PESTO_SRCS) > > + > > +MANPAGES = passt.1 pasta.1 pesto.1 qrap.1 passt-repair.1 > > + > > +PASST_HEADERS = arch.h arp.h bitmap.h checksum.h common.h conf.h dhcp.h \ > > + dhcpv6.h epoll_ctl.h flow.h fwd.h fwd_rule.h flow_table.h icmp.h \ > > + icmp_flow.h inany.h iov.h ip.h isolation.h lineread.h log.h migrate.h \ > > + ndp.h netlink.h packet.h passt.h pasta.h pcap.h pesto.h pif.h repair.h \ > > + serialise.h siphash.h tap.h tcp.h tcp_buf.h tcp_conn.h tcp_internal.h \ > > + tcp_splice.h tcp_vu.h udp.h udp_flow.h udp_internal.h udp_vu.h util.h \ > > + vhost_user.h virtio.h vu_common.h > > QRAP_HEADERS = arp.h ip.h passt.h util.h > > PASST_REPAIR_HEADERS = linux_dep.h > > +PESTO_HEADERS = common.h pesto.h > > > > C := \#include \nint main(){int a=getrandom(0, 0, 0);} > > ifeq ($(shell printf "$(C)" | $(CC) -S -xc - -o - >/dev/null 2>&1; echo $$?),0) > > @@ -78,7 +80,7 @@ docdir ?= $(datarootdir)/doc/passt > > mandir ?= $(datarootdir)/man > > man1dir ?= $(mandir)/man1 > > > > -BASEBIN = passt qrap passt-repair > > +BASEBIN = passt qrap passt-repair pesto > > ifeq ($(TARGET_ARCH),x86_64) > > BASEBIN += passt.avx2 > > endif > > @@ -100,6 +102,9 @@ seccomp.h: seccomp.sh $(PASST_SRCS) $(PASST_HEADERS) > > seccomp_repair.h: seccomp.sh $(PASST_REPAIR_SRCS) $(PASST_REPAIR_HEADERS) > > @ ARCH="$(TARGET_ARCH)" CC="$(CC)" ./seccomp.sh seccomp_repair.h $(PASST_REPAIR_SRCS) > > > > +seccomp_pesto.h: seccomp.sh $(PESTO_SRCS) > > + @ ARCH="$(TARGET_ARCH)" CC="$(CC)" ./seccomp.sh seccomp_pesto.h $(PESTO_SRCS) > > + > > $(BASEBIN): %: > > $(CC) $(BASE_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(filter %.c,$^) -o $@ > > > > @@ -116,6 +121,8 @@ qrap: $(QRAP_SRCS) $(QRAP_HEADERS) > > > > passt-repair: $(PASST_REPAIR_SRCS) $(PASST_REPAIR_HEADERS) seccomp_repair.h > > > > +pesto: $(PESTO_SRCS) $(PESTO_HEADERS) seccomp_pesto.h > > + > > valgrind: EXTRA_SYSCALLS += rt_sigprocmask rt_sigtimedwait rt_sigaction \ > > rt_sigreturn getpid gettid kill clock_gettime \ > > mmap|mmap2 munmap open unlink gettimeofday futex \ > > @@ -126,7 +133,7 @@ valgrind: all > > > > .PHONY: clean > > clean: > > - $(RM) $(BIN) *~ *.o seccomp.h seccomp_repair.h pasta.1 \ > > + $(RM) $(BIN) *~ *.o seccomp.h seccomp_repair.h seccomp_pesto.h pasta.1 \ > > passt.tar passt.tar.gz *.deb *.rpm \ > > passt.pid README.plain.md > > > > @@ -183,7 +190,8 @@ docs: README.md > > CLANG_TIDY = clang-tidy > > CLANG_TIDY_FLAGS = -DCLANG_TIDY_58992 > > > > -clang-tidy: passt.clang-tidy passt-repair.clang-tidy qrap.clang-tidy > > +clang-tidy: passt.clang-tidy passt-repair.clang-tidy pesto.clang-tidy \ > > + qrap.clang-tidy > > > > .PHONY: %.clang-tidy > > %.clang-tidy: > > @@ -191,6 +199,7 @@ clang-tidy: passt.clang-tidy passt-repair.clang-tidy qrap.clang-tidy > > > > passt.clang-tidy: $(PASST_SRCS) $(PASST_HEADERS) seccomp.h > > passt-repair.clang-tidy: $(PASST_REPAIR_SRCS) $(PASST_REPAIR_HEADERS) seccomp_repair.h > > +pesto.clang-tidy: $(PESTO_SRCS) $(PESTO_HEADERS) seccomp_pesto.h > > qrap.clang-tidy: $(QRAP_SRCS) $(QRAP_HEADERS) > > > > CPPCHECK = cppcheck > > @@ -206,7 +215,7 @@ CPPCHECK_FLAGS = --std=c11 --error-exitcode=1 --enable=all --force \ > > --suppress=unusedStructMember \ > > -D CPPCHECK_6936 > > > > -cppcheck: passt.cppcheck passt-repair.cppcheck qrap.cppcheck > > +cppcheck: passt.cppcheck passt-repair.cppcheck pesto.cppcheck qrap.cppcheck > > > > .PHONY: %.cppcheck > > %.cppcheck: > > @@ -215,6 +224,9 @@ cppcheck: passt.cppcheck passt-repair.cppcheck qrap.cppcheck > > passt.cppcheck: $(PASST_SRCS) $(PASST_HEADERS) seccomp.h > > passt-repair.cppcheck: $(PASST_REPAIR_SRCS) $(PASST_REPAIR_HEADERS) seccomp_repair.h > > > > +pesto.cppcheck: CPPCHECK_FLAGS += --suppress=unmatchedSuppression > > +pesto.cppcheck: $(PESTO_SRCS) $(PESTO_HEADERS) seccomp_pesto.h > > + > > qrap.cppcheck: BASE_CPPFLAGS += -DARCH=\"$(TARGET_ARCH)\" > > qrap.cppcheck: CPPCHECK_FLAGS += --suppress=unusedFunction > > qrap.cppcheck: $(QRAP_SRCS) $(QRAP_HEADERS) > > diff --git a/common.h b/common.h > > new file mode 100644 > > index 0000000..a9c115a > > --- /dev/null > > +++ b/common.h > > @@ -0,0 +1,24 @@ > > +/* SPDX-License-Identifier: GPL-2.0-or-later > > + * Copyright Red Hat > > + * Author: David Gibson > > + * > > + * Definitions used by both passt/pasta and other tools > > + */ > > + > > +#ifndef COMMON_H > > +#define COMMON_H > > + > > +#include > > + > > +#define VERSION_BLOB \ > > + VERSION "\n" \ > > + "Copyright Red Hat\n" \ > > + "GNU General Public License, version 2 or later\n" \ > > + " \n" \ > > + "This is free software: you are free to change and redistribute it.\n" \ > > + "There is NO WARRANTY, to the extent permitted by law.\n\n" > > + > > +/* FPRINTF() intentionally silences cert-err33-c clang-tidy warnings */ > > +#define FPRINTF(f, ...) (void)fprintf(f, __VA_ARGS__) > > + > > +#endif /* _COMMON_H */ > > Why "_COMMON_H" and not "COMMON_H"? I think it was... common, a long time ago, to prefix include guards with underscores (perhaps in the Linux kernel, I don't remember). I also happened to write some code with those and fixed it just before sending out patches. Somewhat curiously, that's also the case for lineread.h (without the underscore in the actual include guard name, just in the comment at the end), and I missed that during review as well: https://archives.passt.top/passt-dev/20220623113143.538e9266@elisabeth/ Anyway, fixed in v7. -- Stefano