[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/3] accel: change {xen, kvm, tcg, qtest}_allowed fr
From: |
liguang |
Subject: |
[Qemu-devel] [PATCH 3/3] accel: change {xen, kvm, tcg, qtest}_allowed from int to bool |
Date: |
Thu, 24 Jan 2013 13:03:27 +0800 |
Signed-off-by: liguang <address@hidden>
---
hw/xen.h | 4 ++--
include/sysemu/kvm.h | 2 +-
include/sysemu/qtest.h | 2 +-
qtest.c | 2 +-
vl.c | 12 ++++++------
5 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/hw/xen.h b/hw/xen.h
index e3cca7f..6235f91 100644
--- 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;
diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index 6bdd513..264644a 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -38,7 +38,7 @@
#define KVM_FEATURE_PV_EOI 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;
diff --git a/include/sysemu/qtest.h b/include/sysemu/qtest.h
index 723a4f9..9a0c6b3 100644
--- a/include/sysemu/qtest.h
+++ b/include/sysemu/qtest.h
@@ -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 c9b58ce..b7a3821 100644
--- 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 5374c14..1925a12 100644
--- a/vl.c
+++ b/vl.c
@@ -261,9 +261,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;
@@ -2507,7 +2507,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 },
@@ -2545,14 +2545,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;
}
--
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, 2013/01/24
- [Qemu-devel] [PATCH 3/3] accel: change {xen, kvm, tcg, qtest}_allowed from int to bool,
liguang <=
- Re: [Qemu-devel] [PATCH 0/3] accel:some cleanup work for vm accelerator, li guang, 2013/01/28