Missed removing some memory scaling in vmm, vmctl.
authordv <dv@openbsd.org>
Wed, 4 May 2022 02:24:26 +0000 (02:24 +0000)
committerdv <dv@openbsd.org>
Wed, 4 May 2022 02:24:26 +0000 (02:24 +0000)
Continuation of commitid RbITgDkOsW8SMssz removing use of megabytes
instead of bytes in vmm(4) and vmctl(8). Missed this spot that only
manifests after a vm is started and has its runtime details
inspected.

sys/arch/amd64/amd64/vmm.c
usr.sbin/vmctl/vmctl.c

index d218407..090feb6 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: vmm.c,v 1.307 2022/05/03 21:39:18 dv Exp $    */
+/*     $OpenBSD: vmm.c,v 1.308 2022/05/04 02:24:26 dv Exp $    */
 /*
  * Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
  *
@@ -1635,7 +1635,6 @@ vm_create_check_mem_ranges(struct vm_create_params *vcp)
 
        if (memsize % (1024 * 1024) != 0)
                return (0);
-       memsize /= 1024 * 1024;
        return (memsize);
 }
 
index b1977f9..9cda15b 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: vmctl.c,v 1.80 2022/05/03 21:39:18 dv Exp $   */
+/*     $OpenBSD: vmctl.c,v 1.81 2022/05/04 02:24:26 dv Exp $   */
 
 /*
  * Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
@@ -793,8 +793,7 @@ print_vm_info(struct vmop_info_result *list, size_t ct)
                        (void)strlcpy(curmem, "-", sizeof(curmem));
                        (void)strlcpy(maxmem, "-", sizeof(maxmem));
 
-                       (void)fmt_scaled(vir->vir_memory_size * 1024 * 1024,
-                           maxmem);
+                       (void)fmt_scaled(vir->vir_memory_size, maxmem);
 
                        if (running) {
                                if (*vmi->vir_ttyname == '\0')