diff options
author | Andy McFadden <fadden@android.com> | 2012-03-16 09:29:09 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-03-16 09:29:09 -0700 |
commit | b5419de956567e97226ae5df50d2bdc3a1be5e14 (patch) | |
tree | 239df4b9f9807e0e19eda749b2c44e6ccea37be7 | |
parent | facee1d1d0c3029915f5443c788cd32b9f5b9c83 (diff) | |
parent | 7876c70c97140ac6a4469e04da1b377913da259a (diff) | |
download | external_qemu-b5419de956567e97226ae5df50d2bdc3a1be5e14.zip external_qemu-b5419de956567e97226ae5df50d2bdc3a1be5e14.tar.gz external_qemu-b5419de956567e97226ae5df50d2bdc3a1be5e14.tar.bz2 |
Merge "Don't crash if KVM is busy"
-rw-r--r-- | kvm-all.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -427,8 +427,8 @@ int kvm_init(int smp_cpus) s->vmfd = -1; s->fd = open("/dev/kvm", O_RDWR); if (s->fd == -1) { - fprintf(stderr, "Could not access KVM kernel module: %m\n"); ret = -errno; + fprintf(stderr, "Could not access KVM kernel module: %m\n"); goto err; } @@ -447,8 +447,11 @@ int kvm_init(int smp_cpus) } s->vmfd = kvm_ioctl(s, KVM_CREATE_VM, 0); - if (s->vmfd < 0) + if (s->vmfd < 0) { + ret = -errno; + fprintf(stderr, "ioctl(KVM_CREATE_VM) failed: %s\n", strerror(errno)); goto err; + } /* initially, KVM allocated its own memory and we had to jump through * hooks to make phys_ram_base point to this. Modern versions of KVM |