[PATCH 3/8] kvm: handle KVM_CREATE_VM ioctl command

Dmitry V. Levin ldv at altlinux.org
Fri Dec 1 06:53:40 UTC 2017


On Fri, Dec 01, 2017 at 02:45:53PM +0900, Masatake YAMATO wrote:
> * kvm.c (kvm_ioctl): Handle KVM_CREATE_VM.
> (kvm_ioctl_create_vm): New function.
> 
> Signed-off-by: Masatake YAMATO <yamato at redhat.com>
> ---
>  kvm.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/kvm.c b/kvm.c
> index 9fa7e248..fdcf3466 100644
> --- a/kvm.c
> +++ b/kvm.c
> @@ -33,10 +33,23 @@
>  #ifdef HAVE_LINUX_KVM_H
>  #include <linux/kvm.h>
>  
> +static int
> +kvm_ioctl_create_vm(struct tcb *const tcp, const kernel_ulong_t arg)
> +{
> +#ifdef X86_64
> +	return RVAL_IOCTL_DECODED | RVAL_FD;
> +#else
> +	return RVAL_DECODED | RVAL_FD;
> +#endif

As the kernel check whether arg is zero or not is performed on all
architectures, you can safely handle KVM_CREATE_VM handler the same way
as you handle KVM_RUN.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20171201/55f92afe/attachment.bin>


More information about the Strace-devel mailing list