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 <agraf@suse.de>
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
This commit is contained in:
Michael Ellerman
2012-07-04 23:39:58 +10:00
committed by Will Deacon
parent 2f82e465e5
commit 54cb8a31fc
+4 -2
View File
@@ -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, &reg) < 0)
die("KVM_SET_ONE_REG failed");
}