Isaku Yamahata <yamah...@valinux.co.jp> wrote:
> On Thu, Jun 14, 2012 at 11:34:09PM +0200, Juan Quintela wrote:

>> > +size_t umem_pages_size(uint64_t nr)
>> > +{
>> > +    return sizeof(struct umem_pages) + nr * sizeof(uint64_t);
>> 
>> Can we make sure that the pgoffs field is aligned?  I know that as it is
>> now it is aligned, but better to be sure?
>
> It is already done by gcc extension, zero length array.

Ah, I didn't knew that propierty of the zero arrays extension.  thanks.

>> 
>> Grr, we don't have a function that writes does a "safe_write".  The most
>> similar thing in qemu looks to be send_all().
>
> So we should introduce something like qemu_safe_write/read?

I guess so.  If you look around, you will see that we have a lot of
cases where we have this pattern.  But that is not a problem ofthis
patch, was already there.

>
>> Talking about looking, what protects that no other thread enters this
>> function before this one calls madvise?   Or I am losing something obvious?
>
> It is assumed that only main thread calls this function via iohandler.

Ok.  Can we add a comment then?

Later, Juan.

Reply via email to