]> git.proxmox.com Git - mirror_qemu.git/commitdiff
Fix regression introduced by -machine accel=
authorAnthony Liguori <aliguori@us.ibm.com>
Mon, 6 Jun 2011 13:25:06 +0000 (08:25 -0500)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 6 Jun 2011 13:54:56 +0000 (08:54 -0500)
Commit 85097db6 changed the timing when kvm_allowed is set until after
kvm is initialized.  During initialization, the ioeventfd initialization code
checks kvm_enabled() and after this change, ioeventfd is effectively disabled.

This causes a significant regression in performance.

Fix this by setting kvm_allowed before calling init.

Reported-by: Khoa Huynh <khoa@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vl.c

diff --git a/vl.c b/vl.c
index b362871089a83c5bc53efbbc84352eb3b2201f39..11f6386101ff5d90062b7ec02649dfa8665ddb62 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -1933,6 +1933,7 @@ 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) {
+                *(accel_list[i].allowed) = 1;
                 ret = accel_list[i].init();
                 if (ret < 0) {
                     init_failed = 1;
@@ -1944,9 +1945,9 @@ static int configure_accelerator(void)
                                 accel_list[i].name,
                                 strerror(-ret));
                     }
+                    *(accel_list[i].allowed) = 0;
                 } else {
                     accel_initalised = 1;
-                    *(accel_list[i].allowed) = 1;
                 }
                 break;
             }