From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202602 header.b=mwFGJFR6; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id CB5F55A0271 for ; Tue, 19 May 2026 08:12:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202602; t=1779171122; bh=ECm2MklcyVrOEHzQjexZU+pjyyIoc3kL6I6QdyWvM+k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mwFGJFR6pJ5VUTU3JUHFkMeulQjeb2B70IIRK/7Hhs7Qj2wmeveOwJ+iPm18cskuv k+11NvoYNt0vwQggVLIMeVAieVj5GYddMXqUlKMmxxiazE11okMk5B57lmjXhQ79YP Bg/kTIwtAW3wis0LY7u7tJ0zo9Ynp+nJ4Fp7xZyevj7h4OIekbTuYtx2bEerJFv/Hz vQ69FSce5hi8JAtpTZepvjdXSu/vJmDS/4BymOqe1lMHjV9wGVM+cMznlSXJuA0GfW cJSRBIEr/zx1GzcryQZvopZfAjSR5E6FluAwr13j/wLvMtOnFFv/1Ru6wSbde+TzrO xYQ1C5QhL33rA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4gKPTG0vw3z4wLv; Tue, 19 May 2026 16:12:02 +1000 (AEST) Date: Tue, 19 May 2026 15:35:35 +1000 From: David Gibson To: Anshu Kumari Subject: Re: [PATCH 2/6] conf: Add --dhcp-boot command-line option Message-ID: References: <20260518132002.418296-1-anskuma@redhat.com> <20260518132002.418296-2-anskuma@redhat.com> <20260518132002.418296-3-anskuma@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="W7OT9wb7RMbHy+f4" Content-Disposition: inline In-Reply-To: <20260518132002.418296-3-anskuma@redhat.com> Message-ID-Hash: TZ6GQZLSDQFN7TQC55WW7HODCXSEHOA6 X-Message-ID-Hash: TZ6GQZLSDQFN7TQC55WW7HODCXSEHOA6 X-MailFrom: dgibson@gandalf.ozlabs.org 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: sbrivio@redhat.com, passt-dev@passt.top, lvivier@redhat.com, jmaloy@redhat.com 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: --W7OT9wb7RMbHy+f4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 18, 2026 at 06:49:58PM +0530, Anshu Kumari wrote: > Introduce the --dhcp-boot flag that sets the boot file URL for > network boot specially for ipxe. This patch adds the option > storage and CLI parsing. >=20 > Link: https://bugs.passt.top/show_bug.cgi?id=3D192 > Signed-off-by: Anshu Kumari > --- > conf.c | 9 +++++++++ > passt.h | 1 + > 2 files changed, 10 insertions(+) >=20 > diff --git a/conf.c b/conf.c > index 2624e58..61a393f 100644 > --- a/conf.c > +++ b/conf.c > @@ -618,6 +618,7 @@ static void usage(const char *name, FILE *f, int stat= us) > " a single, empty option disables the DNS search list\n" > " -H, --hostname NAME Hostname to configure client with\n" > " --fqdn NAME FQDN to configure client with\n" > + " --dhcp-boot URL Boot file URL for network boot\n" > " --dhcp-opt CODE,VAL Set DHCP option by code\n"); > if (strstr(name, "pasta")) > FPRINTF(f, " default: don't use any search list\n"); > @@ -846,6 +847,8 @@ static void conf_print(const struct ctx *c) > info(" router: %s", > inet_ntop(AF_INET, &c->ip4.guest_gw, > buf, sizeof(buf))); > + if (c->dhcp_boot[0]) > + info(" boot file: %s", c->dhcp_boot); > for (i =3D 0; i < c->custom_opts_count; i++) > info(" option %u: %s", > c->custom_opts[i].code, > @@ -1239,6 +1242,7 @@ void conf(struct ctx *c, int argc, char **argv) > {"migrate-no-linger", no_argument, NULL, 30 }, > {"stats", required_argument, NULL, 31 }, > {"conf-path", required_argument, NULL, 'c' }, > + {"dhcp-boot", required_argument, NULL, 32 }, > {"dhcp-opt", required_argument, NULL, 33 }, > { 0 }, > }; > @@ -1472,6 +1476,11 @@ void conf(struct ctx *c, int argc, char **argv) > die("Can't display statistics if not running in foreground"); > c->stats =3D strtol(optarg, NULL, 0); > break; > + case 32: > + if (snprintf_check(c->dhcp_boot, sizeof(c->dhcp_boot), > + "%s", optarg)) > + die("Boot file name too long: %s", optarg); > + break; IIUC, --dhcp-boot foo is equivalent to --dhcp-opt 67,foo Is that right? If so, it would be preferable to make that more explicit in the code, using a single way of storing the options and a common "Add dhcp option helper" that's called from both the --dhcp-boot and --dhcp-opt handling. > case 33: { > unsigned long code; > const char *comma; > diff --git a/passt.h b/passt.h > index acb57dd..2354a0f 100644 > --- a/passt.h > +++ b/passt.h > @@ -262,6 +262,7 @@ struct ctx { > =20 > char hostname[PASST_MAXDNAME]; > char fqdn[PASST_MAXDNAME]; > + char dhcp_boot[PATH_MAX]; > =20 > #define MAX_CUSTOM_DHCP_OPTS 32 > =20 > --=20 > 2.54.0 >=20 --=20 David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson --W7OT9wb7RMbHy+f4 Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmoL9qYACgkQzQJF27ox 2GdQ4w/8D/8CtxmA8Cz15en5XZKiZpHLKN9nhOX7aNTCS9DgsvR4wsvY+kFSfhah 1FdHM5Rwro9yfsgQ6mF2XOtLAwAKzY7nyk6CiXyFE+J5SCGrB91BKL/BSWIAtxVI r6MMHUbfKgjJqq2850Ud7MLdsQfoufzcIkLeqyT8PL9ZBNE8wGPx6TBeAtZST0lF 62PUSpMCnaUhiNHeNTCUHWdsQuJVBNOB5b6RXGhMkVT7MP2VJye4fPboWkh/4FD0 StlMz+Q7rU2WH+Ud5PYKXS+cQyEU0MPkg6/csyyDTUkIYy5d2uD+GUihvVGNxl2x MQPMgSXubjko7iCi80gCcMGdlphZjDR7r9T1nKjD9ANJipSJ+/V0t8IyCIu68uiY UcgK3GLlfNrMsialjNQ5tCimYSdBacS7PmJLwTGw7okYIRt/kftOKd5nvRANQFf0 2GtCZFHO5NqMVzTgAgkutnKrdIJM8eUakwL+rGuX6+om0WOEoZ5o3jbM8Yg7GD9r RRk/wlCsuKnDwpTmwtfMqonDqBH8T3OI80pc7r97CoSJUMMPum370WElRojxFyBM 2TDe7r/AIkWex1YiYHjt0hhWwAD54CqP8c92bQQEDbKPAr8hgMTKcOpF6vmryTjt 06Y3b4CDQLI3KhuNce63dlSK4KsXkHFcFHts8/OfGm40TClPzYA= =cWiU -----END PGP SIGNATURE----- --W7OT9wb7RMbHy+f4--