From: Stefan Hajnoczi <stefanha@gmail.com>
To: Max Reitz <mreitz@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/3] block: Additional info string in ImageInfo and BDI
Date: Wed, 18 Sep 2013 16:59:18 +0200 [thread overview]
Message-ID: <20130918145918.GG25444@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1378382715-28132-2-git-send-email-mreitz@redhat.com>
On Thu, Sep 05, 2013 at 02:05:13PM +0200, Max Reitz wrote:
> diff --git a/block.c b/block.c
> index 26639e8..9fd9f3a 100644
> --- a/block.c
> +++ b/block.c
> @@ -1921,7 +1921,7 @@ void bdrv_round_to_clusters(BlockDriverState *bs,
> int64_t *cluster_sector_num,
> int *cluster_nb_sectors)
> {
> - BlockDriverInfo bdi;
> + BlockDriverInfo bdi = { .info_string = NULL };
>
> if (bdrv_get_info(bs, &bdi) < 0 || bdi.cluster_size == 0) {
> *cluster_sector_num = sector_num;
> @@ -1932,6 +1932,7 @@ void bdrv_round_to_clusters(BlockDriverState *bs,
> *cluster_nb_sectors = QEMU_ALIGN_UP(sector_num - *cluster_sector_num +
> nb_sectors, c);
> }
> + g_free(bdi.info_string);
> }
This function is called in the I/O path. It's not appropriate to
generate an options string each time this gets called :).
Together with Eric's comments it seems like this change needs a
different interface that is QMP-friendly and not in the I/O path.
Stefan
next prev parent reply other threads:[~2013-09-18 14:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-05 12:05 [Qemu-devel] [PATCH 0/3] Provide additional info through qemu-img info Max Reitz
2013-09-05 12:05 ` [Qemu-devel] [PATCH 1/3] block: Additional info string in ImageInfo and BDI Max Reitz
2013-09-05 12:25 ` Eric Blake
2013-09-05 12:52 ` Max Reitz
2013-09-18 14:59 ` Stefan Hajnoczi [this message]
2013-09-19 7:40 ` Max Reitz
2013-09-05 12:05 ` [Qemu-devel] [PATCH 2/3] qemu-iotests: info-string filter in _img_info Max Reitz
2013-09-05 12:05 ` [Qemu-devel] [PATCH 3/3] qemu-iotests: Additional info from qemu-img info Max Reitz
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=20130918145918.GG25444@stefanha-thinkpad.redhat.com \
--to=stefanha@gmail.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.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).