public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Anshu Kumari <anskuma@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: passt-dev@passt.top, sbrivio@redhat.com, jmaloy@redhat.com,
	lvivier@redhat.com
Subject: Re: [PATCH v2 2/6] conf: Add --dhcp-boot command-line option
Date: Thu, 28 May 2026 10:44:49 +0530	[thread overview]
Message-ID: <CADJNnVKiRKZCcKWsXd321rjdnBt1pWf0gJROCXhtEGv4_9SbTQ@mail.gmail.com> (raw)
In-Reply-To: <ahZcauBKcFgvmN6n@zatzit>

[-- Attachment #1: Type: text/plain, Size: 3474 bytes --]

On Wed, May 27, 2026 at 8:56 AM 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=192
> > Signed-off-by: Anshu Kumari <anskuma@redhat.com>
> > ---
> > v2:
> >   - Removed separate dhcp_boot[PATH_MAX] field — --dhcp-boot foo 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,           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 },
> >       };
> > @@ -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 = strtol(optarg, NULL, 0);
> >                       break;
> > +             case 32:
> > +                     if (c->custom_opts_count >= MAX_CUSTOM_DHCP_OPTS)
> > +                             die("Too many DHCP options (max %d)",
> > +                                 MAX_CUSTOM_DHCP_OPTS);
> > +
> > +                     c->custom_opts[c->custom_opts_count].code = 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 = 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 way
>                                 | around.
> http://www.ozlabs.org/~dgibson
>

[-- Attachment #2: Type: text/html, Size: 5188 bytes --]

  reply	other threads:[~2026-05-28  5:15 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-26 12:31 [PATCH v2 0/6] Add --dhcp-boot and --dhcp-opt options Anshu Kumari
2026-05-26 12:31 ` [PATCH v2 1/6] conf: Add --dhcp-opt command-line option Anshu Kumari
2026-05-26 13:19   ` Laurent Vivier
2026-05-27  2:51   ` David Gibson
2026-05-28  5:02     ` Anshu Kumari
2026-05-28  5:22       ` David Gibson
2026-05-27  7:23   ` Laurent Vivier
2026-05-26 12:31 ` [PATCH v2 2/6] conf: Add --dhcp-boot " Anshu Kumari
2026-05-26 13:25   ` Laurent Vivier
2026-05-27  2:52   ` David Gibson
2026-05-28  5:14     ` Anshu Kumari [this message]
2026-05-27  6:59   ` Laurent Vivier
2026-05-26 12:31 ` [PATCH v2 3/6] dhcp: Add option type table and value parser Anshu Kumari
2026-05-26 16:05   ` Laurent Vivier
2026-05-27  3:00     ` David Gibson
2026-05-28  5:39     ` Anshu Kumari
2026-05-28  5:45       ` David Gibson
2026-05-27  3:26   ` David Gibson
2026-05-26 12:31 ` [PATCH v2 4/6] dhcp: Refactor fill_one() to operate on a generic buffer Anshu Kumari
2026-05-26 16:13   ` Laurent Vivier
2026-05-27  3:46   ` David Gibson
2026-05-26 12:31 ` [PATCH v2 5/6] dhcp: Add option overload Anshu Kumari
2026-05-26 17:42   ` Laurent Vivier
2026-05-27  4:03   ` David Gibson
2026-05-28  7:18     ` Anshu Kumari
2026-05-26 12:31 ` [PATCH v2 6/6] doc: Add --dhcp-boot and --dhcp-opt to man page Anshu Kumari
2026-05-27  4:16   ` David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADJNnVKiRKZCcKWsXd321rjdnBt1pWf0gJROCXhtEGv4_9SbTQ@mail.gmail.com \
    --to=anskuma@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=jmaloy@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=passt-dev@passt.top \
    --cc=sbrivio@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).