From: Kevin Wolf <kwolf@redhat.com>
To: Max Reitz <mreitz@redhat.com>
Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH for-2.10 1/3] block: Add errp to b{lk, drv}_truncate()
Date: Tue, 7 Mar 2017 11:47:48 +0100 [thread overview]
Message-ID: <20170307104748.GG5871@noname.str.redhat.com> (raw)
In-Reply-To: <20170306195407.16415-1-mreitz@redhat.com>
Am 06.03.2017 um 20:54 hat Max Reitz geschrieben:
> For one thing, this allows us to drop the error message generation from
> qemu-img.c and blockdev.c and instead have it unified in
> bdrv_truncate().
>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> block/commit.c | 5 +++--
> block/mirror.c | 2 +-
These still pass NULL after the series. Fixing it would require to add a
way to complete jobs with an Error object, but maybe we should do this
sooner or later anyway. Not necessarily part of this series, though.
> block/vhdx.c | 6 +++---
> block/vpc.c | 2 +-
vpc can easily be fixed to pass the actual errp from vpc_create() to the
blk_truncate() call. In vhdx.c, the blk_truncate() call is a bit more
deeply nested, but it doesn't seem completely unreasonable there either.
> --- a/qemu-io-cmds.c
> +++ b/qemu-io-cmds.c
> @@ -1569,7 +1569,7 @@ static int truncate_f(BlockBackend *blk, int argc, char **argv)
> return 0;
> }
>
> - ret = blk_truncate(blk, offset);
> + ret = blk_truncate(blk, offset, NULL);
> if (ret < 0) {
> printf("truncate: %s\n", strerror(-ret));
> return 0;
Come on, using NULL immediately before a printf()? Doing the right thing
here is trivial.
Kevin
next prev parent reply other threads:[~2017-03-07 10:47 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-06 19:52 [Qemu-devel] [PATCH for-2.10 0/3] block: Add errp to b{lk, drv}_turncate() Max Reitz
2017-03-06 19:54 ` [Qemu-devel] [PATCH for-2.10 1/3] block: Add errp to b{lk, drv}_truncate() Max Reitz
2017-03-07 10:47 ` Kevin Wolf [this message]
2017-03-08 16:04 ` Max Reitz
2017-03-08 17:04 ` Max Reitz
2017-03-06 19:54 ` [Qemu-devel] [PATCH for-2.10 2/3] block: Add errp to BD.bdrv_truncate() Max Reitz
2017-03-06 21:08 ` Max Reitz
2017-03-06 19:54 ` [Qemu-devel] [PATCH for-2.10 3/3] block: Add some bdrv_truncate() error messages Max Reitz
2017-03-06 20:09 ` Eric Blake
2017-03-06 20:14 ` Max Reitz
2017-03-06 20:21 ` Eric Blake
2017-03-06 20:48 ` Max Reitz
2017-03-06 20:53 ` Eric Blake
2017-03-07 10:34 ` Kevin Wolf
2017-03-06 19:58 ` [Qemu-devel] [PATCH for-2.10 0/3] block: Add errp to b{lk, drv}_turncate() no-reply
2017-03-06 21:14 ` 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=20170307104748.GG5871@noname.str.redhat.com \
--to=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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).