From: Eric Blake <eblake@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, mreitz@redhat.com,
Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v5 6/7] blkdebug: Add ability to override unmap geometries
Date: Tue, 7 Mar 2017 15:14:58 -0600 [thread overview]
Message-ID: <9f1103c9-142b-85c5-bc29-69110407136e@redhat.com> (raw)
In-Reply-To: <20170215162007.GF4935@noname.redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2766 bytes --]
On 02/15/2017 10:20 AM, Kevin Wolf wrote:
> Am 14.02.2017 um 20:25 hat Eric Blake geschrieben:
>> Make it easier to simulate various unusual hardware setups (for
>> example, recent commits 3482b9b and b8d0a98 affect the Dell
>> Equallogic iSCSI with its 15M preferred and maximum unmap and
>> write zero sizing, or b2f95fe deals with the Linux loopback
>> block device having a max_transfer of 64k), by allowing blkdebug
>> to wrap any other device with further restrictions on various
>> alignments.
>>
>> Signed-off-by: Eric Blake <eblake@redhat.com>
>>
>> # @inject-error: #optional array of error injection descriptions
>> #
>> # @set-state: #optional array of state-change descriptions
>> @@ -2472,7 +2493,9 @@
>> { 'struct': 'BlockdevOptionsBlkdebug',
>> 'data': { 'image': 'BlockdevRef',
>> '*config': 'str',
>> - '*align': 'int',
>> + '*align': 'int', '*max-transfer': 'int32',
>> + '*opt-write-zero': 'int32', '*max-write-zero': 'int32',
>> + '*opt-discard': 'int32', '*max-discard': 'int32',
>
> Hm, strictly speaking, this schema allows for negative values. Should we
> document that they aren't allowed?
Doesn't power of two imply positive? But yes, I can tweak the wording.
>> - /* Set request alignment */
>> + /* Set alignment overrides */
>> s->align = qemu_opt_get_size(opts, "align", 0);
>> if (s->align && (s->align >= INT_MAX || !is_power_of_2(s->align))) {
>> error_setg(errp, "Invalid alignment, align must be integer power of 2");
>> goto fail_unref;
>> }
>> + align = MAX(s->align, bs->file->bs->bl.request_alignment);
>> +
>> + s->max_transfer = qemu_opt_get_size(opts, "max-transfer", 0);
>> + if (s->max_transfer &&
>> + (s->max_transfer >= INT_MAX ||
>> + !QEMU_IS_ALIGNED(s->max_transfer, align))) {
>> + error_setg(errp, "Invalid max-transfer, must be multiple of align");
>
> It's not that I'm generally a friend of unspecific messages, but in this
> case I think I would prefer being unspecific to the potentially wrong
> error message that is returned here. We're checking multiple conditions
> and the error message mentions only one of them as the reason, which may
> or may not be the right one.
>
> This is the same for all new options.
I'm leaning towards "Cannot meet constraints with max-transfer %lld" as
being non-specific enough to cover all the cases while still describing
the problem to be fixed. Any other wording suggestions would be
welcome, if someone has a particular bikeshed color they like.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2017-03-07 21:15 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-14 19:25 [Qemu-devel] [PATCH v5 0/7] add blkdebug tests Eric Blake
2017-02-14 19:25 ` [Qemu-devel] [PATCH v5 1/7] qcow2: Assert that cluster operations are aligned Eric Blake
2017-02-15 12:25 ` Kevin Wolf
2017-03-06 23:34 ` Eric Blake
2017-02-14 19:25 ` [Qemu-devel] [PATCH v5 2/7] qcow2: Discard/zero clusters by byte count Eric Blake
2017-02-15 15:46 ` Kevin Wolf
2017-02-14 19:25 ` [Qemu-devel] [PATCH v5 3/7] blkdebug: Sanity check block layer guarantees Eric Blake
2017-02-14 19:25 ` [Qemu-devel] [PATCH v5 4/7] blkdebug: Add pass-through write_zero and discard support Eric Blake
2017-02-15 15:53 ` Kevin Wolf
2017-02-14 19:25 ` [Qemu-devel] [PATCH v5 5/7] blkdebug: Simplify override logic Eric Blake
2017-02-15 15:58 ` Kevin Wolf
2017-02-14 19:25 ` [Qemu-devel] [PATCH v5 6/7] blkdebug: Add ability to override unmap geometries Eric Blake
2017-02-15 16:20 ` Kevin Wolf
2017-03-07 21:14 ` Eric Blake [this message]
2017-02-14 19:25 ` [Qemu-devel] [PATCH v5 7/7] tests: Add coverage for recent block geometry fixes Eric Blake
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=9f1103c9-142b-85c5-bc29-69110407136e@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=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).