[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <454F0E4A.7030001@qumranet.com>
Date: Mon, 06 Nov 2006 12:28:26 +0200
From: Avi Kivity <avi@...ranet.com>
To: Arjan van de Ven <arjan@...radead.org>
CC: kvm-devel@...ts.sourceforge.net, linux-kernel@...r.kernel.org,
akpm@...l.org
Subject: Re: [PATCH 1/14] KVM: userspace interface
Arjan van de Ven wrote:
> Hi,
>
> some nitpicks about the ioctl interfaces while it still can be done ;)
>
>
There are some changes still planned (to streamline smp support).
>
>> Signed-off-by: Yaniv Kamay <yaniv@...ranet.com>
>> Signed-off-by: Avi Kivity <avi@...ranet.com>
>>
>> --- /dev/null 2006-10-25 17:42:42.376631750 +0200
>> +++ linux-2.6/include/linux/kvm.h 2006-10-26 15:22:01.000000000 +0200
>> @@ -0,0 +1,198 @@
>> +#ifndef __LINUX_KVM_H
>> +#define __LINUX_KVM_H
>> +
>> +/*
>> + * Userspace interface for /dev/kvm - kernel based virtual machine
>> + *
>> + * Note: this interface is considered experimental and may change without
>> + * notice.
>> + */
>> +
>> +#include <asm/types.h>
>> +#include <linux/ioctl.h>
>> +
>> +/* for KVM_CREATE_MEMORY_REGION */
>> +struct kvm_memory_region {
>> + __u32 slot;
>> + __u32 flags;
>> + __u64 guest_phys_addr;
>> + __u64 memory_size; /* bytes */
>> +};
>>
>
> as a general rule, it's a lot better to sort structures big-to-small, to
> make sure alignments inside the struct are minimized and don't suck too
> much. This is especially important to get right for 32/64 bit
> compatibility. This comment is true for most structures in this header
> file; please consider this at least
>
Doesn't that cause an unnatural field order? for example, in some
structures I separated in and out variables. Sorting by size is a bit
like sorting alphabetically.
Anyway I observed 32/64 bit compatibility religiously.
>
>> +
>> +enum kvm_exit_reason {
>> + KVM_EXIT_UNKNOWN,
>> + KVM_EXIT_EXCEPTION,
>> + KVM_EXIT_IO,
>> + KVM_EXIT_CPUID,
>> + KVM_EXIT_DEBUG,
>> + KVM_EXIT_HLT,
>> + KVM_EXIT_MMIO,
>> +};
>>
>
> it's probably nicer to use explicit enum values for the interface, just
> as documentation if nothing else
>
>
Will do.
--
error compiling committee.c: too many arguments to function
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists