add -v flag in order to easily spot running version.
Signed-off-by: António Meireles <antonio.meireles@reformi.st>
This commit is contained in:
parent
84868be7a6
commit
f75ae77b0f
2 changed files with 21 additions and 3 deletions
4
Makefile
4
Makefile
|
@ -1,3 +1,5 @@
|
|||
GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags)
|
||||
|
||||
ifeq ($V, 1)
|
||||
VERBOSE =
|
||||
else
|
||||
|
@ -72,6 +74,8 @@ OBJ := $(SRC:src/%.c=build/%.o)
|
|||
DEP := $(OBJ:%.o=%.d)
|
||||
INC := -Iinclude
|
||||
|
||||
CFLAGS += -DVERSION=\"$(GIT_VERSION)\"
|
||||
|
||||
TARGET = build/xhyve
|
||||
|
||||
all: $(TARGET) | build
|
||||
|
|
20
src/xhyve.c
20
src/xhyve.c
|
@ -112,7 +112,7 @@ static struct bhyvestats {
|
|||
#pragma clang diagnostic ignored "-Wpadded"
|
||||
static struct mt_vmm_info {
|
||||
pthread_t mt_thr;
|
||||
int mt_vcpu;
|
||||
int mt_vcpu;
|
||||
} mt_vmm_info[VM_MAXCPU];
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
|
@ -138,6 +138,7 @@ usage(int code)
|
|||
" -s: <slot,driver,configinfo> PCI slot config\n"
|
||||
" -u: RTC keeps UTC time\n"
|
||||
" -U: uuid\n"
|
||||
" -v: show build version\n"
|
||||
" -w: ignore unimplemented MSRs\n"
|
||||
" -W: force virtio to use single-vector MSI\n"
|
||||
" -x: local apic is in x2APIC mode\n"
|
||||
|
@ -147,6 +148,17 @@ usage(int code)
|
|||
exit(code);
|
||||
}
|
||||
|
||||
__attribute__ ((noreturn)) static void
|
||||
show_version()
|
||||
{
|
||||
fprintf(stderr, "%s: %s\n\n%s\n",progname, VERSION,
|
||||
"xhyve is a port of FreeBSD's bhyve hypervisor to OS X that\n"
|
||||
"works entirely in userspace and has no other dependencies.\n\n"
|
||||
"Homepage: https://github.com/mist64/xhyve\n"
|
||||
"License: BSD\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
void
|
||||
xh_vm_inject_fault(int vcpu, int vector, int errcode_valid,
|
||||
uint32_t errcode)
|
||||
|
@ -765,7 +777,7 @@ main(int argc, char *argv[])
|
|||
rtc_localtime = 1;
|
||||
fw = 0;
|
||||
|
||||
while ((c = getopt(argc, argv, "behuwxACHPWY:f:g:c:s:m:l:U:")) != -1) {
|
||||
while ((c = getopt(argc, argv, "behvuwxACHPWY:f:g:c:s:m:l:U:")) != -1) {
|
||||
switch (c) {
|
||||
case 'A':
|
||||
acpi = 1;
|
||||
|
@ -832,8 +844,10 @@ main(int argc, char *argv[])
|
|||
case 'Y':
|
||||
mptgen = 0;
|
||||
break;
|
||||
case 'v':
|
||||
show_version();
|
||||
case 'h':
|
||||
usage(0);
|
||||
usage(0);
|
||||
default:
|
||||
usage(1);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue