qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 1/3] vl: skip init accelerator if it's not available


From: liguang
Subject: [Qemu-devel] [PATCH 1/3] vl: skip init accelerator if it's not available
Date: Thu, 24 Jan 2013 13:03:25 +0800

Signed-off-by: liguang <address@hidden>
---
 vl.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/vl.c b/vl.c
index 4ee1302..25aa8e8 100644
--- a/vl.c
+++ b/vl.c
@@ -2540,18 +2540,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;
-- 
1.7.2.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]