Signed-off-by: Gregory Haskins <[EMAIL PROTECTED]>
---
qemu/qemu-kvm.c | 27 +++++++++++++++++++++++++++
qemu/qemu-kvm.h | 5 +++++
qemu/vl.c | 10 ++++++++++
qemu/vl.h | 1 +
4 files changed, 43 insertions(+), 0 deletions(-)
diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
index 6425102..d184cbd 100644
--- a/qemu/qemu-kvm.c
+++ b/qemu/qemu-kvm.c
@@ -10,6 +10,17 @@
int kvm_allowed = KVM_ALLOWED_DEFAULT;
+struct kvm_apic
+{
+ int user_specified;
+ int level;
+};
+
+struct kvm_apic kvm_apic = {
+ .user_specified = 0,
+ .level = 1,
+};
+
#ifdef USE_KVM
#include "exec.h"
@@ -930,4 +941,20 @@ int kvm_get_phys_ram_page_bitmap(unsigned char *bitmap)
out:
return r;
}
+
+int kvm_qemu_set_apic_level(int level)
+{
+ if (level < 0 || level > 1)
+ return -1;
+
+ kvm_apic.user_specified = 1;
+ kvm_apic.level = level;
+ return 0;
+}
+
+int kvm_qemu_get_apic_level(void)
+{
+ return kvm_apic.level;
+}
+
#endif
diff --git a/qemu/qemu-kvm.h b/qemu/qemu-kvm.h
index 8a1c25d..c4cb34e 100644
--- a/qemu/qemu-kvm.h
+++ b/qemu/qemu-kvm.h
@@ -3,6 +3,8 @@
#include "kvmctl.h"
+
+
int kvm_qemu_init(void);
int kvm_qemu_create_context(void);
void kvm_qemu_destroy(void);
@@ -16,6 +18,9 @@ int kvm_physical_memory_set_dirty_tracking(int enable);
int kvm_update_dirty_pages_log(void);
int kvm_get_phys_ram_page_bitmap(unsigned char *bitmap);
+int kvm_qemu_set_apic_level(int level);
+int kvm_qemu_get_apic_level(void);
+
#define ALIGN(x, y) (((x)+(y)-1) & ~((y)-1))
#define BITMAP_SIZE(m) (ALIGN(((m)>>TARGET_PAGE_BITS), HOST_LONG_BITS) / 8)
#endif
diff --git a/qemu/vl.c b/qemu/vl.c
index 7df1c80..4bf61e8 100644
--- a/qemu/vl.c
+++ b/qemu/vl.c
@@ -6531,6 +6531,7 @@ enum {
QEMU_OPTION_vnc,
QEMU_OPTION_no_acpi,
QEMU_OPTION_no_kvm,
+ QEMU_OPTION_kvm_apic,
QEMU_OPTION_no_reboot,
QEMU_OPTION_daemonize,
QEMU_OPTION_option_rom,
@@ -6600,6 +6601,7 @@ const QEMUOption qemu_options[] = {
#endif
#ifdef USE_KVM
{ "no-kvm", 0, QEMU_OPTION_no_kvm },
+ { "kvm_apic", HAS_ARG, QEMU_OPTION_kvm_apic },
#endif
#if defined(TARGET_PPC) || defined(TARGET_SPARC)
{ "g", 1, QEMU_OPTION_g },
@@ -7309,6 +7311,14 @@ int main(int argc, char **argv)
case QEMU_OPTION_no_kvm:
kvm_allowed = 0;
break;
+ case QEMU_OPTION_kvm_apic:
+ if (kvm_qemu_set_apic_level(atoi(optarg)) < 0) {
+ fprintf(stderr, "kvm_apic = %d is not supported by " \
+ "userspace\n", atoi(optarg));
+ exit(1);
+ }
+
+ break;
#endif
case QEMU_OPTION_usb:
usb_enabled = 1;
diff --git a/qemu/vl.h b/qemu/vl.h
index debd17c..4e93a81 100644
--- a/qemu/vl.h
+++ b/qemu/vl.h
@@ -158,6 +158,7 @@ extern int graphic_depth;
extern const char *keyboard_layout;
extern int kqemu_allowed;
extern int kvm_allowed;
+extern struct kvm_apic kvm_apic;
extern int win2k_install_hack;
extern int usb_enabled;
extern int smp_cpus;
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
kvm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel