qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
	 Ronnie Sahlberg <ronniesahlberg@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Hanna Reitz <hreitz@redhat.com>
Subject: Re: [PATCH] block/iscsi: Document why we use raw malloc()
Date: Fri, 18 Aug 2023 17:00:30 +0100	[thread overview]
Message-ID: <CAFEAcA_LTGLA89MhrPS2FhtB71gw1UuZ4ZaZLPYtkCAsd2QKyA@mail.gmail.com> (raw)
In-Reply-To: <ZN+UwJ3/D5vKfxEe@redhat.com>

On Fri, 18 Aug 2023 at 16:56, Kevin Wolf <kwolf@redhat.com> wrote:
>
> Am 27.07.2023 um 17:15 hat Peter Maydell geschrieben:
> > On Thu, 27 Jul 2023 at 16:07, Peter Maydell <peter.maydell@linaro.org> wrote:
> > >
> > > In block/iscsi.c we use a raw malloc() call, which is unusual
> > > given the project standard is to use the glib memory allocation
> > > functions. Document why we do so, to avoid it being converted
> > > to g_malloc() by mistake.
> > >
> > > Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> > > ---
> > > There aren't many uses of raw malloc() in the codebase
> > > other than third-party library sourcecode. Mostly we have
> > > a comment noting when we're doing it deliberately.
>
> Thanks, applied to the block branch.
>
> > The other option here would be to use scsi_create_task(),
> > if we're OK with requiring libiscsi 1.13 or better (that's
> > 9 years old at this point, so should be OK...)
>
> I wouldn't mind either way, but since this patch exists and the other
> doesn't, I'm applying this one for now.

Thanks. I think scsi_create_task() would be cleaner, but
it's just over the amount of change that I'd want to do without
a test setup to exercise this code, which is why I stuck to
the comment for now.

-- PMM


      reply	other threads:[~2023-08-18 16:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-27 15:07 [PATCH] block/iscsi: Document why we use raw malloc() Peter Maydell
2023-07-27 15:15 ` Peter Maydell
2023-08-18 15:56   ` Kevin Wolf
2023-08-18 16:00     ` Peter Maydell [this message]

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=CAFEAcA_LTGLA89MhrPS2FhtB71gw1UuZ4ZaZLPYtkCAsd2QKyA@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --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).