From 6ee52c658c5a55e1bc6ca82635a0e87057510b7d Mon Sep 17 00:00:00 2001 From: Roman Bogorodskiy Date: Sun, 26 Jun 2016 14:44:01 +0000 Subject: [PATCH] bhyve: improve memory size documentation A couple of minor memory size option related nits: - use common name 'memsize' (instead of 'max-size' or just 'size') - bhyve: update usage with memsize unit suffix, drop legacy "MB" unit - bhyveload: update usage with memsize unit suffix - bhyve(8): document default size - bhyveload(8): use memsize formatting like it's done in bhyve(8) Reviewed by: wblock, grehan Approved by: re (kib), wblock, grehan Differential Revision: https://reviews.freebsd.org/D6952 --- usr.sbin/bhyve/bhyve.8 | 9 ++++++--- usr.sbin/bhyve/bhyverun.c | 4 ++-- usr.sbin/bhyveload/bhyveload.8 | 19 +++++++------------ usr.sbin/bhyveload/bhyveload.c | 2 +- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 5bd2092a2e31..5c476af2cf90 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 18, 2016 +.Dd June 24, 2016 .Dt BHYVE 8 .Os .Sh NAME @@ -36,7 +36,7 @@ .Op Fl c Ar numcpus .Op Fl g Ar gdbport .Op Fl l Ar lpcdev Ns Op , Ns Ar conf -.Op Fl m Ar size Ns Op Ar K|k|M|m|G|g|T|t +.Op Fl m Ar memsize Ns Op Ar K|k|M|m|G|g|T|t .Op Fl p Ar vcpu:hostcpu .Op Fl s Ar slot,emulation Ns Op , Ns Ar conf .Op Fl U Ar uuid @@ -105,7 +105,7 @@ and .Ar com2 and the boot ROM device .Ar bootrom . -.It Fl m Ar size Ns Op Ar K|k|M|m|G|g|T|t +.It Fl m Ar memsize Ns Op Ar K|k|M|m|G|g|T|t Guest physical memory size in bytes. This must be the same size that was given to .Xr bhyveload 8 . @@ -114,6 +114,9 @@ The size argument may be suffixed with one of K, M, G or T (either upper or lower case) to indicate a multiple of kilobytes, megabytes, gigabytes, or terabytes. If no suffix is given, the value is assumed to be in megabytes. +.Pp +.Ar memsize +defaults to 256M. .It Fl p Ar vcpu:hostcpu Pin guest's virtual CPU .Em vcpu diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index bfa135b16cce..935074861b70 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -125,7 +125,7 @@ usage(int code) fprintf(stderr, "Usage: %s [-abehuwxACHPSWY] [-c vcpus] [-g ] [-l ]\n" - " %*s [-m mem] [-p vcpu:hostcpu] [-s ] [-U uuid] \n" + " %*s [-m memsize[K|k|M|m|G|g|T|t]] [-p vcpu:hostcpu] [-s ] [-U uuid] \n" " -a: local apic is in xAPIC mode (deprecated)\n" " -A: create ACPI tables\n" " -c: # cpus (default 1)\n" @@ -135,7 +135,7 @@ usage(int code) " -h: help\n" " -H: vmexit from the guest on hlt\n" " -l: LPC device configuration\n" - " -m: memory size in MB\n" + " -m: memory size\n" " -p: pin 'vcpu' to 'hostcpu'\n" " -P: vmexit from the guest on pause\n" " -s: PCI slot config\n" diff --git a/usr.sbin/bhyveload/bhyveload.8 b/usr.sbin/bhyveload/bhyveload.8 index b5663435277c..519c16b3cca6 100644 --- a/usr.sbin/bhyveload/bhyveload.8 +++ b/usr.sbin/bhyveload/bhyveload.8 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 26, 2016 +.Dd June 24, 2016 .Dt BHYVELOAD 8 .Os .Sh NAME @@ -42,7 +42,7 @@ guest inside a bhyve virtual machine .Op Fl e Ar name=value .Op Fl h Ar host-path .Op Fl l Ar os-loader -.Op Fl m Ar mem-size +.Op Fl m Ar memsize Ns Op Ar K|k|M|m|G|g|T|t .Ar vmname .Sh DESCRIPTION .Nm @@ -103,16 +103,12 @@ will use which presents a standard .Fx loader. -.It Fl m Ar mem-size Xo -.Sm off -.Op Cm K | k | M | m | G | g | T | t -.Xc -.Sm on -.Ar mem-size +.It Fl m Ar memsize Ns Op Ar K|k|M|m|G|g|T|t +.Ar memsize is the amount of memory allocated to the guest. .Pp The -.Ar mem-size +.Ar memsize argument may be suffixed with one of .Cm K , .Cm M , @@ -123,9 +119,8 @@ or Kilobytes, Megabytes, Gigabytes or Terabytes respectively. .Pp -The default value of -.Ar mem-size -is 256M. +.Ar memsize +defaults to 256M. .It Fl C Include guest memory in the core file when .Nm diff --git a/usr.sbin/bhyveload/bhyveload.c b/usr.sbin/bhyveload/bhyveload.c index 9df680f57121..c67a2f698936 100644 --- a/usr.sbin/bhyveload/bhyveload.c +++ b/usr.sbin/bhyveload/bhyveload.c @@ -648,7 +648,7 @@ usage(void) fprintf(stderr, "usage: %s [-S][-c ] [-d ] [-e ]\n" - " %*s [-h ] [-m mem-size] \n", + " %*s [-h ] [-m memsize[K|k|M|m|G|g|T|t]] \n", progname, (int)strlen(progname), ""); exit(1);