Revision 7ba1e619 vl.c
b/vl.c | ||
---|---|---|
39 | 39 |
#include "block.h" |
40 | 40 |
#include "audio/audio.h" |
41 | 41 |
#include "migration.h" |
42 |
#include "kvm.h" |
|
42 | 43 |
|
43 | 44 |
#include <unistd.h> |
44 | 45 |
#include <fcntl.h> |
... | ... | |
4782 | 4783 |
"-kernel-kqemu enable KQEMU full virtualization (default is user mode only)\n" |
4783 | 4784 |
"-no-kqemu disable KQEMU kernel module usage\n" |
4784 | 4785 |
#endif |
4786 |
#ifdef CONFIG_KVM |
|
4787 |
"-enable-kvm enable KVM full virtualization support\n" |
|
4788 |
#endif |
|
4785 | 4789 |
#ifdef TARGET_I386 |
4786 | 4790 |
"-no-acpi disable ACPI\n" |
4787 | 4791 |
#endif |
... | ... | |
4887 | 4891 |
QEMU_OPTION_pidfile, |
4888 | 4892 |
QEMU_OPTION_no_kqemu, |
4889 | 4893 |
QEMU_OPTION_kernel_kqemu, |
4894 |
QEMU_OPTION_enable_kvm, |
|
4890 | 4895 |
QEMU_OPTION_win2k_hack, |
4891 | 4896 |
QEMU_OPTION_usb, |
4892 | 4897 |
QEMU_OPTION_usbdevice, |
... | ... | |
4973 | 4978 |
{ "no-kqemu", 0, QEMU_OPTION_no_kqemu }, |
4974 | 4979 |
{ "kernel-kqemu", 0, QEMU_OPTION_kernel_kqemu }, |
4975 | 4980 |
#endif |
4981 |
#ifdef CONFIG_KVM |
|
4982 |
{ "enable-kvm", 0, QEMU_OPTION_enable_kvm }, |
|
4983 |
#endif |
|
4976 | 4984 |
#if defined(TARGET_PPC) || defined(TARGET_SPARC) |
4977 | 4985 |
{ "g", 1, QEMU_OPTION_g }, |
4978 | 4986 |
#endif |
... | ... | |
5794 | 5802 |
kqemu_allowed = 2; |
5795 | 5803 |
break; |
5796 | 5804 |
#endif |
5805 |
#ifdef CONFIG_KVM |
|
5806 |
case QEMU_OPTION_enable_kvm: |
|
5807 |
kvm_allowed = 1; |
|
5808 |
#ifdef USE_KQEMU |
|
5809 |
kqemu_allowed = 0; |
|
5810 |
#endif |
|
5811 |
break; |
|
5812 |
#endif |
|
5797 | 5813 |
case QEMU_OPTION_usb: |
5798 | 5814 |
usb_enabled = 1; |
5799 | 5815 |
break; |
... | ... | |
5928 | 5944 |
} |
5929 | 5945 |
} |
5930 | 5946 |
|
5947 |
#if defined(CONFIG_KVM) && defined(USE_KQEMU) |
|
5948 |
if (kvm_allowed && kqemu_allowed) { |
|
5949 |
fprintf(stderr, |
|
5950 |
"You can not enable both KVM and kqemu at the same time\n"); |
|
5951 |
exit(1); |
|
5952 |
} |
|
5953 |
#endif |
|
5954 |
|
|
5931 | 5955 |
machine->max_cpus = machine->max_cpus ?: 1; /* Default to UP */ |
5932 | 5956 |
if (smp_cpus > machine->max_cpus) { |
5933 | 5957 |
fprintf(stderr, "Number of SMP cpus requested (%d), exceeds max cpus " |
... | ... | |
6229 | 6253 |
} |
6230 | 6254 |
} |
6231 | 6255 |
|
6256 |
if (kvm_enabled()) { |
|
6257 |
int ret; |
|
6258 |
|
|
6259 |
ret = kvm_init(smp_cpus); |
|
6260 |
if (ret < 0) { |
|
6261 |
fprintf(stderr, "failed to initialize KVM\n"); |
|
6262 |
exit(1); |
|
6263 |
} |
|
6264 |
} |
|
6265 |
|
|
6232 | 6266 |
machine->init(ram_size, vga_ram_size, boot_devices, ds, |
6233 | 6267 |
kernel_filename, kernel_cmdline, initrd_filename, cpu_model); |
6234 | 6268 |
|
Also available in: Unified diff