qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Peter Lieven <pl@dlhnet.de>
Cc: kwolf@redhat.com, Paolo Bonzini <pbonzini@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	ronnie sahlberg <ronniesahlberg@gmail.com>
Subject: Re: [Qemu-devel] [PATCH] iscsi: partly avoid iovec linearization in iscsi_aio_writev
Date: Tue, 20 Nov 2012 16:51:03 +0100	[thread overview]
Message-ID: <20121120155103.GA5676@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <50AA4917.5000402@dlhnet.de>

On Mon, Nov 19, 2012 at 03:58:31PM +0100, Peter Lieven wrote:
> libiscsi expects all write16 data in a linear buffer. If the
> iovec only contains one buffer we can skip the linearization
> step as well as the additional malloc/free and pass the
> buffer directly.
> 
> Reported-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
> Signed-off-by: Peter Lieven <pl@kamp.de>
> ---
>  block/iscsi.c |   24 +++++++++++++++---------
>  1 file changed, 15 insertions(+), 9 deletions(-)
> 
> diff --git a/block/iscsi.c b/block/iscsi.c
> index d0b1a10..f12148e 100644
> --- a/block/iscsi.c
> +++ b/block/iscsi.c
> @@ -199,8 +199,10 @@ iscsi_aio_write16_cb(struct iscsi_context *iscsi, int status,
>      trace_iscsi_aio_write16_cb(iscsi, status, acb, acb->canceled);
> -    g_free(acb->buf);
> -
> +    if (acb->buf != NULL) {
> +        g_free(acb->buf);
> +    }
> +

g_free(NULL) is a nop, so this change isn't necessary.  Poalo: Could be
done when merging the patch?

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

  parent reply	other threads:[~2012-11-20 15:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-19 14:58 [Qemu-devel] [PATCH] iscsi: partly avoid iovec linearization in iscsi_aio_writev Peter Lieven
2012-11-19 15:18 ` Paolo Bonzini
2012-11-19 15:23   ` Peter Lieven
2012-11-19 15:56   ` ronnie sahlberg
2012-11-20 15:51 ` Stefan Hajnoczi [this message]
2012-11-20 16:16   ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121120155103.GA5676@stefanha-thinkpad.redhat.com \
    --to=stefanha@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=pl@dlhnet.de \
    --cc=qemu-devel@nongnu.org \
    --cc=ronniesahlberg@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).