From 73c7c33a873adc47ade9a66e0a7f4649c2bf271e Mon Sep 17 00:00:00 2001 From: Juan Quintela <quintela@redhat.com> Date: Tue, 21 Jul 2009 22:27:08 +0200 Subject: [PATCH 04/16] add option to disable kvm nested Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <7806fd40ba59c96bb3f5ffea106f50d055ab083d.1248207931.git.quintela@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Bugzilla: 512837 Obsoletes: <4d7f99b8a31f941a9e0ebeee9df079b2175c0d52.1248095797.git.quintela@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Acked-by: Luiz Capitulino <lcapitulino@redhat.com> (conditional on feature unwanted) Acked-by: Eduardo Habkost <ehabkost@redhat.com> RH-Upstream-status: pending --- qemu/configure | 11 +++++++++++ qemu/vl.c | 4 ++++ 2 files changed, 15 insertions(+), 0 deletions(-) diff --git a/qemu/configure b/qemu/configure index 56ebe01..6bfb477 100755 --- a/qemu/configure +++ b/qemu/configure @@ -178,6 +178,7 @@ smb="yes" scsi="yes" isapc="yes" kvm="yes" +kvm_nested="no" kvm_cap_pit="no" kvm_cap_device_assignment="no" kerneldir="" @@ -321,6 +322,10 @@ if [ "$bsd" = "yes" ] ; then bsd_user="yes" fi +if [ "$kvm" == "yes" ] ; then + kvm_nested="yes" +fi + # find source path source_path=`dirname "$0"` source_path_used="no" @@ -412,6 +417,8 @@ for opt do ;; --disable-isapc) isapc="no" ;; + --disable-kvm-nested) kvm_nested="no" + ;; --disable-kvm) kvm="no" ;; --enable-profiler) profiler="yes" @@ -1299,6 +1306,7 @@ echo "Spice $spice" echo "SMB directores $smb" echo "SCSI devices $scsi" echo "ISAPC support $isapc" +echo "KVM nested $kvm_nested" if test $sdl_too_old = "yes"; then echo "-> Your SDL version is too old - please upgrade to have SDL support" @@ -1595,6 +1603,9 @@ fi if test "$isapc" = "yes" ; then echo "#define CONFIG_ISAPC 1" >> $config_h fi +if test "$kvm_nested" = "yes" ; then + echo "#define CONFIG_KVM_NESTED 1" >> $config_h +fi if test "$aio" = "yes" ; then echo "#define CONFIG_AIO 1" >> $config_h echo "CONFIG_AIO=yes" >> $config_mak diff --git a/qemu/vl.c b/qemu/vl.c index 3b465ba..2e9ac4c 100644 --- a/qemu/vl.c +++ b/qemu/vl.c @@ -4542,7 +4542,9 @@ static const QEMUOption qemu_options[] = { { "no-kvm-irqchip", 0, QEMU_OPTION_no_kvm_irqchip }, { "no-kvm-pit", 0, QEMU_OPTION_no_kvm_pit }, { "no-kvm-pit-reinjection", 0, QEMU_OPTION_no_kvm_pit_reinjection }, +#ifdef CONFIG_KVM_NESTED { "enable-nesting", 0, QEMU_OPTION_enable_nesting }, +#endif #if defined(TARGET_I386) || defined(TARGET_X86_64) || defined(TARGET_IA64) || defined(__linux__) { "pcidevice", HAS_ARG, QEMU_OPTION_pcidevice }, #endif @@ -5637,10 +5639,12 @@ int main(int argc, char **argv, char **envp) kvm_pit_reinject = 0; break; } +#ifdef CONFIG_KVM_NESTED case QEMU_OPTION_enable_nesting: { kvm_nested = 1; break; } +#endif #if defined(TARGET_I386) || defined(TARGET_X86_64) || defined(TARGET_IA64) || defined(__linux__) case QEMU_OPTION_pcidevice: if (assigned_devices_index >= MAX_DEV_ASSIGN_CMDLINE) { -- 1.6.3.rc4.29.g8146