From: Stefan Hajnoczi <stefanha@gmail.com>
To: Alberto Garcia <berto@igalia.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
qemu-block@nongnu.org, Markus Armbruster <armbru@redhat.com>,
qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] block: make 'stats-intervals' a list of integers
Date: Mon, 16 Nov 2015 11:46:44 +0800 [thread overview]
Message-ID: <20151116034644.GD9498@stefanha-x1.localdomain> (raw)
In-Reply-To: <1447247832-14198-1-git-send-email-berto@igalia.com>
[-- Attachment #1: Type: text/plain, Size: 1318 bytes --]
On Wed, Nov 11, 2015 at 03:17:12PM +0200, Alberto Garcia wrote:
> @@ -583,32 +592,48 @@ static BlockBackend *blockdev_init(const char *file, QDict *bs_opts,
>
> block_acct_init(blk_get_stats(blk), account_invalid, account_failed);
>
> - if (stats_intervals) {
> - char **intervals = g_strsplit(stats_intervals, ":", 0);
> - unsigned i;
> + for (entry = qlist_first(interval_list); entry;
> + entry = qlist_next(entry)) {
This loop could be extracted into a separate function to avoid growing blockdev_init() further:
bool parse_stats_intervals(BlockAcctStats *stats, QList *intervals, Error **errp);
> @@ -617,10 +642,14 @@ static BlockBackend *blockdev_init(const char *file, QDict *bs_opts,
>
> err_no_bs_opts:
> qemu_opts_del(opts);
> + QDECREF(interval_dict);
> + QDECREF(interval_list);
> return blk;
>
> early_err:
> qemu_opts_del(opts);
> + QDECREF(interval_dict);
> + QDECREF(interval_list);
There is a codepath that reaches here without initializing interval_dict
or interval_list:
qemu_opts_absorb_qdict(opts, bs_opts, &error);
if (error) {
error_propagate(errp, error);
goto early_err;
}
interval_dict and interval_list should be initialized to NULL.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2015-11-16 3:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-11 13:17 [Qemu-devel] [PATCH] block: make 'stats-intervals' a list of integers Alberto Garcia
2015-11-11 15:32 ` [Qemu-devel] [PATCH for-2.5] " Eric Blake
2015-11-11 15:38 ` Alberto Garcia
2015-11-13 10:15 ` [Qemu-devel] [Qemu-block] [PATCH] " Stefan Hajnoczi
2015-11-13 10:50 ` Alberto Garcia
2015-11-16 3:47 ` Stefan Hajnoczi
2015-11-16 3:46 ` Stefan Hajnoczi [this message]
2015-11-16 8:28 ` Alberto Garcia
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=20151116034644.GD9498@stefanha-x1.localdomain \
--to=stefanha@gmail.com \
--cc=armbru@redhat.com \
--cc=berto@igalia.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--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).