Skip to content

Commit

Permalink
[PATCH] KVM: API versioning
Browse files Browse the repository at this point in the history
Add compile-time and run-time API versioning.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Avi Kivity authored and Linus Torvalds committed Dec 22, 2006
1 parent 0f8e3d3 commit 0b76e20
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1603,6 +1603,9 @@ static long kvm_dev_ioctl(struct file *filp,
int r = -EINVAL;

switch (ioctl) {
case KVM_GET_API_VERSION:
r = KVM_API_VERSION;
break;
case KVM_CREATE_VCPU: {
r = kvm_dev_ioctl_create_vcpu(kvm, arg);
if (r)
Expand Down
3 changes: 3 additions & 0 deletions include/linux/kvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include <asm/types.h>
#include <linux/ioctl.h>

#define KVM_API_VERSION 1

/*
* Architectural interrupt line count, and the size of the bitmap needed
* to hold them.
Expand Down Expand Up @@ -209,6 +211,7 @@ struct kvm_dirty_log {

#define KVMIO 0xAE

#define KVM_GET_API_VERSION _IO(KVMIO, 1)
#define KVM_RUN _IOWR(KVMIO, 2, struct kvm_run)
#define KVM_GET_REGS _IOWR(KVMIO, 3, struct kvm_regs)
#define KVM_SET_REGS _IOW(KVMIO, 4, struct kvm_regs)
Expand Down

0 comments on commit 0b76e20

Please sign in to comment.