On Thu, Jul 12, 2012 at 11:19:47AM +0300, Avi Kivity wrote: > On 07/12/2012 05:46 AM, Asias He wrote: > > On Thu, Jul 12, 2012 at 12:09 AM, Avi Kivity <avi@xxxxxxxxxx> wrote: > >> On 07/11/2012 07:08 PM, Asias He wrote: > >>> VHOST_SET_MEM_TABLE failed: Operation not supported > >>> > >>> In vhost_set_memory(), We have > >>> > >>> if (mem.padding) > >>> return -EOPNOTSUPP; > >>> > >>> So, we need to zero struct vhost_memory. > >>> > >> > >> Is this due to a change in vhost? > > > > Seems we have this bit in the very beginning (commit 3a4d5c94). > > Okay, so it's a documentation problem. Michael, where is the > documentation for vhost-net? Most fields are documented in include/linux/vhost.h Yes the approach vhost consistently takes is to require all unused fields to be zeroed out. > Note we have to initialize it with memset(); We can also use = {} if we want to avoid naming it. > presumably when we > repurpose it the name will change, and anonymous unions are not very > portable. Looks like in the new C standard they are :) I'm not sure what we'll do, exactly, if we need to reuse this padding for something else, but not breaking build for old userspace will be a priority. > -- > error compiling committee.c: too many arguments to function > -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html