summaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorliguang <lig.fnst@cn.fujitsu.com>2013-01-24 13:03:25 +0800
committerAnthony Liguori <aliguori@us.ibm.com>2013-02-01 15:07:44 -0600
commite3c66d939480e0f372316c22184c07fb3de12873 (patch)
tree8e74c93a78194653397e8a76d5f841fe18df013f /vl.c
parentbaeddded5fe6fa37d13fb94bf8dc0e9b2b184e21 (diff)
vl: skip init accelerator if it's not available
Signed-off-by: liguang <lig.fnst@cn.fujitsu.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/vl.c b/vl.c
index 910abb6526..140ce84cc0 100644
--- a/vl.c
+++ b/vl.c
@@ -2577,18 +2577,18 @@ static int configure_accelerator(void)
p = get_opt_name(buf, sizeof (buf), p, ':');
for (i = 0; i < ARRAY_SIZE(accel_list); i++) {
if (strcmp(accel_list[i].opt_name, buf) == 0) {
+ if (!accel_list[i].available()) {
+ printf("%s not supported for this target\n",
+ accel_list[i].name);
+ continue;
+ }
*(accel_list[i].allowed) = 1;
ret = accel_list[i].init();
if (ret < 0) {
init_failed = 1;
- if (!accel_list[i].available()) {
- printf("%s not supported for this target\n",
- accel_list[i].name);
- } else {
- fprintf(stderr, "failed to initialize %s: %s\n",
- accel_list[i].name,
- strerror(-ret));
- }
+ fprintf(stderr, "failed to initialize %s: %s\n",
+ accel_list[i].name,
+ strerror(-ret));
*(accel_list[i].allowed) = 0;
} else {
accel_initialised = 1;