diff mbox

kvm tool: Fix powerpc/kvm-cpu.c for new KVM_SET_ONE_REG API

Message ID 1341409198-30464-1-git-send-email-michael@ellerman.id.au (mailing list archive)
State New, archived
Headers show

Commit Message

Michael Ellerman July 4, 2012, 1:39 p.m. UTC
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.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 tools/kvm/powerpc/kvm-cpu.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Alexander Graf July 4, 2012, 2:07 p.m. UTC | #1
On 04.07.2012, at 15:39, Michael Ellerman wrote:

> 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.

Yup, looks good :).


Alex

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Pekka Enberg July 4, 2012, 2:13 p.m. UTC | #2
On Wed, 4 Jul 2012, Alexander Graf wrote:
> On 04.07.2012, at 15:39, Michael Ellerman wrote:
> 
> > 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.
> 
> Yup, looks good :).

Applied all patches. Thanks!

			Pekka
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Matt Evans July 4, 2012, 8:03 p.m. UTC | #3
On 04/07/2012, at 2:39 PM, Michael Ellerman wrote:

> 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.

Bit late, but I concur, all the patches look just swell.  Thank you!


Matt

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/tools/kvm/powerpc/kvm-cpu.c b/tools/kvm/powerpc/kvm-cpu.c
index 2505c69..97fc759 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, &reg) < 0)
 		die("KVM_SET_ONE_REG failed");
 }