Blue Swirl wrote:
On 12/5/08, Anthony Liguori <[EMAIL PROTECTED]> wrote:
Some cleanup needed here?

Hrm, yeah.

 +int _compat_aio_init(struct aioinit *aioinit)
 +static int _compat_aio_submit(struct aiocb *aiocb, int is_write)
 +int _compat_aio_read(struct aiocb *aiocb)
 +int _compat_aio_write(struct aiocb *aiocb)
 +ssize_t _compat_aio_return(struct aiocb *aiocb)
 +int _compat_aio_error(struct aiocb *aiocb)
 +int _compat_aio_cancel(int fd, struct aiocb *aiocb)

The names should not begin with an underscore.

This okay by C99, if we're going to rename the aioinit structure, we might as well just rename it all to qemu_aio_XX or something like that.

 +struct aiocb
 +{
 +    int aio_fildes;
 +    void *aio_buf;
 +    size_t aio_nbytes;
 +    struct sigevent aio_sigevent;
 +    off_t aio_offset;
 +
 +    /* private */
 +    TAILQ_ENTRY(aiocb) node;
 +    int is_write;
 +    ssize_t ret;
 +    int active;
 +};
 +
 +struct aioinit
 +{
 +    int aio_threads;
 +    int aio_num;
 +    int aio_idle_time;
 +};

These structs should probably be named qemu_aiocb and qemu_aioinit to
avoid conflict with system types.

I like to use unsigned types whenever possible, IIRC compilers may
generate better code with those.

Yeah, I don't disagree. I was trying to maintain glibc compatibility. That's not strictly necessary though.

Regards,

Anthony Liguori

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to