diff options
author | Jasper Lievisse Adriaanse <jasper@cvs.openbsd.org> | 2019-05-22 16:19:22 +0000 |
---|---|---|
committer | Jasper Lievisse Adriaanse <jasper@cvs.openbsd.org> | 2019-05-22 16:19:22 +0000 |
commit | 2e0cdd7e7341d4f12421c98ffb59a5d02d4dd48d (patch) | |
tree | d9b575b28171dc2a6530ac95bb52163a75b26c69 /usr.sbin | |
parent | ca4ee8b6b8eaac6c8d7f7da2af2dbe11951eb3ea (diff) |
re-order to reported states based on order of significance:
paused takes priority over running; running takes priority over disabled
ok mlarkin@ pd@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/vmctl/vmctl.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/vmctl/vmctl.c b/usr.sbin/vmctl/vmctl.c index a029875dd6a..60b028b7809 100644 --- a/usr.sbin/vmctl/vmctl.c +++ b/usr.sbin/vmctl/vmctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmctl.c,v 1.68 2019/05/16 06:41:47 jasper Exp $ */ +/* $OpenBSD: vmctl.c,v 1.69 2019/05/22 16:19:21 jasper Exp $ */ /* * Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org> @@ -715,15 +715,15 @@ add_info(struct imsg *imsg, int *ret) const char * vm_state(unsigned int mask) { - /* Presence of absence of other flags */ - if (!mask || (mask & VM_STATE_DISABLED)) - return "stopped"; - else if (mask & VM_STATE_PAUSED) + if (mask & VM_STATE_PAUSED) return "paused"; - else if (mask & VM_STATE_SHUTDOWN) - return "stopping"; else if (mask & VM_STATE_RUNNING) return "running"; + else if (mask & VM_STATE_SHUTDOWN) + return "stopping"; + /* Presence of absence of other flags */ + else if (!mask || (mask & VM_STATE_DISABLED)) + return "stopped"; return "unknown"; } |