diff options
author | Liu, Jinsong <jinsong.liu@intel.com> | 2010-01-21 19:50:17 +0800 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2010-01-31 19:20:03 -0200 |
commit | dec2eb9d724b21581500aea911dd13f7bfbea59e (patch) | |
tree | 8e7354b14ab44f8082da858c411561b772a7dd3f /qemu-kvm.c | |
parent | device assignment: default requires IOMMU (diff) | |
download | qemu-kvm-dec2eb9d724b21581500aea911dd13f7bfbea59e.tar.gz qemu-kvm-dec2eb9d724b21581500aea911dd13f7bfbea59e.tar.bz2 qemu-kvm-dec2eb9d724b21581500aea911dd13f7bfbea59e.zip |
Fix kvm_load_mpstate for vcpu hot add
Add 'kvm_vcpu_inited' check so that when adding vcpu it will not
cause segmentation fault. This is especially necessary when vpu
hotadd after guestos ready.
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'qemu-kvm.c')
-rw-r--r-- | qemu-kvm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/qemu-kvm.c b/qemu-kvm.c index 44e8b75bd..eef1526ec 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -1618,7 +1618,7 @@ static void kvm_do_load_mpstate(void *_env) void kvm_load_mpstate(CPUState *env) { - if (kvm_enabled() && qemu_system_ready) + if (kvm_enabled() && qemu_system_ready && kvm_vcpu_inited(env)) on_vcpu(env, kvm_do_load_mpstate, env); } |