From: Michael Ellerman Date: Wed, 4 Jul 2012 13:39:58 +0000 (+1000) Subject: kvm tool: Fix powerpc/kvm-cpu.c for new KVM_SET_ONE_REG API X-Git-Tag: next-20120724~32^2~21^2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=178bb529bf160f3b9a284e904fea37c38ad3e3bb;p=karo-tx-linux.git kvm tool: Fix powerpc/kvm-cpu.c for new KVM_SET_ONE_REG API I think this code was based on an earlier version of the KVM_SET_ONE_REG API, which at the time was in agraf's tree but not mainline? Either way it doesn't compile as is, so fix it up. Acked-by: Alexander Graf Signed-off-by: Michael Ellerman Signed-off-by: Pekka Enberg --- diff --git a/tools/kvm/powerpc/kvm-cpu.c b/tools/kvm/powerpc/kvm-cpu.c index 2505c69d1344..97fc759c1301 100644 --- a/tools/kvm/powerpc/kvm-cpu.c +++ b/tools/kvm/powerpc/kvm-cpu.c @@ -137,6 +137,7 @@ static void kvm_cpu__setup_sregs(struct kvm_cpu *vcpu) */ struct kvm_sregs sregs; struct kvm_one_reg reg = {}; + u64 value; if (ioctl(vcpu->vcpu_fd, KVM_GET_SREGS, &sregs) < 0) die("KVM_GET_SREGS failed"); @@ -147,8 +148,9 @@ static void kvm_cpu__setup_sregs(struct kvm_cpu *vcpu) if (ioctl(vcpu->vcpu_fd, KVM_SET_SREGS, &sregs) < 0) die("KVM_SET_SREGS failed"); - reg.id = KVM_ONE_REG_PPC_HIOR; - reg.u.reg64 = 0; + reg.id = KVM_REG_PPC_HIOR; + value = 0; + reg.addr = (u64)&value; if (ioctl(vcpu->vcpu_fd, KVM_SET_ONE_REG, ®) < 0) die("KVM_SET_ONE_REG failed"); }