|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v5 2/4] x86/ucode: refactor xen-ucode to utilize getopt
On Tue, Jul 16, 2024 at 3:51 PM Jan Beulich <jbeulich@xxxxxxxx> wrote:
>
> On 12.07.2024 15:07, Fouad Hilly wrote:
> > --- a/tools/misc/xen-ucode.c
> > +++ b/tools/misc/xen-ucode.c
> > @@ -11,6 +11,7 @@
> > #include <sys/stat.h>
> > #include <fcntl.h>
> > #include <xenctrl.h>
> > +#include <getopt.h>
> >
> > static xc_interface *xch;
> >
> > @@ -71,12 +72,29 @@ static void show_curr_cpu(FILE *f)
> > }
> > }
> >
> > +static void usage(FILE *stream, const char *name)
> > +{
> > + fprintf(stream,
> > + "%s: Xen microcode updating tool\n"
> > + "options:\n"
> > + " -h, --help display this help\n"
> > + " -s, --show-cpu-info show CPU information\n"
> > + "Usage: %s [microcode file] [options]\n", name, name);
>
> Isn't it more like [microcode file | options] at this point? Even when
> --force support is added, neither of the two options here go together
> with a microcode file.
Yes, I will fix it in v6
>
> > @@ -86,22 +104,34 @@ int main(int argc, char *argv[])
> > exit(1);
> > }
> >
> > - if ( argc < 2 )
> > + while ( (opt = getopt_long(argc, argv, "hs", options, NULL)) != -1 )
> > {
> > - fprintf(stderr,
> > - "xen-ucode: Xen microcode updating tool\n"
> > - "Usage: %s [<microcode file> | show-cpu-info]\n", argv[0]);
> > - show_curr_cpu(stderr);
> > - exit(2);
> > + switch (opt)
>
> Nit (style): Missing blanks inside the parentheses.
Will be fixed in v6
>
> Jan
Thanks,
Fouad
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |