qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] virtio-blk: Avoid zeroing every request structu


From: Christoph Hellwig
Subject: Re: [Qemu-devel] [PATCH] virtio-blk: Avoid zeroing every request structure
Date: Sun, 16 May 2010 15:25:57 +0200
User-agent: Mutt/1.3.28i

On Fri, May 14, 2010 at 10:52:30PM +0100, Stefan Hajnoczi wrote:
> diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
> index b05d15e..d270225 100644
> --- a/hw/virtio-blk.c
> +++ b/hw/virtio-blk.c
> @@ -105,8 +105,10 @@ static void virtio_blk_flush_complete(void *opaque, int 
> ret)
>  
>  static VirtIOBlockReq *virtio_blk_alloc_request(VirtIOBlock *s)
>  {
> -    VirtIOBlockReq *req = qemu_mallocz(sizeof(*req));
> +    VirtIOBlockReq *req = qemu_malloc(sizeof(*req));
>      req->dev = s;
> +    req->qiov.size = 0;
> +    req->next = NULL;
>      return req;

Looks good, but you shouldn't even need to initialize req->qiov.size, we
do this later by calling qemu_iovec_init_external before using it.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]