From f5d6f51ba66aad038f1bc4436582761015838438 Mon Sep 17 00:00:00 2001 From: aliguori Date: Mon, 15 Dec 2008 22:20:42 +0000 Subject: kvm: sync vcpu state during initialization (Hollis Blanchard) Currently on x86, qemu initializes CPUState but KVM ignores it and does its own vcpu initialization. However, PowerPC KVM needs to be able to set the initial register state to support the -kernel and -append options. Signed-off-by: Hollis Blanchard Signed-off-by: Anthony Liguori git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6060 c046a42c-6fe2-441c-8c8c-71466251a162 --- vl.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'vl.c') diff --git a/vl.c b/vl.c index c3a8d8fc9a..0a021515ab 100644 --- a/vl.c +++ b/vl.c @@ -5456,6 +5456,17 @@ int main(int argc, char **argv, char **envp) machine->init(ram_size, vga_ram_size, boot_devices, ds, kernel_filename, kernel_cmdline, initrd_filename, cpu_model); + /* Set KVM's vcpu state to qemu's initial CPUState. */ + if (kvm_enabled()) { + int ret; + + ret = kvm_sync_vcpus(); + if (ret < 0) { + fprintf(stderr, "failed to initialize vcpus\n"); + exit(1); + } + } + /* init USB devices */ if (usb_enabled) { for(i = 0; i < usb_devices_index; i++) { -- cgit v1.2.3