OpenBSD CVS

CVS log for src/usr.sbin/ldomctl/ldomctl.c


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.41 / (download) - annotate - [select for diffs], Thu Aug 10 07:50:45 2023 UTC (10 months ago) by kn
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, HEAD
Changes since 1.40: +3 -3 lines
Diff to previous 1.40 (colored)

Make stopped ldom utilization appear as zero

ldomctl(8) 'status' updated the value only on running guests,
i.e. stopped ones repeated the last ones instead of showing zero.

Always reset per guest before updating it, From Koakuma, thanks!

Revision 1.40 / (download) - annotate - [select for diffs], Sun Oct 24 21:24:18 2021 UTC (2 years, 7 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.39: +2 -2 lines
Diff to previous 1.39 (colored)

For open/openat, if the flags parameter does not contain O_CREAT, the
3rd (variadic) mode_t parameter is irrelevant.  Many developers in the past
have passed mode_t (0, 044, 0644, or such), which might lead future people
to copy this broken idiom, and perhaps even believe this parameter has some
meaning or implication or application. Delete them all.
This comes out of a conversation where tb@ noticed that a strange (but
intentional) pledge behaviour is to always knock-out high-bits from
mode_t on a number of system calls as a safety factor, and his bewilderment
that this appeared to be happening against valid modes (at least visually),
but no sorry, they are all irrelevant junk.  They could all be 0xdeafbeef.
ok millert

Revision 1.39 / (download) - annotate - [select for diffs], Sat Jan 30 19:34:13 2021 UTC (3 years, 4 months ago) by kn
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.38: +1 -2 lines
Diff to previous 1.38 (colored)

Remove duplicate hvmd decleration

Already declared "extern" in ldomctl.h;  required for "-fno-common".
OK kettenis

Revision 1.38 / (download) - annotate - [select for diffs], Sun Feb 2 00:49:06 2020 UTC (4 years, 4 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.37: +3 -1 lines
Diff to previous 1.37 (colored)

Fix MD in "ldomctl dump"

Commit below merged duplicate code into hv_config() but forgot to call the
helper function from dump().

Noticed by "ldomctl dump" returning zero, dumping both MD and PRI but
leaving the former empty, sorry.


revision 1.32
date: 2020/01/03 19:45:51;  author: kn;  state: Exp;  lines: +69 -46;
Move code into new hv_config(), defer to commands needing it

Revision 1.37 / (download) - annotate - [select for diffs], Fri Jan 17 22:49:54 2020 UTC (4 years, 4 months ago) by kn
Branch: MAIN
Changes since 1.36: +24 -5 lines
Diff to previous 1.36 (colored)

Implement "panic -c" just like "start -c"

Requested by Andrew Grillet

OK kettenis

Revision 1.36 / (download) - annotate - [select for diffs], Fri Jan 17 10:50:20 2020 UTC (4 years, 4 months ago) by kn
Branch: MAIN
Changes since 1.35: +2 -2 lines
Diff to previous 1.35 (colored)

Fix usage: domain is not optional with start command

Missed in previous commit

Revision 1.35 / (download) - annotate - [select for diffs], Thu Jan 16 14:55:19 2020 UTC (4 years, 4 months ago) by kn
Branch: MAIN
Changes since 1.34: +49 -19 lines
Diff to previous 1.34 (colored)

Implement "start -c" to automatically connect to the console

Just like amd64 vmctl(8).

Manual feedback schwarze
OK kettenis

Revision 1.34 / (download) - annotate - [select for diffs], Sat Jan 4 17:30:41 2020 UTC (4 years, 5 months ago) by kn
Branch: MAIN
Changes since 1.33: +3 -3 lines
Diff to previous 1.33 (colored)

Zap unneeded gid check

Since the domain name is mandatory for "ldomctl console ...",
gid is always set and guaranteed to be greater than zero.

OK kettenis

Revision 1.33 / (download) - annotate - [select for diffs], Sat Jan 4 15:45:46 2020 UTC (4 years, 5 months ago) by kn
Branch: MAIN
Changes since 1.32: +20 -5 lines
Diff to previous 1.32 (colored)

Add -n to init-system for validation only

"ldomctl init-system -n ldom.conf" only parses the configuration file
and exits;  it is usable as unprivileged user, no devices are opened.

OK kettenis

Revision 1.32 / (download) - annotate - [select for diffs], Fri Jan 3 19:45:51 2020 UTC (4 years, 5 months ago) by kn
Branch: MAIN
Changes since 1.31: +69 -46 lines
Diff to previous 1.31 (colored)

Move code into new hv_config(), defer to commands needing it

This moves setup code from main() into its own function so instead of
upfront it can be used only when and where needed.

With the exception of `create-vdisk' all currently open /dev/hvctl;  for
that command I added a rather quirky goto to avoid this unneeded step,
but `list-io' for example does not need /dev/hvctl at all either.

So instead of adding more quirks, split as per above and clearly call
hv_config() from the commands that *do* require it.

This also effectively defers such privileged operations after all argv[]
parsing is done, that is the code fails earlier on invalid input without
file I/O for nothing.

With that in, I can easily add more commands not requiring hvctl access,
e.g. a dry-run configuration check.

OK kettenis

Revision 1.31 / (download) - annotate - [select for diffs], Sat Dec 28 18:36:02 2019 UTC (4 years, 5 months ago) by kn
Branch: MAIN
Changes since 1.30: +3 -2 lines
Diff to previous 1.30 (colored)

Run cu(1) in restricted mode

Users must not not be able to transfer files from the local hypervisor
filesystem to VMs/LDOMs, especially since the "vmctl/ldomctl console ..."
might be run as root.

Disable all relevant escape sequences and cause cu to run under "stdio tty"
pledge by using -r.

OK deraadt mlarkin

Revision 1.30 / (download) - annotate - [select for diffs], Sat Dec 28 06:58:27 2019 UTC (4 years, 5 months ago) by tb
Branch: MAIN
Changes since 1.29: +2 -2 lines
Diff to previous 1.29 (colored)

The last argument of execl(3) should be cast explicitly.

ok kn

Revision 1.29 / (download) - annotate - [select for diffs], Tue Dec 10 11:56:33 2019 UTC (4 years, 6 months ago) by kn
Branch: MAIN
Changes since 1.28: +9 -13 lines
Diff to previous 1.28 (colored)

Print started and stopped domains alike

"looks better" deraadt
Ok kettenis

Revision 1.28 / (download) - annotate - [select for diffs], Sat Nov 30 03:30:29 2019 UTC (4 years, 6 months ago) by kn
Branch: MAIN
Changes since 1.27: +53 -1 lines
Diff to previous 1.27 (colored)

Add create-vdisk command

Analogue to amd64's vmctl create, this command creates sparse disk image
files of the given size.

This is less error prone than creating full files with dd(1), but comes
with other caveats - still, it is worth having around.

Further refinements yet to come;  vmctl and ldomctl should also behave more
alike in the future, as briefly discussed with kettenis and deraadt.

Revision 1.27 / (download) - annotate - [select for diffs], Thu Nov 28 18:40:42 2019 UTC (4 years, 6 months ago) by kn
Branch: MAIN
Changes since 1.26: +2 -2 lines
Diff to previous 1.26 (colored)

Use scan_scaled(3) for memory in ldom.conf

Replace the hand-written routing with a proper library allowing even more
formats.

Since ldomctl's local util.h conflicts with the now used global util.h from
libutil, rename it to ldom_util.h.

Manual wording from amd64's vm.conf(5).

OK kettenis

Revision 1.26 / (download) - annotate - [select for diffs], Thu Nov 28 18:03:33 2019 UTC (4 years, 6 months ago) by kn
Branch: MAIN
Changes since 1.25: +31 -3 lines
Diff to previous 1.25 (colored)

Add console command

"ldomctl console guest01" executes cu(1) on the domain's console.
Now more device minor guessing or copying;  behaviour is completely analogue
to vmctl(8) on amd64.

OK kettenis

Revision 1.25 / (download) - annotate - [select for diffs], Thu Nov 28 17:51:55 2019 UTC (4 years, 6 months ago) by kn
Branch: MAIN
Changes since 1.24: +14 -6 lines
Diff to previous 1.24 (colored)

Print guest domain vcctty(4) devices in status output

The virtual console concentrator port's minor had to be infered from the
guest's internal ID which corresponds to the order of listing.

To lift this implementation detail, simply print the device ready to copy
and use with cu(1).

OK kettenis

Revision 1.24 / (download) - annotate - [select for diffs], Thu Nov 28 04:29:39 2019 UTC (4 years, 6 months ago) by kn
Branch: MAIN
Changes since 1.23: +10 -7 lines
Diff to previous 1.23 (colored)

Usage on excessive select, delete, download, start, stop, panic arguments

Revision 1.23 / (download) - annotate - [select for diffs], Wed Nov 27 19:54:10 2019 UTC (4 years, 6 months ago) by kn
Branch: MAIN
Changes since 1.22: +13 -2 lines
Diff to previous 1.22 (colored)

Add list-io command

list-io lists available PCIe devices to be used with ldom.conf(5)'s
iodevice parameter.

OK kettenis

Revision 1.22 / (download) - annotate - [select for diffs], Mon Jul 15 11:05:10 2019 UTC (4 years, 10 months ago) by kn
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.21: +6 -5 lines
Diff to previous 1.21 (colored)

Fix usage

List all available commands grouped by their synopsis to complete the
shown usage while still keeping it compact and precise.

Input from deraadt schwarze
OK kettenis

Revision 1.21 / (download) - annotate - [select for diffs], Sat Sep 15 13:20:16 2018 UTC (5 years, 8 months ago) by kettenis
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.20: +5 -5 lines
Diff to previous 1.20 (colored)

Add support for version 2.0 of the mdstore protocol.

Revision 1.20 / (download) - annotate - [select for diffs], Thu Oct 9 02:44:55 2014 UTC (9 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9, OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.19: +2 -2 lines
Diff to previous 1.19 (colored)

indent

Revision 1.19 / (download) - annotate - [select for diffs], Sun Dec 9 20:24:53 2012 UTC (11 years, 6 months ago) by kettenis
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.18: +30 -2 lines
Diff to previous 1.18 (colored)

Implement panic command.

Revision 1.18 / (download) - annotate - [select for diffs], Wed Nov 28 11:17:23 2012 UTC (11 years, 6 months ago) by kettenis
Branch: MAIN
Changes since 1.17: +4 -1 lines
Diff to previous 1.17 (colored)

Prevent people from shooting themselves in the foot by not allowing them to
delete the factory-default configuration.

Revision 1.17 / (download) - annotate - [select for diffs], Sat Nov 24 17:04:03 2012 UTC (11 years, 6 months ago) by kettenis
Branch: MAIN
Changes since 1.16: +6 -1 lines
Diff to previous 1.16 (colored)

Get rid of some hard-coded constants.  Improve memory allocation code.

Revision 1.16 / (download) - annotate - [select for diffs], Sat Nov 24 11:50:45 2012 UTC (11 years, 6 months ago) by kettenis
Branch: MAIN
Changes since 1.15: +18 -7 lines
Diff to previous 1.15 (colored)

Add code to create new system configuration.  Work in progress, but there's
enough functionality to create a configuration for a t1k or t2k running
System Firmware 6.7.x.

Revision 1.15 / (download) - annotate - [select for diffs], Mon Nov 5 19:50:54 2012 UTC (11 years, 7 months ago) by kettenis
Branch: MAIN
Changes since 1.14: +3 -15 lines
Diff to previous 1.14 (colored)

Better code to download configurations onto the SP.

Revision 1.14 / (download) - annotate - [select for diffs], Sun Nov 4 23:30:38 2012 UTC (11 years, 7 months ago) by kettenis
Branch: MAIN
Changes since 1.13: +39 -1 lines
Diff to previous 1.13 (colored)

A bit more SP configuration code.

Revision 1.13 / (download) - annotate - [select for diffs], Sun Nov 4 21:44:20 2012 UTC (11 years, 7 months ago) by kettenis
Branch: MAIN
Changes since 1.12: +19 -1 lines
Diff to previous 1.12 (colored)

Add support for selecting a configuration stored on the SP.

Revision 1.12 / (download) - annotate - [select for diffs], Sun Nov 4 20:09:02 2012 UTC (11 years, 7 months ago) by kettenis
Branch: MAIN
Changes since 1.11: +25 -1 lines
Diff to previous 1.11 (colored)

Support for listing configurations store on the SP.

Revision 1.11 / (download) - annotate - [select for diffs], Sun Nov 4 18:59:02 2012 UTC (11 years, 7 months ago) by kettenis
Branch: MAIN
Changes since 1.10: +8 -46 lines
Diff to previous 1.10 (colored)

Switch over to using the ds.[ch] from ldomd(8).

Revision 1.10 / (download) - annotate - [select for diffs], Sun Nov 4 18:14:09 2012 UTC (11 years, 7 months ago) by kettenis
Branch: MAIN
Changes since 1.9: +93 -165 lines
Diff to previous 1.9 (colored)

Factor out some code.  Use the "hvctl.h" header from ldomd.  Add man page.

Revision 1.9 / (download) - annotate - [select for diffs], Sat Oct 27 18:21:00 2012 UTC (11 years, 7 months ago) by kettenis
Branch: MAIN
Changes since 1.8: +3 -1 lines
Diff to previous 1.8 (colored)

Don't accidentally free memory that we plan to use later!

Revision 1.8 / (download) - annotate - [select for diffs], Sun Oct 21 12:56:45 2012 UTC (11 years, 7 months ago) by kettenis
Branch: MAIN
Changes since 1.7: +2 -3 lines
Diff to previous 1.7 (colored)

Split out some general-purpose functions and macros into their own file.

Revision 1.7 / (download) - annotate - [select for diffs], Sun Oct 21 12:47:58 2012 UTC (11 years, 7 months ago) by kettenis
Branch: MAIN
Changes since 1.6: +100 -33 lines
Diff to previous 1.6 (colored)

Add domain services support code and use it to fetch the PRI
(Physical Resource Inventory) from the service processor.

Revision 1.6 / (download) - annotate - [select for diffs], Sat Oct 20 16:44:16 2012 UTC (11 years, 7 months ago) by kettenis
Branch: MAIN
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored)

Fix previous.

Revision 1.5 / (download) - annotate - [select for diffs], Sat Oct 20 13:05:54 2012 UTC (11 years, 7 months ago) by kettenis
Branch: MAIN
Changes since 1.4: +70 -9 lines
Diff to previous 1.4 (colored)

Add code to dump the current hypervisor configuration.

Revision 1.4 / (download) - annotate - [select for diffs], Tue Oct 16 19:57:23 2012 UTC (11 years, 7 months ago) by kettenis
Branch: MAIN
Changes since 1.3: +74 -14 lines
Diff to previous 1.3 (colored)

Add domain utilisation to status display.

Revision 1.3 / (download) - annotate - [select for diffs], Mon Oct 15 20:28:50 2012 UTC (11 years, 7 months ago) by kettenis
Branch: MAIN
Changes since 1.2: +183 -51 lines
Diff to previous 1.2 (colored)

Specify domains by name instead of by number.
Provide status of all domains if none specified.

Revision 1.2 / (download) - annotate - [select for diffs], Sun Oct 14 16:11:45 2012 UTC (11 years, 7 months ago) by kettenis
Branch: MAIN
Changes since 1.1: +90 -2 lines
Diff to previous 1.1 (colored)

Add status command.

Revision 1.1 / (download) - annotate - [select for diffs], Sun Oct 14 15:38:06 2012 UTC (11 years, 7 months ago) by kettenis
Branch: MAIN

Beginning of a tool to control sun4v logical domains.  For now this can start
and stop domains.

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.