diff options
Diffstat (limited to 'accel')
-rw-r--r-- | accel/accel.c | 18 | ||||
-rw-r--r-- | accel/kvm/kvm-all.c | 4 | ||||
-rw-r--r-- | accel/tcg/translate-all.c | 4 |
3 files changed, 17 insertions, 9 deletions
diff --git a/accel/accel.c b/accel/accel.c index 6db5d8f4df..68b6d56323 100644 --- a/accel/accel.c +++ b/accel/accel.c @@ -69,7 +69,7 @@ static int accel_init_machine(AccelClass *acc, MachineState *ms) return ret; } -void configure_accelerator(MachineState *ms) +void configure_accelerator(MachineState *ms, const char *progname) { const char *accel; char **accel_list, **tmp; @@ -80,8 +80,20 @@ void configure_accelerator(MachineState *ms) accel = qemu_opt_get(qemu_get_machine_opts(), "accel"); if (accel == NULL) { - /* Use the default "accelerator", tcg */ - accel = "tcg"; + /* Select the default accelerator */ + int pnlen = strlen(progname); + if (pnlen >= 3 && g_str_equal(&progname[pnlen - 3], "kvm")) { + /* If the program name ends with "kvm", we prefer KVM */ + accel = "kvm:tcg"; + } else { +#if defined(CONFIG_TCG) + accel = "tcg"; +#elif defined(CONFIG_KVM) + accel = "kvm"; +#else +#error "No default accelerator available" +#endif + } } accel_list = g_strsplit(accel, ":", 0); diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 4880a05399..4e1de942ce 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -86,7 +86,7 @@ struct KVMState int robust_singlestep; int debugregs; #ifdef KVM_CAP_SET_GUEST_DEBUG - struct kvm_sw_breakpoint_head kvm_sw_breakpoints; + QTAILQ_HEAD(, kvm_sw_breakpoint) kvm_sw_breakpoints; #endif int many_ioeventfds; int intx_set_mask; @@ -102,7 +102,7 @@ struct KVMState int nr_allocated_irq_routes; unsigned long *used_gsi_bitmap; unsigned int gsi_count; - QTAILQ_HEAD(msi_hashtab, KVMMSIRoute) msi_hashtab[KVM_MSI_HASHTAB_SIZE]; + QTAILQ_HEAD(, KVMMSIRoute) msi_hashtab[KVM_MSI_HASHTAB_SIZE]; #endif KVMMemoryListener memory_listener; QLIST_HEAD(, KVMParkedVcpu) kvm_parked_vcpus; diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 639f0b2728..8cb8c8870e 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -16,12 +16,8 @@ * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, see <http://www.gnu.org/licenses/>. */ -#ifdef _WIN32 -#include <windows.h> -#endif #include "qemu/osdep.h" - #include "qemu-common.h" #define NO_CPU_IO_DEFS #include "cpu.h" |