mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43:56 -06:00
hw/xen: Use the IEC binary prefix definitions
It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alan Robinson <Alan.Robinson@ts.fujitsu.com> Message-Id: <20180625124238.25339-12-f4bug@amsat.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
968dfd0516
commit
8f951a13f0
3 changed files with 11 additions and 8 deletions
|
@ -1,4 +1,5 @@
|
|||
#include "qemu/osdep.h"
|
||||
#include "qemu/units.h"
|
||||
#include "hw/xen/xen_backend.h"
|
||||
#include "xen_domainbuild.h"
|
||||
#include "qemu/timer.h"
|
||||
|
@ -75,9 +76,9 @@ int xenstore_domain_init1(const char *kernel, const char *ramdisk,
|
|||
xenstore_write_str(dom, "vm", vm);
|
||||
|
||||
/* memory */
|
||||
xenstore_write_int(dom, "memory/target", ram_size >> 10); // kB
|
||||
xenstore_write_int(vm, "memory", ram_size >> 20); // MB
|
||||
xenstore_write_int(vm, "maxmem", ram_size >> 20); // MB
|
||||
xenstore_write_int(dom, "memory/target", ram_size / KiB);
|
||||
xenstore_write_int(vm, "memory", ram_size / MiB);
|
||||
xenstore_write_int(vm, "maxmem", ram_size / MiB);
|
||||
|
||||
/* cpus */
|
||||
for (i = 0; i < smp_cpus; i++) {
|
||||
|
@ -113,7 +114,7 @@ int xenstore_domain_init2(int xenstore_port, int xenstore_mfn,
|
|||
|
||||
/* console */
|
||||
xenstore_write_str(dom, "console/type", "ioemu");
|
||||
xenstore_write_int(dom, "console/limit", 128 * 1024);
|
||||
xenstore_write_int(dom, "console/limit", 128 * KiB);
|
||||
xenstore_write_int(dom, "console/ring-ref", console_mfn);
|
||||
xenstore_write_int(dom, "console/port", console_port);
|
||||
xen_config_dev_console(0);
|
||||
|
@ -260,7 +261,7 @@ int xen_domain_build_pv(const char *kernel, const char *ramdisk,
|
|||
}
|
||||
#endif
|
||||
|
||||
rc = xc_domain_setmaxmem(xen_xc, xen_domid, ram_size >> 10);
|
||||
rc = xc_domain_setmaxmem(xen_xc, xen_domid, ram_size / KiB);
|
||||
if (rc < 0) {
|
||||
fprintf(stderr, "xen: xc_domain_setmaxmem() failed\n");
|
||||
goto err;
|
||||
|
@ -269,7 +270,7 @@ int xen_domain_build_pv(const char *kernel, const char *ramdisk,
|
|||
xenstore_port = xc_evtchn_alloc_unbound(xen_xc, xen_domid, 0);
|
||||
console_port = xc_evtchn_alloc_unbound(xen_xc, xen_domid, 0);
|
||||
|
||||
rc = xc_linux_build(xen_xc, xen_domid, ram_size >> 20,
|
||||
rc = xc_linux_build(xen_xc, xen_domid, ram_size / MiB,
|
||||
kernel, ramdisk, cmdline,
|
||||
0, flags,
|
||||
xenstore_port, &xenstore_mfn,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue