[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/3] vl: correct error message when fail to init kvm
From: |
liguang |
Subject: |
[Qemu-devel] [PATCH 2/3] vl: correct error message when fail to init kvm |
Date: |
Thu, 24 Jan 2013 13:03:26 +0800 |
command:
qemu-system-x86_64 -hda disk.img -smp 32 --enable-kvm
error:
Number of SMP cpus requested (32) exceeds max cpus supported by KVM (16)
failed to initialize KVM: Invalid argument
No accelerator found!
well, it did find kvm, but failed to init,
so message "No accelerator found!" is confusing,
this commit remove the confusing error message.
Signed-off-by: liguang <address@hidden>
---
vl.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/vl.c b/vl.c
index 25aa8e8..5374c14 100644
--- a/vl.c
+++ b/vl.c
@@ -2520,8 +2520,8 @@ static int configure_accelerator(void)
const char *p = NULL;
char buf[10];
int i, ret;
- bool accel_initialised = 0;
- bool init_failed = 0;
+ bool accel_initialised = false;
+ bool init_failed = false;
QemuOptsList *list = qemu_find_opts("machine");
if (!QTAILQ_EMPTY(&list->head)) {
@@ -2548,13 +2548,13 @@ static int configure_accelerator(void)
*(accel_list[i].allowed) = 1;
ret = accel_list[i].init();
if (ret < 0) {
- init_failed = 1;
+ init_failed = true;
fprintf(stderr, "failed to initialize %s: %s\n",
accel_list[i].name,
strerror(-ret));
*(accel_list[i].allowed) = 0;
} else {
- accel_initialised = 1;
+ accel_initialised = true;
}
break;
}
@@ -2565,7 +2565,9 @@ static int configure_accelerator(void)
}
if (!accel_initialised) {
- fprintf(stderr, "No accelerator found!\n");
+ if (!init_failed) {
+ fprintf(stderr, "No accelerator found!\n");
+ }
exit(1);
}
--
1.7.2.5
- [Qemu-devel] [PATCH 0/3] accel:some cleanup work for vm accelerator, liguang, 2013/01/24
- [Qemu-devel] [PATCH 1/3] vl: skip init accelerator if it's not available, liguang, 2013/01/24
- [Qemu-devel] [PATCH 2/3] vl: correct error message when fail to init kvm,
liguang <=
- [Qemu-devel] [PATCH 3/3] accel: change {xen, kvm, tcg, qtest}_allowed from int to bool, liguang, 2013/01/24
- Re: [Qemu-devel] [PATCH 0/3] accel:some cleanup work for vm accelerator, li guang, 2013/01/28