aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbohu <bohu@google.com>2016-12-28 15:53:22 -0800
committerbohu <bohu@google.com>2017-01-03 08:54:27 -0800
commitb0006589725ddc11265f1f076d9f57a320672604 (patch)
tree7c59830b7a07936a5928ebad71b03433a39bcc9a
parent83e56f2c68222939572244acaae53d269e3559c4 (diff)
downloadqemu-android-emu-2.2-release.tar.gz
Qemu2: OSX: fix bogus cores number when hw.cpu.ncore is missing from config.iniemu-2.2-release
The StringFormat is used to convert interger to "cores=<number>", however, when calling this method, we pass the "%ld" instead of "%d" for the case of hw_cpu_ncore (of type int), as a result, we get -smp cores=8796093022210 (0x80000000002), for hw_cpu_ncore=2. BUG: 33948771 Change-Id: I32d5ea3c871b8abac83b9c68c3f38572dd8ea4b3
-rwxr-xr-xandroid-qemu2-glue/main.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/android-qemu2-glue/main.cpp b/android-qemu2-glue/main.cpp
index 5ed152171f..f35d52d2b6 100755
--- a/android-qemu2-glue/main.cpp
+++ b/android-qemu2-glue/main.cpp
@@ -703,14 +703,14 @@ extern "C" int main(int argc, char **argv) {
hw->hw_cpu_ncore = 16;
}
#endif
- ncores = StringFormat("cores=%ld", hw->hw_cpu_ncore);
+ ncores = StringFormat("cores=%d", hw->hw_cpu_ncore);
args[n++] = ncores.c_str();
}
#endif // !TARGET_X86_64 && !TARGET_I386
// Memory size
args[n++] = "-m";
- std::string memorySize = StringFormat("%ld", hw->hw_ramSize);
+ std::string memorySize = StringFormat("%d", hw->hw_ramSize);
args[n++] = memorySize.c_str();
// Kernel command-line parameters.