OpenBSD CVS

CVS log for src/usr.sbin/vmctl/vmctl.h


[BACK] Up to [local] / src / usr.sbin / vmctl

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.38 / (download) - annotate - [select for diffs], Sat May 18 06:45:00 2024 UTC (3 weeks ago) by jsg
Branch: MAIN
CVS Tags: HEAD
Changes since 1.37: +1 -3 lines
Diff to previous 1.37 (colored)

remove prototypes with no matching function

Revision 1.37 / (download) - annotate - [select for diffs], Fri May 13 00:17:20 2022 UTC (2 years ago) by yasuoka
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.36: +2 -2 lines
Diff to previous 1.36 (colored)

Follow the recent change that the unit of `imgsize' argument of
create_imagefile() became MB.  Also change the arguement's type from
long to uint64_t that is preferred.

ok dv

Revision 1.36 / (download) - annotate - [select for diffs], Wed May 4 23:17:25 2022 UTC (2 years, 1 month ago) by dv
Branch: MAIN
Changes since 1.35: +2 -2 lines
Diff to previous 1.35 (colored)

vmctl(8)/vmd(8): convert disk sizes from MB to bytes

Continue converting other parts to storing data in bytes instead
of MB. In this case, the logic for disk sizes was being scaled.

This fixes issues reported by Martin Vahlensieck where vmctl could
no longer create disks larger than 7 MiB after previous commits to
change storing memory sizes as bytes.

While this keeps the vm memory limit check in vmctl's size parser,
it skips the limit check for disks. The error messages adjust
accordingly and this removes the double error message logging.

Update comments and function types accordingly.

ok marlkin@

Revision 1.35 / (download) - annotate - [select for diffs], Tue May 3 21:39:18 2022 UTC (2 years, 1 month ago) by dv
Branch: MAIN
Changes since 1.34: +3 -3 lines
Diff to previous 1.34 (colored)

vmm/vmd/vmctl: standardize memory units to bytes

At different points in the vm lifecycle vmm(4), vmctl(8), and vmd(8)
refer to a vm's memory range sizes in either bytes or megabytes.
This is needlessly complex.

Switch to using bytes everywhere and adjust types and constants
accordingly. While this makes it possible to specify vm's with
memory in fractions of megabytes, the logic requiring whole
megabyte values remains.

Feedback from deraadt@, mlarkin@, and Matthew Martin.

ok mlarkin@

Revision 1.34 / (download) - annotate - [select for diffs], Wed Jan 27 07:21:12 2021 UTC (3 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.33: +2 -2 lines
Diff to previous 1.33 (colored)

split out extern and decl for -fno-common

Revision 1.33 / (download) - annotate - [select for diffs], Tue Dec 17 09:43:00 2019 UTC (4 years, 5 months ago) by kn
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.32: +2 -2 lines
Diff to previous 1.32 (colored)

Use local variable isntead of function parameter

The parse_size() wrapper around scan_scaled(3) writes its intermediate
result to the function argument which is always passed as literal zero.

This seems odd, the function parameter has no meaning but merely serves
as storage, so let's use a proper function scoped variable instead.

OK pd

Revision 1.32 / (download) - annotate - [select for diffs], Sat May 11 23:07:46 2019 UTC (5 years ago) by jasper
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.31: +3 -1 lines
Diff to previous 1.31 (colored)

report vm state through 'vmctl status'; whereas previously this would display the state of
the vcpu (which is why it got removed), it now actually reports the correct state
(running, stopped, disabled, paused, etc)

ok ccardenas@ mlarkin@

Revision 1.31 / (download) - annotate - [select for diffs], Fri May 10 18:11:27 2019 UTC (5 years, 1 month ago) by jasper
Branch: MAIN
Changes since 1.30: +1 -2 lines
Diff to previous 1.30 (colored)

remove receive_vm prototype for the function does not exist (anymore)

ok pd@

Revision 1.30 / (download) - annotate - [select for diffs], Thu Dec 6 09:23:15 2018 UTC (5 years, 6 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.29: +3 -2 lines
Diff to previous 1.29 (colored)

Add a new argument -B device to vmctl start. It allows to set the boot device.
At the moment only 'net' is supported and all other values are silently ignored.
This allows to kick of an OpenBSD autoinstall by using:
	vmctl start "installer" -Lc -B net -b bsd.rd -d disk.img
OK ccardenas@

Revision 1.29 / (download) - annotate - [select for diffs], Tue Dec 4 08:17:17 2018 UTC (5 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.28: +3 -1 lines
Diff to previous 1.28 (colored)

Add 'vmctl wait <VM>' a command that waits until the specified VM is
stopped/terminates. Useful in scripts when waiting until a vm has finished
its work.
Ok ccardenas@, reyk@

Revision 1.28 / (download) - annotate - [select for diffs], Mon Nov 26 10:39:30 2018 UTC (5 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.27: +1 -4 lines
Diff to previous 1.27 (colored)

Move the {qcow2,raw} create functions from vmctl into vmd/vio{qcow2,raw}.c

This way they are in the appropriate place and code can be shared with vmd.

Ok ori@ mlarkin@ ccardenas@

Revision 1.27 / (download) - annotate - [select for diffs], Fri Oct 19 10:12:39 2018 UTC (5 years, 7 months ago) by reyk
Branch: MAIN
Changes since 1.26: +7 -1 lines
Diff to previous 1.26 (colored)

Add support to create and convert disk images from existing images

The -i option to vmctl create (eg. vmctl create output.qcow2 -i input.img)
lets you create a new image from an input file and convert it if it is a
different format.  This allows to convert qcow2 images from raw images,
raw from qcow2, or even qcow2 from qcow2 and raw from raw to re-optimize
the disk.

This re-uses Ori's vioqcow2.c from vmd by reaching into it and
compiling it in.  The API has been adjust to be used from both vmctl
and vmd accordingly.

OK mlarkin@

Revision 1.26 / (download) - annotate - [select for diffs], Mon Oct 8 16:32:01 2018 UTC (5 years, 8 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.25: +2 -2 lines
Diff to previous 1.25 (colored)

Add support for qcow2 base images (external snapshots).

This works is from Ori Bernstein, committing on his behalf:

Add support to vmd for external snapshots. That is, snapshots that are
derived from a base image. Data lookups start in the derived image,
and if the derived image does not contain some data, the search
proceeds ot the base image.  Multiple derived images may exist off of
a single base image.

A limitation of this format is that modifying the base image will
corrupt the derived image.

This change also adds support for creating disk derived disk images to
vmctl.  To use it:

	vmctl create derived.qcow2 -s 16G -b base.qcow2

From Ori Bernstein
OK mlarkin@ reyk@

Revision 1.25 / (download) - annotate - [select for diffs], Mon Oct 1 09:31:15 2018 UTC (5 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored)

Try to derive the qcow2 file format from an image file automatically.

This makes the "-d qcow2:" and "format qcow" arguments optional as vmctl
and vmd will read the magic bytes at the beginning of a file to guess if
it is a raw or a qcow image file.

The "vmctl create" command has been changed by removing the -f qcow2 option
and replacing it with the same syntax as -d: "vmctl create qcow2:foo.img".
In a slightly ununixy but intended way, the create command now also
considers the file extension for the format as "vmctl create foo.qcow2"
creates a qcow2 disk and not a raw image file.

Ok mlarkin@ (and ccardenas@ on an earlier version of the diff)

Revision 1.24 / (download) - annotate - [select for diffs], Thu Sep 27 17:15:36 2018 UTC (5 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.23: +4 -2 lines
Diff to previous 1.23 (colored)

Add vmctl stop -a [-fw] option to stop or terminate all running VMs.

This is also be used to simplify the vmd rc stop script.

OK mlarkin@ ccardenas@

Revision 1.23 / (download) - annotate - [select for diffs], Tue Sep 11 04:03:16 2018 UTC (5 years, 8 months ago) by ccardenas
Branch: MAIN
Changes since 1.22: +3 -2 lines
Diff to previous 1.22 (colored)

Add ability to create qcow2 disk.

vmctl create now takes an optional disk format parameter: raw or qcow2.
If format is omitted, raw is used.

Many thanks to Ori Bernstein.

Revision 1.22 / (download) - annotate - [select for diffs], Sun Sep 9 04:09:32 2018 UTC (5 years, 9 months ago) by ccardenas
Branch: MAIN
Changes since 1.21: +5 -3 lines
Diff to previous 1.21 (colored)

Add initial qcow2 image support.

Users are able to declare disk images as 'raw' or 'qcow2' using either
vmctl and vm.conf.  The default disk image format is 'raw' if not specified.

Examples of using disk format:

vmctl start bsd -Lc -r cd64.iso -d qcow2:current.qc2
or
vmctl start bsd -Lc -r cd64.iso -d raw:current.raw
is equivalent to
vmctl start bsd -Lc -r cd64.iso -d current.raw

in vm.conf
vm "current" {
    disable
    memory 2G
    disk "/home/user/vmm/current.qc2" format "qcow2"
    interface { switch "external" }
}

or

vm "current" {
    disable
    memory 2G
    disk "/home/user/vmm/current.raw" format "raw"
    interface { switch "external" }
}

is equivlanet to

vm "current" {
    disable
    memory 2G
    disk "/home/user/vmm/current.raw"
    interface { switch "external" }
}

Tested by many.

Big Thanks to Ori Bernstein.

Revision 1.21 / (download) - annotate - [select for diffs], Thu Jul 12 12:04:49 2018 UTC (5 years, 10 months ago) by reyk
Branch: MAIN
Changes since 1.20: +4 -2 lines
Diff to previous 1.20 (colored)

Allow to use configured/running VMs as templates for other VM instances.

This introduces new grammar and the -t optional in vmctl start.

(For now, only root can create VM instances; but it is planned to allow
users to create their own VMs based on permissions and quota.)

OK ccardenas@ mlarkin@ jmc@

Revision 1.20 / (download) - annotate - [select for diffs], Wed Jul 11 13:19:47 2018 UTC (5 years, 10 months ago) by reyk
Branch: MAIN
Changes since 1.19: +4 -5 lines
Diff to previous 1.19 (colored)

Add -w option to vmctl stop to wait for completion of VM termination.

Use it in /etc/rc.d/vmd accordingly.

OK sthen@

Revision 1.19 / (download) - annotate - [select for diffs], Wed Jul 11 09:35:44 2018 UTC (5 years, 10 months ago) by reyk
Branch: MAIN
Changes since 1.18: +3 -2 lines
Diff to previous 1.18 (colored)

Add -f option to vmctl stop to forcefully kill a VM.

This also fixes a bug in vmm_sighdlr where it might have missed
forwarding the TERMINATE_EVENT to the vmd parent after a VM child
died, leading to an abandoned VM in the vmd parent process.

OK ccardenas@ mlarkin@ benno@ kn@

Revision 1.18 / (download) - annotate - [select for diffs], Wed Jan 3 05:39:56 2018 UTC (6 years, 5 months ago) by ccardenas
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.17: +3 -2 lines
Diff to previous 1.17 (colored)

Add initial CD-ROM support to VMD via vioscsi.

* Adds 'cdrom' keyword to vm.conf(5) and '-r' to vmctl(8)
* Support various sized ISOs (Limitation of 4G ISOs on Linux guests)
* Known working guests: OpenBSD (primary), Alpine Linux (primary),
  CentOS 6 (secondary), Ubuntu 17.10 (secondary).
  NOTE: Secondary indicates some issue(s) preventing full/reliable
  functionality outside the scope of the vioscsi work.
* If the attached disks are non-bootable (i.e. empty), SeaBIOS (vmd's
  default BIOS) will boot from CD-ROM.

ok mlarkin@, jca@

Revision 1.17 / (download) - annotate - [select for diffs], Tue Aug 15 15:51:54 2017 UTC (6 years, 9 months ago) by jasper
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.16: +2 -3 lines
Diff to previous 1.16 (colored)

merge parse_vmid() and parse_vmname()

ok mlarkin@ pd@

Revision 1.16 / (download) - annotate - [select for diffs], Sat Jul 15 05:05:36 2017 UTC (6 years, 10 months ago) by pd
Branch: MAIN
Changes since 1.15: +7 -1 lines
Diff to previous 1.15 (colored)

Add vmctl send and vmctl receive

ok reyk@ and mlarkin@

Revision 1.15 / (download) - annotate - [select for diffs], Sun Jul 9 00:51:40 2017 UTC (6 years, 11 months ago) by pd
Branch: MAIN
Changes since 1.14: +7 -1 lines
Diff to previous 1.14 (colored)

vmd/vmctl: Add ability to pause / unpause vms

With help from Ashwin Agrawal

ok reyk@ mlarkin@

Revision 1.14 / (download) - annotate - [select for diffs], Thu Apr 6 18:07:13 2017 UTC (7 years, 2 months ago) by reyk
Branch: MAIN
Changes since 1.13: +3 -2 lines
Diff to previous 1.13 (colored)

Do not expose vmm(4) VM IDs to the user, use vmd(8)'s IDs instead.

Each VM has two IDs: one from the kernel (vmm) and a different one
from userland (vmd).  The vmm ID is not consistent and incremented on
every boot during runtimg of the host system.  The vmd ID remains the
same during the lifetime of a configured VM, even after reboots.
Configured VMs will even get and keep their IDs when the configuration
is loaded.  This is more what users expect.

Pointed out and tested by otto@

OK deraadt@

Revision 1.13 / (download) - annotate - [select for diffs], Wed Mar 1 21:22:57 2017 UTC (7 years, 3 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.12: +2 -2 lines
Diff to previous 1.12 (colored)

Rename start_vm_complete to vm_start_complete for consistency.

Revision 1.12 / (download) - annotate - [select for diffs], Wed Mar 1 21:15:26 2017 UTC (7 years, 3 months ago) by mlarkin
Branch: MAIN
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored)

unbreak vmctl build by renaming a function that now conflicts with
something from vmd.h . Temporary fix until the original committer can
fix it the way he desires.

Revision 1.11 / (download) - annotate - [select for diffs], Wed Jan 11 22:38:10 2017 UTC (7 years, 4 months ago) by reyk
Branch: MAIN
Changes since 1.10: +3 -1 lines
Diff to previous 1.10 (colored)

Add imsg communication channel between vmd and invividual VMs.
For now, this is only used to forward "log verbose|brief" requests,
but it will be used for better things later.

OK mlarkin@

Revision 1.10 / (download) - annotate - [select for diffs], Sat Nov 26 18:37:32 2016 UTC (7 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.9: +5 -2 lines
Diff to previous 1.9 (colored)

Add the vmctl start -n option to specify add a network interface to
the specified virtual switch from the command line.

OK mlarkin@

Revision 1.9 / (download) - annotate - [select for diffs], Wed Oct 12 19:10:03 2016 UTC (7 years, 7 months ago) by reyk
Branch: MAIN
Changes since 1.8: +3 -1 lines
Diff to previous 1.8 (colored)

Fix functionality and semantics of vmctl load/reload/reset.

OK rzalamena@

Revision 1.8 / (download) - annotate - [select for diffs], Sat Sep 3 20:49:05 2016 UTC (7 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.7: +1 -4 lines
Diff to previous 1.7 (colored)

Some .h files are not needed

Revision 1.7 / (download) - annotate - [select for diffs], Fri Dec 11 10:16:53 2015 UTC (8 years, 5 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.6: +4 -3 lines
Diff to previous 1.6 (colored)

The vmctl "id" argument can now be a number of or a vm name, eg.
vmctl stop 3
vmctl stop "openbsd.vm"

Revision 1.6 / (download) - annotate - [select for diffs], Fri Dec 11 09:24:10 2015 UTC (8 years, 5 months ago) by reyk
Branch: MAIN
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored)

Remove unused argument in parse_vmid()

Revision 1.5 / (download) - annotate - [select for diffs], Tue Dec 8 08:01:20 2015 UTC (8 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.4: +7 -2 lines
Diff to previous 1.4 (colored)

Add "vmctl console" to connect to a specified VM console by id.

Requested by mlarkin@

Revision 1.4 / (download) - annotate - [select for diffs], Sun Dec 6 02:26:14 2015 UTC (8 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 (colored)

Print the TTY in the vmctl status output.

Revision 1.3 / (download) - annotate - [select for diffs], Fri Dec 4 15:40:17 2015 UTC (8 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.2: +4 -2 lines
Diff to previous 1.2 (colored)

Add -c option to "vmctl start" to automatically connect to the VM
console after startup.  This calls 'cu -l $TTY -s 9600' internally -
a "safe mode" for cu is proposed by tedu@.

Requested by mlarkin@
OK tedu@ on the execl/cu chunk

Revision 1.2 / (download) - annotate - [select for diffs], Thu Dec 3 23:32:32 2015 UTC (8 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.1: +2 -1 lines
Diff to previous 1.1 (colored)

Re-add the "load" and "reload" commands to vmctl: Instead of parsing
the configuration in vmctl directly, it now sends a (re)load request
to vmd.  The reload also resets the existing configuration status -
this doesn't do much difference yet but a future change will compare
if a specified VM is already running.  "load" will allow to add
configuration, while "reload" resets the state before loading.

Revision 1.1 / (download) - annotate - [select for diffs], Thu Dec 3 21:45:45 2015 UTC (8 years, 6 months ago) by reyk
Branch: MAIN

Replace vmmctl with vmctl.  Also remove parse.y from the "new" vmctl.

As discussed with mlarkin@ and deraadt@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.