From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: Max Reitz <mreitz@redhat.com>,
qemu-block@nongnu.org, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, armbru@redhat.com, eblake@redhat.com,
jsnow@redhat.com, famz@redhat.com, den@openvz.org,
stefanha@redhat.com, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH 07/22] qcow2-bitmap: introduce auto-loading bitmaps
Date: Sat, 15 Oct 2016 20:22:43 +0300 [thread overview]
Message-ID: <580265E3.8080003@virtuozzo.com> (raw)
In-Reply-To: <4f380514-85b2-e261-fd4d-da81867f2369@redhat.com>
On 15.10.2016 20:03, Max Reitz wrote:
> On 14.10.2016 20:44, Vladimir Sementsov-Ogievskiy wrote:
>> On 01.10.2016 19:26, Max Reitz wrote:
>>> On 30.09.2016 12:53, Vladimir Sementsov-Ogievskiy wrote:
>>>> Auto loading bitmaps are bitmaps in Qcow2, with AUTO flag set. They are
>> ...
>>
>>> + goto fail;
>>> + }
>>> +
>>> + /* loop is safe because next entry offset is calculated after
>>> conversion to
>>> Should it be s/safe/unsafe/?
>> loop is safe. _unsafe is related to absence of assert in a loop, as it
>> loops through BE data. Bad wording, I'll change it somehow..
> Yes, I know that the loop is safe in the sense of the word "safe", but I
> meant that it's kind of confusing that the loop uses
> "for_each_bitmap_dir_entry_unsafe" and thus is "unsafe", too.
>
> Another idea would be to write "This is actually safe" instead of "loop
> is safe".
Finally I've decided to introduce normal list of normal structures like
in snapshots..
>
>>>> + * cpu format */
>>>> + for_each_bitmap_dir_entry_unsafe(e, dir, size) {
>>>> + if ((uint8_t *)(e + 1) > dir_end) {
>>>> + goto broken_dir;
>>>> + }
>>>> +
>>>> + bitmap_dir_entry_to_cpu(e);
>>>> +
>>>> + if ((uint8_t *)next_dir_entry(e) > dir_end) {
>>>> + goto broken_dir;
>>>> + }
>>>> +
>>>> + if (e->extra_data_size != 0) {
>>>> + error_setg(errp, "Can't load bitmap '%.*s' from '%s':"
>>>> + "extra data not supported.", e->name_size,
>>> Full stop again.
>>>
>>> Also, I'm not quite sure why you give the device/node name here. You
>>> don't do that anywhere else and I think if we want to emit the
>>> information where something failed, it should be added at some previous
>>> point in the call chain.
>> For example, how? As I understand, I can emit it only by error_setg, so
>> actually it would be better to add node and bitmap name to all
>> error_setg in the code.. or create helper function for it.
> error_prepend() would be the function.
>
> This code will be invoked by any code that is opening an image. There
> are of course a couple of places where that can be the case: For
> external tools such as qemu-img, it's normally pretty clear which image
> is meant (and it additionally uses error_reportf_err() to give you more
> information).
>
> For -drive, every error message will at least be prepended by the
> corresponding -drive parameter, so that will help a bit.
>
> blockdev-add, unfortunately, doesn't do anything like this. But the user
> can of course choose to construct the BDS graph node by node and thus
> always know which node an error originates from.
>
> Anyway, if you want to add this information to every error message, you
> should probably do so in bdrv_open_inherit(). The issue I'd take with
> this is that most users probably won't set the node name themselves
> (either they don't at all or it's some management tool that does), so
> reporting the node name doesn't actually help them at all (and
> management tools are not supposed to parse error messages, so it won't
> help in that case either).
>
> Max
>
Thanks for explanations, and for the whole review, it's great! Sorry for
my laziness and for spelling(
O! I've discovered vim spell, so one problem less, I hope.
--
Best regards,
Vladimir
next prev parent reply other threads:[~2016-10-15 17:23 UTC|newest]
Thread overview: 100+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-30 10:53 [Qemu-devel] [PATCH v7 00/22] qcow2: persistent dirty bitmaps Vladimir Sementsov-Ogievskiy
2016-09-30 10:53 ` [Qemu-devel] [PATCH 01/22] hbitmap: improve dirty iter Vladimir Sementsov-Ogievskiy
2016-10-01 13:52 ` Max Reitz
2016-09-30 10:53 ` [Qemu-devel] [PATCH 02/22] tests: add hbitmap iter test Vladimir Sementsov-Ogievskiy
2016-10-01 14:02 ` Max Reitz
2016-09-30 10:53 ` [Qemu-devel] [PATCH 03/22] block: fix bdrv_dirty_bitmap_granularity signature Vladimir Sementsov-Ogievskiy
2016-09-30 10:53 ` [Qemu-devel] [PATCH 04/22] block/dirty-bitmap: add deserialize_ones func Vladimir Sementsov-Ogievskiy
2016-09-30 10:53 ` [Qemu-devel] [PATCH 05/22] qcow2-bitmap: structs and consts Vladimir Sementsov-Ogievskiy
2016-10-01 14:34 ` Max Reitz
2016-10-01 14:56 ` Max Reitz
2016-10-07 13:11 ` Vladimir Sementsov-Ogievskiy
2016-10-11 11:50 ` Vladimir Sementsov-Ogievskiy
2016-10-12 18:20 ` Max Reitz
2016-09-30 10:53 ` [Qemu-devel] [PATCH 06/22] qcow2: add dirty bitmaps extension Vladimir Sementsov-Ogievskiy
2016-10-01 14:46 ` Max Reitz
2016-10-11 12:09 ` Vladimir Sementsov-Ogievskiy
2016-10-12 18:21 ` Max Reitz
2016-10-13 12:18 ` Vladimir Sementsov-Ogievskiy
2016-09-30 10:53 ` [Qemu-devel] [PATCH 07/22] qcow2-bitmap: introduce auto-loading bitmaps Vladimir Sementsov-Ogievskiy
2016-10-01 16:26 ` Max Reitz
2016-10-14 18:44 ` Vladimir Sementsov-Ogievskiy
2016-10-15 17:03 ` Max Reitz
2016-10-15 17:22 ` Vladimir Sementsov-Ogievskiy [this message]
2016-10-20 12:22 ` Vladimir Sementsov-Ogievskiy
2016-10-21 19:49 ` Max Reitz
2016-10-07 19:25 ` Max Reitz
2016-10-21 11:59 ` Vladimir Sementsov-Ogievskiy
2016-10-21 19:56 ` Max Reitz
2016-09-30 10:53 ` [Qemu-devel] [PATCH 08/22] block/dirty-bitmap: add autoload field to BdrvDirtyBitmap Vladimir Sementsov-Ogievskiy
2016-10-07 17:05 ` Max Reitz
2016-09-30 10:53 ` [Qemu-devel] [PATCH 09/22] block: introduce persistent dirty bitmaps Vladimir Sementsov-Ogievskiy
2016-10-07 17:54 ` Max Reitz
2016-10-11 13:11 ` Vladimir Sementsov-Ogievskiy
2016-10-12 18:24 ` Max Reitz
2016-10-07 19:28 ` Max Reitz
2016-10-12 11:38 ` Vladimir Sementsov-Ogievskiy
2016-10-12 12:30 ` Vladimir Sementsov-Ogievskiy
2016-10-12 18:25 ` Max Reitz
2016-09-30 10:53 ` [Qemu-devel] [PATCH 10/22] block/dirty-bitmap: add bdrv_dirty_bitmap_next() Vladimir Sementsov-Ogievskiy
2016-10-07 18:11 ` Max Reitz
2016-09-30 10:53 ` [Qemu-devel] [PATCH 11/22] qcow2-bitmap: add qcow2_store_persistent_bitmaps() Vladimir Sementsov-Ogievskiy
2016-10-07 19:24 ` Max Reitz
2016-10-13 16:48 ` Vladimir Sementsov-Ogievskiy
2016-10-15 16:40 ` Max Reitz
2016-10-17 17:19 ` Vladimir Sementsov-Ogievskiy
2016-10-21 19:44 ` Max Reitz
2016-10-21 21:04 ` Eric Blake
2016-10-17 17:57 ` Vladimir Sementsov-Ogievskiy
2016-10-17 17:58 ` [Qemu-devel] DROP THIS " Vladimir Sementsov-Ogievskiy
2016-09-30 10:53 ` [Qemu-devel] [PATCH 12/22] qcow2-bitmap: add IN_USE flag Vladimir Sementsov-Ogievskiy
2016-10-07 19:44 ` Max Reitz
2016-10-21 15:34 ` Vladimir Sementsov-Ogievskiy
2016-10-21 19:58 ` Max Reitz
2016-10-24 10:32 ` Vladimir Sementsov-Ogievskiy
2016-10-24 11:35 ` Vladimir Sementsov-Ogievskiy
2016-10-24 17:08 ` Max Reitz
2016-10-24 17:18 ` Max Reitz
2016-10-25 10:53 ` Vladimir Sementsov-Ogievskiy
2016-10-26 9:04 ` Vladimir Sementsov-Ogievskiy
2016-10-26 9:21 ` Vladimir Sementsov-Ogievskiy
2016-10-26 12:13 ` Vladimir Sementsov-Ogievskiy
2016-10-26 13:02 ` Vladimir Sementsov-Ogievskiy
2016-10-26 15:28 ` Max Reitz
2016-11-07 16:12 ` Vladimir Sementsov-Ogievskiy
2016-11-07 16:18 ` Max Reitz
2016-10-24 16:54 ` Max Reitz
2016-09-30 10:53 ` [Qemu-devel] [PATCH 13/22] qcow2-bitmap: check constraints Vladimir Sementsov-Ogievskiy
2016-10-07 19:54 ` Max Reitz
2016-09-30 10:53 ` [Qemu-devel] [PATCH 14/22] qcow2: delete bitmaps on truncate Vladimir Sementsov-Ogievskiy
2016-10-07 19:58 ` Max Reitz
2016-09-30 10:53 ` [Qemu-devel] [PATCH 15/22] qcow2-bitmap: add autoclear bit Vladimir Sementsov-Ogievskiy
2016-10-07 20:11 ` Max Reitz
2016-10-24 14:25 ` Vladimir Sementsov-Ogievskiy
2016-10-24 17:21 ` Max Reitz
2016-09-30 10:53 ` [Qemu-devel] [PATCH 16/22] qmp: add persistent flag to block-dirty-bitmap-add Vladimir Sementsov-Ogievskiy
2016-10-07 19:52 ` Eric Blake
2016-10-24 14:44 ` Vladimir Sementsov-Ogievskiy
2016-10-10 16:08 ` Max Reitz
2016-10-24 15:12 ` Vladimir Sementsov-Ogievskiy
2016-10-24 17:30 ` Max Reitz
2016-10-25 11:05 ` Vladimir Sementsov-Ogievskiy
2016-09-30 10:53 ` [Qemu-devel] [PATCH 17/22] qmp: add autoload parameter " Vladimir Sementsov-Ogievskiy
2016-10-07 19:53 ` Eric Blake
2016-10-10 16:25 ` Max Reitz
2016-10-24 15:55 ` Vladimir Sementsov-Ogievskiy
2016-09-30 10:53 ` [Qemu-devel] [PATCH 18/22] qapi: add md5 checksum of last dirty bitmap level to query-block Vladimir Sementsov-Ogievskiy
2016-10-10 16:44 ` Max Reitz
2016-10-10 17:03 ` Max Reitz
2016-10-10 19:22 ` Eric Blake
2016-09-30 10:53 ` [Qemu-devel] [PATCH 19/22] iotests: test qcow2 persistent dirty bitmap Vladimir Sementsov-Ogievskiy
2016-10-10 17:04 ` Max Reitz
2016-09-30 10:53 ` [Qemu-devel] [PATCH 20/22] qcow2-dirty-bitmap: refcounts Vladimir Sementsov-Ogievskiy
2016-10-10 17:59 ` Max Reitz
2016-09-30 10:53 ` [Qemu-devel] [PATCH 21/22] specs/qcow2: fix bitmap granularity qemu-specific note Vladimir Sementsov-Ogievskiy
2016-10-07 20:18 ` Eric Blake
2016-11-09 16:43 ` Vladimir Sementsov-Ogievskiy
2016-09-30 10:53 ` [Qemu-devel] [PATCH 22/22] specs/qcow2: do not use wording 'bitmap header' Vladimir Sementsov-Ogievskiy
2016-10-07 20:20 ` Eric Blake
2016-10-01 13:37 ` [Qemu-devel] [PATCH v7 00/22] qcow2: persistent dirty bitmaps Max Reitz
2016-10-13 18:11 ` John Snow
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=580265E3.8080003@virtuozzo.com \
--to=vsementsov@virtuozzo.com \
--cc=armbru@redhat.com \
--cc=den@openvz.org \
--cc=eblake@redhat.com \
--cc=famz@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@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).