vl.c: prohibit simultaneous use of -icount with kvm or xen
authorMax Filippov <jcmvbkbc@gmail.com>
Thu, 10 Nov 2011 11:38:42 +0000 (15:38 +0400)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 11 Nov 2011 18:49:53 +0000 (12:49 -0600)
With -icount, The vm_clock is updated with help from TCG (it counts
instructions at 2^ICOUNT ns/instructions). With KVM, the instruction
count is not available so KVM cannot provide this help.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vl.c

diff --git a/vl.c b/vl.c
index 16fa222..f5afed4 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -3231,6 +3231,11 @@ int main(int argc, char **argv, char **envp)
         fprintf(stderr, "could not initialize alarm timer\n");
         exit(1);
     }
+
+    if (icount_option && (kvm_enabled() || xen_enabled())) {
+        fprintf(stderr, "-icount is not allowed with kvm or xen\n");
+        exit(1);
+    }
     configure_icount(icount_option);
 
     if (net_init_clients() < 0) {