]> git.proxmox.com Git - mirror_qemu.git/commitdiff
bsd-user: Use the IEC binary prefix definitions
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Mon, 25 Jun 2018 12:42:38 +0000 (09:42 -0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 2 Jul 2018 13:41:18 +0000 (15:41 +0200)
It eases code review, unit is explicit.

Patch generated using:

  $ git grep -n '[<>][<>]= ?[1-5]0'

and modified manually.

Suggested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20180625124238.25339-47-f4bug@amsat.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
bsd-user/main.c

index da3b8339756cd49fc2591b8c23f1582d5dc4a698..0d3156974ccd4a3e5c582e968ba86d88716c1828 100644 (file)
@@ -17,6 +17,7 @@
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 #include "qemu/osdep.h"
+#include "qemu/units.h"
 #include "qemu-version.h"
 #include <machine/trap.h>
 
@@ -795,9 +796,9 @@ int main(int argc, char **argv)
             if (x86_stack_size <= 0)
                 usage();
             if (*r == 'M')
-                x86_stack_size *= 1024 * 1024;
+                x86_stack_size *= MiB;
             else if (*r == 'k' || *r == 'K')
-                x86_stack_size *= 1024;
+                x86_stack_size *= KiB;
         } else if (!strcmp(r, "L")) {
             interp_prefix = argv[optind++];
         } else if (!strcmp(r, "p")) {