diff options
author | Avi Kivity <avi@qumranet.com> | 2006-12-22 04:06:02 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-22 11:55:46 -0500 |
commit | 0b76e20b27d20f7cb240e6b1b2dbebaa1b7f9b60 (patch) | |
tree | 409d8ca0f46500b5998aca9400c3419f9ebb789f | |
parent | 0f8e3d365a30a8788d4c348e2885bac9640bf4d0 (diff) |
[PATCH] KVM: API versioning
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>
-rw-r--r-- | drivers/kvm/kvm_main.c | 3 | ||||
-rw-r--r-- | include/linux/kvm.h | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index bc2e6c19f855..9f24f22e4cb2 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c | |||
@@ -1603,6 +1603,9 @@ static long kvm_dev_ioctl(struct file *filp, | |||
1603 | int r = -EINVAL; | 1603 | int r = -EINVAL; |
1604 | 1604 | ||
1605 | switch (ioctl) { | 1605 | switch (ioctl) { |
1606 | case KVM_GET_API_VERSION: | ||
1607 | r = KVM_API_VERSION; | ||
1608 | break; | ||
1606 | case KVM_CREATE_VCPU: { | 1609 | case KVM_CREATE_VCPU: { |
1607 | r = kvm_dev_ioctl_create_vcpu(kvm, arg); | 1610 | r = kvm_dev_ioctl_create_vcpu(kvm, arg); |
1608 | if (r) | 1611 | if (r) |
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 5bb2c3c585c1..28fdce1ac1db 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #include <asm/types.h> | 11 | #include <asm/types.h> |
12 | #include <linux/ioctl.h> | 12 | #include <linux/ioctl.h> |
13 | 13 | ||
14 | #define KVM_API_VERSION 1 | ||
15 | |||
14 | /* | 16 | /* |
15 | * Architectural interrupt line count, and the size of the bitmap needed | 17 | * Architectural interrupt line count, and the size of the bitmap needed |
16 | * to hold them. | 18 | * to hold them. |
@@ -209,6 +211,7 @@ struct kvm_dirty_log { | |||
209 | 211 | ||
210 | #define KVMIO 0xAE | 212 | #define KVMIO 0xAE |
211 | 213 | ||
214 | #define KVM_GET_API_VERSION _IO(KVMIO, 1) | ||
212 | #define KVM_RUN _IOWR(KVMIO, 2, struct kvm_run) | 215 | #define KVM_RUN _IOWR(KVMIO, 2, struct kvm_run) |
213 | #define KVM_GET_REGS _IOWR(KVMIO, 3, struct kvm_regs) | 216 | #define KVM_GET_REGS _IOWR(KVMIO, 3, struct kvm_regs) |
214 | #define KVM_SET_REGS _IOW(KVMIO, 4, struct kvm_regs) | 217 | #define KVM_SET_REGS _IOW(KVMIO, 4, struct kvm_regs) |