add more bootdevices to vmctl

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

add more bootdevices to vmctl

Claudio Jeker
Now that fw_cfg support is in vmd it makes sense to have -B disk
and -B cdrom. Also error out if the option is not known.

This allows to use -B cdrom to force booting from the cdrom disk image
e.g. to update the VM image.
--
:wq Claudio

Index: main.c
===================================================================
RCS file: /cvs/src/usr.sbin/vmctl/main.c,v
retrieving revision 1.50
diff -u -p -r1.50 main.c
--- main.c 6 Dec 2018 09:23:15 -0000 1.50
+++ main.c 8 Dec 2018 06:59:17 -0000
@@ -856,8 +856,14 @@ ctl_start(struct parse_result *res, int
  case 'B':
  if (res->bootdevice)
  errx(1, "boot device specified multiple times");
- if (strcmp("net", optarg) == 0)
+ if (strcmp("disk", optarg) == 0)
+ res->bootdevice = VMBOOTDEV_DISK;
+ else if (strcmp("cdrom", optarg) == 0)
+ res->bootdevice = VMBOOTDEV_CDROM;
+ else if (strcmp("net", optarg) == 0)
  res->bootdevice = VMBOOTDEV_NET;
+ else
+ errx(1, "unknown boot device %s", optarg);
  break;
  case 'r':
  if (res->isopath)

Reply | Threaded
Open this post in threaded view
|

Re: add more bootdevices to vmctl

Reyk Floeter-2
OK reyk@

Please think about the manpage.

> Am 10.12.2018 um 22:35 schrieb Claudio Jeker <[hidden email]>:
>
> Now that fw_cfg support is in vmd it makes sense to have -B disk
> and -B cdrom. Also error out if the option is not known.
>
> This allows to use -B cdrom to force booting from the cdrom disk image
> e.g. to update the VM image.
> --
> :wq Claudio
>
> Index: main.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/vmctl/main.c,v
> retrieving revision 1.50
> diff -u -p -r1.50 main.c
> --- main.c    6 Dec 2018 09:23:15 -0000    1.50
> +++ main.c    8 Dec 2018 06:59:17 -0000
> @@ -856,8 +856,14 @@ ctl_start(struct parse_result *res, int
>        case 'B':
>            if (res->bootdevice)
>                errx(1, "boot device specified multiple times");
> -            if (strcmp("net", optarg) == 0)
> +            if (strcmp("disk", optarg) == 0)
> +                res->bootdevice = VMBOOTDEV_DISK;
> +            else if (strcmp("cdrom", optarg) == 0)
> +                res->bootdevice = VMBOOTDEV_CDROM;
> +            else if (strcmp("net", optarg) == 0)
>                res->bootdevice = VMBOOTDEV_NET;
> +            else
> +                errx(1, "unknown boot device %s", optarg);
>            break;
>        case 'r':
>            if (res->isopath)
>

Reply | Threaded
Open this post in threaded view
|

Re: add more bootdevices to vmctl

Carlos Cardenas
On Mon, Dec 10, 2018 at 10:38:56PM +0100, Reyk Floeter wrote:

> OK reyk@
>
> Please think about the manpage.
>
> > Am 10.12.2018 um 22:35 schrieb Claudio Jeker <[hidden email]>:
> >
> > Now that fw_cfg support is in vmd it makes sense to have -B disk
> > and -B cdrom. Also error out if the option is not known.
> >
> > This allows to use -B cdrom to force booting from the cdrom disk image
> > e.g. to update the VM image.
> > --
> > :wq Claudio

Same comments as reyk@ .

ok ccardenas@ when man page has been updated.

+--+
Carlos

> >
> > Index: main.c
> > ===================================================================
> > RCS file: /cvs/src/usr.sbin/vmctl/main.c,v
> > retrieving revision 1.50
> > diff -u -p -r1.50 main.c
> > --- main.c    6 Dec 2018 09:23:15 -0000    1.50
> > +++ main.c    8 Dec 2018 06:59:17 -0000
> > @@ -856,8 +856,14 @@ ctl_start(struct parse_result *res, int
> >        case 'B':
> >            if (res->bootdevice)
> >                errx(1, "boot device specified multiple times");
> > -            if (strcmp("net", optarg) == 0)
> > +            if (strcmp("disk", optarg) == 0)
> > +                res->bootdevice = VMBOOTDEV_DISK;
> > +            else if (strcmp("cdrom", optarg) == 0)
> > +                res->bootdevice = VMBOOTDEV_CDROM;
> > +            else if (strcmp("net", optarg) == 0)
> >                res->bootdevice = VMBOOTDEV_NET;
> > +            else
> > +                errx(1, "unknown boot device %s", optarg);
> >            break;
> >        case 'r':
> >            if (res->isopath)
> >
>

Reply | Threaded
Open this post in threaded view
|

Re: add more bootdevices to vmctl

Claudio Jeker
On Mon, Dec 10, 2018 at 02:28:48PM -0800, Carlos Cardenas wrote:

> On Mon, Dec 10, 2018 at 10:38:56PM +0100, Reyk Floeter wrote:
> > OK reyk@
> >
> > Please think about the manpage.
> >
> > > Am 10.12.2018 um 22:35 schrieb Claudio Jeker <[hidden email]>:
> > >
> > > Now that fw_cfg support is in vmd it makes sense to have -B disk
> > > and -B cdrom. Also error out if the option is not known.
> > >
> > > This allows to use -B cdrom to force booting from the cdrom disk image
> > > e.g. to update the VM image.
> > > --
> > > :wq Claudio
>
> Same comments as reyk@ .
>
> ok ccardenas@ when man page has been updated.
>

Here the diff with man page update.

--
:wq Claudio

Index: main.c
===================================================================
RCS file: /cvs/src/usr.sbin/vmctl/main.c,v
retrieving revision 1.50
diff -u -p -r1.50 main.c
--- main.c 6 Dec 2018 09:23:15 -0000 1.50
+++ main.c 8 Dec 2018 06:59:17 -0000
@@ -856,8 +856,14 @@ ctl_start(struct parse_result *res, int
  case 'B':
  if (res->bootdevice)
  errx(1, "boot device specified multiple times");
- if (strcmp("net", optarg) == 0)
+ if (strcmp("disk", optarg) == 0)
+ res->bootdevice = VMBOOTDEV_DISK;
+ else if (strcmp("cdrom", optarg) == 0)
+ res->bootdevice = VMBOOTDEV_CDROM;
+ else if (strcmp("net", optarg) == 0)
  res->bootdevice = VMBOOTDEV_NET;
+ else
+ errx(1, "unknown boot device %s", optarg);
  break;
  case 'r':
  if (res->isopath)
Index: vmctl.8
===================================================================
RCS file: /cvs/src/usr.sbin/vmctl/vmctl.8,v
retrieving revision 1.56
diff -u -p -r1.56 vmctl.8
--- vmctl.8 6 Dec 2018 09:23:15 -0000 1.56
+++ vmctl.8 10 Dec 2018 21:59:25 -0000
@@ -160,14 +160,27 @@ Boot the VM with the specified kernel or
 If not specified, the default is to boot using the BIOS image in
 .Pa /etc/firmware/vmm-bios .
 .It Fl B Ar device
-Force system to boot from the specified device for the next boot.
+Force system to boot from the specified device.
 .Ar device
-can be set to
+can be set to:
+.Pp
+.Bl -tag -width "cdrom" -compact
+.It Ar disk
+boot from disk.
+.It Ar cdrom
+boot the CD-ROM image.
+.It Ar net
+perform a PXE boot using the first network interface.
+.El
+Currently
 .Ar net
-to perform a PXE boot using the first network interface.
-Currently only supported when starting the VM with
+is only supported when booting a kernel using the
 .Fl b
-specifying a kernel image.
+flag while
+.Ar disk
+and
+.Ar cdrom
+only work with BIOS images.
 .It Fl c
 Automatically connect to the VM console.
 .It Fl d Ar disk

Reply | Threaded
Open this post in threaded view
|

Re: add more bootdevices to vmctl

Carlos Cardenas
On Mon, Dec 10, 2018 at 11:30:05PM +0100, Claudio Jeker wrote:

> On Mon, Dec 10, 2018 at 02:28:48PM -0800, Carlos Cardenas wrote:
> > On Mon, Dec 10, 2018 at 10:38:56PM +0100, Reyk Floeter wrote:
> > > OK reyk@
> > >
> > > Please think about the manpage.
> > >
> > > > Am 10.12.2018 um 22:35 schrieb Claudio Jeker <[hidden email]>:
> > > >
> > > > Now that fw_cfg support is in vmd it makes sense to have -B disk
> > > > and -B cdrom. Also error out if the option is not known.
> > > >
> > > > This allows to use -B cdrom to force booting from the cdrom disk image
> > > > e.g. to update the VM image.
> > > > --
> > > > :wq Claudio
> >
> > Same comments as reyk@ .
> >
> > ok ccardenas@ when man page has been updated.
> >
>
> Here the diff with man page update.

ok ccardenas@

+--+
Carlos

>
> --
> :wq Claudio
>
> Index: main.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/vmctl/main.c,v
> retrieving revision 1.50
> diff -u -p -r1.50 main.c
> --- main.c 6 Dec 2018 09:23:15 -0000 1.50
> +++ main.c 8 Dec 2018 06:59:17 -0000
> @@ -856,8 +856,14 @@ ctl_start(struct parse_result *res, int
>   case 'B':
>   if (res->bootdevice)
>   errx(1, "boot device specified multiple times");
> - if (strcmp("net", optarg) == 0)
> + if (strcmp("disk", optarg) == 0)
> + res->bootdevice = VMBOOTDEV_DISK;
> + else if (strcmp("cdrom", optarg) == 0)
> + res->bootdevice = VMBOOTDEV_CDROM;
> + else if (strcmp("net", optarg) == 0)
>   res->bootdevice = VMBOOTDEV_NET;
> + else
> + errx(1, "unknown boot device %s", optarg);
>   break;
>   case 'r':
>   if (res->isopath)
> Index: vmctl.8
> ===================================================================
> RCS file: /cvs/src/usr.sbin/vmctl/vmctl.8,v
> retrieving revision 1.56
> diff -u -p -r1.56 vmctl.8
> --- vmctl.8 6 Dec 2018 09:23:15 -0000 1.56
> +++ vmctl.8 10 Dec 2018 21:59:25 -0000
> @@ -160,14 +160,27 @@ Boot the VM with the specified kernel or
>  If not specified, the default is to boot using the BIOS image in
>  .Pa /etc/firmware/vmm-bios .
>  .It Fl B Ar device
> -Force system to boot from the specified device for the next boot.
> +Force system to boot from the specified device.
>  .Ar device
> -can be set to
> +can be set to:
> +.Pp
> +.Bl -tag -width "cdrom" -compact
> +.It Ar disk
> +boot from disk.
> +.It Ar cdrom
> +boot the CD-ROM image.
> +.It Ar net
> +perform a PXE boot using the first network interface.
> +.El
> +Currently
>  .Ar net
> -to perform a PXE boot using the first network interface.
> -Currently only supported when starting the VM with
> +is only supported when booting a kernel using the
>  .Fl b
> -specifying a kernel image.
> +flag while
> +.Ar disk
> +and
> +.Ar cdrom
> +only work with BIOS images.
>  .It Fl c
>  Automatically connect to the VM console.
>  .It Fl d Ar disk

Reply | Threaded
Open this post in threaded view
|

Re: add more bootdevices to vmctl

Mike Larkin
In reply to this post by Claudio Jeker
On Mon, Dec 10, 2018 at 10:35:23PM +0100, Claudio Jeker wrote:
> Now that fw_cfg support is in vmd it makes sense to have -B disk
> and -B cdrom. Also error out if the option is not known.
>
> This allows to use -B cdrom to force booting from the cdrom disk image
> e.g. to update the VM image.
> --
> :wq Claudio
>

I think you received sufficient oks, but ok mlarkin@ nonetheless.

-ml

> Index: main.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/vmctl/main.c,v
> retrieving revision 1.50
> diff -u -p -r1.50 main.c
> --- main.c 6 Dec 2018 09:23:15 -0000 1.50
> +++ main.c 8 Dec 2018 06:59:17 -0000
> @@ -856,8 +856,14 @@ ctl_start(struct parse_result *res, int
>   case 'B':
>   if (res->bootdevice)
>   errx(1, "boot device specified multiple times");
> - if (strcmp("net", optarg) == 0)
> + if (strcmp("disk", optarg) == 0)
> + res->bootdevice = VMBOOTDEV_DISK;
> + else if (strcmp("cdrom", optarg) == 0)
> + res->bootdevice = VMBOOTDEV_CDROM;
> + else if (strcmp("net", optarg) == 0)
>   res->bootdevice = VMBOOTDEV_NET;
> + else
> + errx(1, "unknown boot device %s", optarg);
>   break;
>   case 'r':
>   if (res->isopath)
>