kvm: decode the argument of KVM_CREATE_VCPU ioctl command
* kvm.c (kvm_ioctl_create_vcpu): New function. (kvm_ioctl) <KVM_CREATE_VCPU>: Use it. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
This commit is contained in:
parent
312073760f
commit
5f61f158c3
11
kvm.c
11
kvm.c
@ -33,10 +33,21 @@
|
|||||||
#ifdef HAVE_LINUX_KVM_H
|
#ifdef HAVE_LINUX_KVM_H
|
||||||
# include <linux/kvm.h>
|
# include <linux/kvm.h>
|
||||||
|
|
||||||
|
static int
|
||||||
|
kvm_ioctl_create_vcpu(struct tcb *const tcp, const kernel_ulong_t arg)
|
||||||
|
{
|
||||||
|
uint32_t cpuid = arg;
|
||||||
|
|
||||||
|
tprintf(", %u", cpuid);
|
||||||
|
return RVAL_IOCTL_DECODED | RVAL_FD;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
kvm_ioctl(struct tcb *const tcp, const unsigned int code, const kernel_ulong_t arg)
|
kvm_ioctl(struct tcb *const tcp, const unsigned int code, const kernel_ulong_t arg)
|
||||||
{
|
{
|
||||||
switch (code) {
|
switch (code) {
|
||||||
|
case KVM_CREATE_VCPU:
|
||||||
|
return kvm_ioctl_create_vcpu(tcp, arg);
|
||||||
case KVM_CREATE_VM:
|
case KVM_CREATE_VM:
|
||||||
return RVAL_DECODED | RVAL_FD;
|
return RVAL_DECODED | RVAL_FD;
|
||||||
case KVM_RUN:
|
case KVM_RUN:
|
||||||
|
Loading…
Reference in New Issue
Block a user