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=HVxFNG+L; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id DC1235A0265 for ; Thu, 28 May 2026 07:15:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1779945305; 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: in-reply-to:in-reply-to:references:references; bh=MJbr9flkewlTwG4AofIXV8aduoLVtp+BbdYEjWT0uKk=; b=HVxFNG+Lx1IMt3MqhgUDYm+rSTIjXmoEFStP1NFDEg1rZgRCtXfw3eEpyZ0HvBme4C30BC +M2nQP3Ftx1pBO6klpQMFZUpwb8MzEx+vlSkHquROd292XMLl6wew+PM9rL+RvGpvLqdhD xvLFuiRapRAb3e/FsEzO65QtpyIuu08= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-156-QlmAZh5lOPWnATTKgIiRPA-1; Thu, 28 May 2026 01:15:03 -0400 X-MC-Unique: QlmAZh5lOPWnATTKgIiRPA-1 X-Mimecast-MFC-AGG-ID: QlmAZh5lOPWnATTKgIiRPA_1779945302 Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-5a886da574eso8210671e87.0 for ; Wed, 27 May 2026 22:15:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779945302; x=1780550102; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=MJbr9flkewlTwG4AofIXV8aduoLVtp+BbdYEjWT0uKk=; b=LIryLDXPMGnqXtc1YDkqUOXuNB+aR5twB/b4rcZJbBf04pa3SX4u/R84CHrARJc7Jx DgwDAbskiDnwkaYuHWD/MghOPCErrI8zYBRd+wHDoljVeylPQ26m++3eK4KNP/lZHEVQ E09O25WqGJ9m3ianWqan5OlJUKXzcgV5V8GFRRnODWshu7D0sLaCn6o+rCDbZPAyJ1X8 WBjbr7E4zYA2OEnlsSmtCRS0rV1lDt1Qfl6OJeAX7bSuwOyHznp4n5LD9/zU/Y795m1H JBL/DdpPWz5vOZR51lK2t7IhhzDWueXG7a5Rk9+pWdlCVMqVitVHlwidRuR5/UWI5u16 +4yw== X-Gm-Message-State: AOJu0YwlBm0ebbRFkMYw1ZGPK70PFwDuHz50fCEYYrF7/ZJnuX1Vci1x 7Nm8gWmrrbPhBHeGr9CtMfC3EycJipWdZZasZnD7kw1bXLGPXxmY/pmoOg/LGoSCQy14O/D1z4X a/8CtP80aRxA3lIeK61IY4mqAauvTlQJY9YP1UvOvQtK4w20nW0zr9fLAGlythVJwWT3iaW32Bu ApWTXdNKKigoU5vzAlC1Ow8cd9nJAQ X-Gm-Gg: Acq92OEOs8hT22mc96K0WExebWZeXdMjXMic80JBlULRbxtn2kcLU+zQ9Yg9VyKrFiz V1716xoydW1dq6/2xjfy1ZWi/EjGM1gqyu38vIyRFqm9xJ4rqVACmRrClfvdcuIZlPIJASTyCXq hD3mtSbUkR8QTAiiUF4ldhuu+WJJiOQXMafRmrUXWUzXEA0V68hTSdHiBq5LRrPWFItMczfYWyt J4wzgJtMBldVWrSiw6tc6Pj3BWFqRFbdboKbGikBgHf53FsCA== X-Received: by 2002:a05:6512:61a2:b0:5a8:89ad:e172 with SMTP id 2adb3069b0e04-5aa323aa517mr7863346e87.37.1779945302130; Wed, 27 May 2026 22:15:02 -0700 (PDT) X-Received: by 2002:a05:6512:61a2:b0:5a8:89ad:e172 with SMTP id 2adb3069b0e04-5aa323aa517mr7863331e87.37.1779945301665; Wed, 27 May 2026 22:15:01 -0700 (PDT) MIME-Version: 1.0 References: <20260526123115.1226166-1-anskuma@redhat.com> <20260526123115.1226166-3-anskuma@redhat.com> In-Reply-To: From: Anshu Kumari Date: Thu, 28 May 2026 10:44:49 +0530 X-Gm-Features: AVHnY4Jep1kaiaxp20bTSU_bkP6M7CV56n3TY0JSTYpF5Xxp0Ccc7YbEYjyD7S4 Message-ID: Subject: Re: [PATCH v2 2/6] conf: Add --dhcp-boot command-line option To: David Gibson X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: F_9jiNWASFoso-5dGEi1jVTSW6Jut6U490F_9jroS7A_1779945302 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="0000000000006cf8400652d9cfa4" Message-ID-Hash: NXOOGXG7RBRYZSF4QQLAPN6UMQKBCAW4 X-Message-ID-Hash: NXOOGXG7RBRYZSF4QQLAPN6UMQKBCAW4 X-MailFrom: anskuma@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, sbrivio@redhat.com, jmaloy@redhat.com, lvivier@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: --0000000000006cf8400652d9cfa4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, May 27, 2026 at 8:56=E2=80=AFAM David Gibson wrote: > On Tue, May 26, 2026 at 06:01:09PM +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. > > > > Link: https://bugs.passt.top/show_bug.cgi?id=3D192 > > Signed-off-by: Anshu Kumari > > --- > > v2: > > - Removed separate dhcp_boot[PATH_MAX] field =E2=80=94 --dhcp-boot fo= o now > stores into custom_opts[] as code 67 (same as --dhcp-opt 67,foo) > > > > --- > > conf.c | 14 ++++++++++++++ > > 1 file changed, 14 insertions(+) > > > > diff --git a/conf.c b/conf.c > > index 89d2127..ae8ee26 100644 > > --- a/conf.c > > +++ b/conf.c > > @@ -618,6 +618,7 @@ static void usage(const char *name, FILE *f, int > status) > > " 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"); > > @@ -1239,6 +1240,7 @@ void conf(struct ctx *c, int argc, char **argv) > > {"migrate-no-linger", no_argument, NULL, 3= 0 > }, > > {"stats", required_argument, NULL, 3= 1 > }, > > {"conf-path", required_argument, NULL, > 'c' }, > > + {"dhcp-boot", required_argument, NULL, 3= 2 > }, > > {"dhcp-opt", required_argument, NULL, 3= 3 > }, > > { 0 }, > > }; > > @@ -1475,6 +1477,18 @@ 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 (c->custom_opts_count >=3D MAX_CUSTOM_DHCP_OPT= S) > > + die("Too many DHCP options (max %d)", > > + MAX_CUSTOM_DHCP_OPTS); > > + > > + c->custom_opts[c->custom_opts_count].code =3D 67; > > Similar to my query with --dhcp-opt, what happens if the user > specifies both --dhcp-boot and --dhcp-opt 67,XXX? > option value gets overwritten similar to --dhcp-opt flag. > > > > + if > (snprintf_check(c->custom_opts[c->custom_opts_count].str, > > + sizeof(c->custom_opts[0].str), > > + "%s", optarg)) > > + die("Boot file name too long: %s", optarg= ); > > + c->custom_opts_count++; > > + break; > > case 33: > > comma =3D strchr(optarg, ','); > > if (!comma) > > -- > > 2.54.0 > > > > -- > 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 wa= y > | around. > http://www.ozlabs.org/~dgibson > --0000000000006cf8400652d9cfa4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Wed, May 27,= 2026 at 8:56=E2=80=AFAM David Gibson <david@gibson.dropbear.id.au> wrote:
On Tue, May 26, 2026 at 06:01:09PM= +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.
>
> Link: https://bugs.passt.top/show_bug.cgi?id=3D192<= /a>
> Signed-off-by: Anshu Kumari <
anskuma@redhat.com>
> ---
> v2:
>=C2=A0 =C2=A0- Removed separate dhcp_boot[PATH_MAX] field =E2=80=94 --d= hcp-boot foo now stores into custom_opts[] as code 67 (same as --dhcp-opt 6= 7,foo)
>
> ---
>=C2=A0 conf.c | 14 ++++++++++++++
>=C2=A0 1 file changed, 14 insertions(+)
>
> diff --git a/conf.c b/conf.c
> index 89d2127..ae8ee26 100644
> --- a/conf.c
> +++ b/conf.c
> @@ -618,6 +618,7 @@ static void usage(const char *name, FILE *f, int s= tatus)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"=C2=A0 =C2= =A0 a single, empty option disables the DNS search list\n"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"=C2=A0 -H,= --hostname NAME=C2=A0 Hostname to configure client with\n"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"=C2=A0 --f= qdn NAME=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 FQDN to configure client with\n&= quot;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"=C2=A0 --dhcp-b= oot URL=C2=A0 =C2=A0 =C2=A0 Boot file URL for network boot\n"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"=C2=A0 --d= hcp-opt CODE,VAL=C2=A0 Set DHCP option by code\n");
>=C2=A0 =C2=A0 =C2=A0 =C2=A0if (strstr(name, "pasta"))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0FPRINTF(f, "= ;=C2=A0 =C2=A0 default: don't use any search list\n");
> @@ -1239,6 +1240,7 @@ void conf(struct ctx *c, int argc, char **argv)<= br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{"migrate-n= o-linger", no_argument,=C2=A0 =C2=A0 =C2=A0 NULL,=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A030 },
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{"stats&quo= t;, required_argument,=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NULL,=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A031 },
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{"conf-path= ",=C2=A0 =C2=A0required_argument,=C2=A0 =C2=A0 =C2=A0 NULL,=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0'c' },
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{"dhcp-boot"= ;, required_argument,=C2=A0 =C2=A0 =C2=A0 =C2=A0 NULL,=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A032 },
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{"dhcp-opt&= quot;, required_argument,=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0NULL,=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A033 },
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ 0 },
>=C2=A0 =C2=A0 =C2=A0 =C2=A0};
> @@ -1475,6 +1477,18 @@ void conf(struct ctx *c, int argc, char **argv)=
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0die("Can't display statis= tics if not running in foreground");
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0c->stats =3D strtol(optarg, NULL, 0);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0break;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case 32:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0if (c->custom_opts_count >=3D MAX_CUSTOM_DHCP_OPTS)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0die("Too many DHCP options (max %d)= ",
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0MAX_CUSTOM_DHCP_OPTS);
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0c->custom_opts[c->custom_opts_count].code =3D 67;

Similar to my query with --dhcp-opt, what happens if the user
specifies both --dhcp-boot and --dhcp-opt 67,XXX?

=
option value gets overwritten similar to --dhcp-opt flag.
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">

> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0if (snprintf_check(c->custom_opts[c->custom_opts_count].str, > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 size= of(c->custom_opts[0].str),
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quo= t;%s", optarg))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0die("Boot file name too long: %s&qu= ot;, optarg);
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0c->custom_opts_count++;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0break;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case 33:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0comma =3D strchr(optarg, ',');
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0if (!comma)
> --
> 2.54.0
>

--
David Gibson (he or they)=C2=A0 =C2=A0 =C2=A0 =C2=A0| I'll have my musi= c baroque, and my code
david AT gibson.dropbear.id.au=C2=A0 | minimalist, thank you, not th= e other way
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | around.
http://www.ozlabs.org/~dgibson
--0000000000006cf8400652d9cfa4--