k->u migration bug fix

Dong, Eddie
2007-08-06T03:04:59Z

Fix bug for wrong vcpu->apic due to irq_summary set in user irqchip
which makes union member vcpu->apic non NULL.

Signed-off-by: Yaozu (Eddie) Dong <eddie.dong-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index 470b7a1..03c1433 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -1068,7 +1068,7 @@ static struct kvm_io_device
*vcpu_find_pervcpu_dev(struct
{
struct kvm_io_device *dev;

- if (vcpu->apic) {
+ if (irqchip_in_kernel(vcpu->kvm) && vcpu->apic) {
dev = &vcpu->apic->dev;
if (dev->in_range(dev, addr))
return dev;