accel: change {xen, kvm, tcg, qtest}_allowed from int to bool
authorliguang <lig.fnst@cn.fujitsu.com>
Thu, 24 Jan 2013 05:03:27 +0000 (13:03 +0800)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 1 Feb 2013 21:08:02 +0000 (15:08 -0600)
Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/xen.h
include/sysemu/kvm.h
include/sysemu/qtest.h
qtest.c
vl.c

index e3cca7fb9220e28566aa1e612d2bf9ff575d86d5..6235f91fe0f7d528de396cff86f31f68ac26f439 100644 (file)
--- a/hw/xen.h
+++ b/hw/xen.h
@@ -21,9 +21,9 @@ enum xen_mode {
 extern uint32_t xen_domid;
 extern enum xen_mode xen_mode;
 
-extern int xen_allowed;
+extern bool xen_allowed;
 
-static inline int xen_enabled(void)
+static inline bool xen_enabled(void)
 {
 #if defined(CONFIG_XEN_BACKEND) && !defined(CONFIG_NO_XEN)
     return xen_allowed;
index 6e6dfb374a355e9beeb75b981c0f7532e305e988..f2d97b580ddbdf9289ef9b35888dc3e66d97bdab 100644 (file)
@@ -39,7 +39,7 @@
 #define KVM_FEATURE_CLOCKSOURCE_STABLE_BIT 0
 #endif
 
-extern int kvm_allowed;
+extern bool kvm_allowed;
 extern bool kvm_kernel_irqchip;
 extern bool kvm_async_interrupts_allowed;
 extern bool kvm_irqfds_allowed;
index 723a4f9536d36b891fa689756964395abba2f673..9a0c6b31c8c750832af737a8dbed97fefeec832b 100644 (file)
@@ -17,7 +17,7 @@
 #include "qemu-common.h"
 
 #if !defined(CONFIG_USER_ONLY)
-extern int qtest_allowed;
+extern bool qtest_allowed;
 extern const char *qtest_chrdev;
 extern const char *qtest_log;
 
diff --git a/qtest.c b/qtest.c
index c9b58ceb8b1b9c506c91692d9a2740c2a98fa008..b7a3821ca7342d2371bb4e49049fe1db2f6bcc49 100644 (file)
--- a/qtest.c
+++ b/qtest.c
@@ -24,7 +24,7 @@
 
 const char *qtest_chrdev;
 const char *qtest_log;
-int qtest_allowed = 0;
+bool qtest_allowed;
 
 static DeviceState *irq_intercept_dev;
 static FILE *qtest_log_fp;
diff --git a/vl.c b/vl.c
index fe2898594de839ae282388bd0e176bfff26a22b9..f094f04a2c3ec727b08a325143a7d8fd66ffa5f8 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -263,9 +263,9 @@ static NotifierList exit_notifiers =
 static NotifierList machine_init_done_notifiers =
     NOTIFIER_LIST_INITIALIZER(machine_init_done_notifiers);
 
-static int tcg_allowed = 1;
-int kvm_allowed = 0;
-int xen_allowed = 0;
+static bool tcg_allowed = true;
+bool kvm_allowed;
+bool xen_allowed;
 uint32_t xen_domid;
 enum xen_mode xen_mode = XEN_EMULATE;
 static int tcg_tb_size;
@@ -2544,7 +2544,7 @@ static struct {
     const char *name;
     int (*available)(void);
     int (*init)(void);
-    int *allowed;
+    bool *allowed;
 } accel_list[] = {
     { "tcg", "tcg", tcg_available, tcg_init, &tcg_allowed },
     { "xen", "Xen", xen_available, xen_init, &xen_allowed },
@@ -2582,14 +2582,14 @@ static int configure_accelerator(void)
                            accel_list[i].name);
                     continue;
                 }
-                *(accel_list[i].allowed) = 1;
+                *(accel_list[i].allowed) = true;
                 ret = accel_list[i].init();
                 if (ret < 0) {
                     init_failed = true;
                     fprintf(stderr, "failed to initialize %s: %s\n",
                             accel_list[i].name,
                             strerror(-ret));
-                    *(accel_list[i].allowed) = 0;
+                    *(accel_list[i].allowed) = false;
                 } else {
                     accel_initialised = true;
                 }