From: Max Reitz <mreitz@redhat.com>
To: Marc Olson <marcolso@amazon.com>, qemu-devel@nongnu.org
Cc: jsnow@redhat.com, qemu-block@nongnu.org,
Kevin Wolf <kwolf@redhat.com>, Eric Blake <eblake@redhat.com>,
Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 3/3] blkdebug: Add latency injection rule type
Date: Wed, 13 Feb 2019 22:12:12 +0100 [thread overview]
Message-ID: <27c761fc-59e0-785c-f6ea-d022baa11c96@redhat.com> (raw)
In-Reply-To: <c2965971-4e19-8d68-d57a-6ee28ecfe22e@amazon.com>
[-- Attachment #1: Type: text/plain, Size: 6537 bytes --]
On 13.02.19 21:49, Marc Olson wrote:
> On 2/13/19 7:48 AM, Max Reitz wrote:
>> On 12.02.19 22:21, Marc Olson wrote:
>>> On 1/11/19 7:00 AM, Max Reitz wrote:
>>>> On 12.11.18 08:06, Marc Olson wrote:
>> [...]
>>
>>>>> diff --git a/qapi/block-core.json b/qapi/block-core.json
>>>>> index d4fe710..72f7861 100644
>>>>> --- a/qapi/block-core.json
>>>>> +++ b/qapi/block-core.json
>>>>> @@ -3057,6 +3057,34 @@
>>>>> '*immediately': 'bool' } }
>>>>> ##
>>>>> +# @BlkdebugDelayOptions:
>>>>> +#
>>>>> +# Describes a single latency injection for blkdebug.
>>>>> +#
>>>>> +# @event: trigger event
>>>>> +#
>>>>> +# @state: the state identifier blkdebug needs to be in to
>>>>> +# actually trigger the event; defaults to "any"
>>>>> +#
>>>>> +# @latency: The delay to add to an I/O, in microseconds.
>>>>> +#
>>>>> +# @sector: specifies the sector index which has to be affected
>>>>> +# in order to actually trigger the event; defaults to
>>>>> "any
>>>>> +# sector"
>>>>> +#
>>>>> +# @once: disables further events after this one has been
>>>>> +# triggered; defaults to false
>>>>> +#
>>>>> +# Since: 3.1
>>>> Well, 4.0 now, sorry...
>>> Baking version numbers into code is downright silly. Every single
>>> version of this patch has made a comment along the lines of, "oops, it
>>> didn't get reviewed in time for the next version bump, so you have to
>>> resubmit." With a fast moving project, this is nonsense. If you're
>>> looking at the code, you should have access to the git history as well
>>> to determine the version.
>> True, but these comments are used to generate documentation (e.g.
>> docs/interopt/qemu-qmp-ref.7 in the build directory). So they are used
>> by people who don't have access to the git history.
>>
>> It might be possible to generate that information from git-blame when
>> generating the documentation, but how would trivial fixes be handled
>> that are no functional changes? For instance, it seems difficult to me
>> to distinguish between a spelling change for some parameter description
>> and a change in behavior.
>>
>> (Then again, we shouldn't have such behavioral changes, hm.)
>>
>> To me personally, the easiest thing would seem to be some convention to
>> write ***INSERT VERSION HERE*** into the code and then the maintainer
>> can just find an replace all instances of that when applying the
>> patches. But that sounds a bit silly...
>>
>> (I don't have an issue with adjusting the version numbers myself as they
>> are, but it's just as hard for me to find and replace all of them as it
>> is for you. And since you're probably going to send a v4 anyway...)
>>
>> In the end, it's up to the QAPI maintainers.
>
> IFF I submit by the end of the week, what version number shall I choose?
4.0 is still the next one.
>> [...]
>>
>>>>> diff --git a/tests/qemu-iotests/071 b/tests/qemu-iotests/071
>>>>> index 48b4955..976f747 100755
>>>>> --- a/tests/qemu-iotests/071
>>>>> +++ b/tests/qemu-iotests/071
>>>>> @@ -100,6 +100,69 @@ $QEMU_IO -c "open -o
>>>>> driver=$IMGFMT,file.driver=blkdebug,file.inject-error.event
>>>>> -c 'read -P 42 0x38000 512'
>>>>> echo
>>>>> +echo "=== Testing blkdebug latency through filename ==="
>>>>> +echo
>>>>> +
>>>>> +$QEMU_IO -c "open -o
>>>>> file.driver=blkdebug,file.inject-delay.event=write_aio,file.inject-delay.latency=10000
>>>>>
>>>>> $TEST_IMG" \
>>>>> + -c 'aio_write -P 42 0x28000 512' \
>>>>> + -c 'aio_read -P 42 0x38000 512' \
>>>>> + | _filter_qemu_io
>>>>> +
>>>>> +echo
>>>>> +echo "=== Testing blkdebug latency through file blockref ==="
>>>>> +echo
>>>>> +
>>>>> +$QEMU_IO -c "open -o
>>>>> driver=$IMGFMT,file.driver=blkdebug,file.inject-delay.event=write_aio,file.inject-delay.latency=10000,file.image.filename=$TEST_IMG"
>>>>>
>>>>> \
>>>>> + -c 'aio_write -P 42 0x28000 512' \
>>>>> + -c 'aio_read -P 42 0x38000 512' \
>>>>> + | _filter_qemu_io
>>>>> +
>>>>> +# Using QMP is synchronous by default, so even though we would
>>>>> +# expect reordering due to using the aio_* commands, they are
>>>>> +# not. The purpose of this test is to verify that the driver
>>>>> +# can be setup via QMP, and IO can complete. See the qemu-io
>>>>> +# test above to prove delay functionality
>>>> But it doesn't prove that because the output is filtered. To prove it,
>>>> you'd probably need to use null-co as the protocol (so there is as
>>>> little noise as possible) and then parse the qemu-io output to show
>>>> that
>>>> the time is always above 10 ms.
>>>>
>>>> I leave it to you whether you'd like to go through that pain.
>>> There's not a great way to prove it without doing a lot of parsing
>>> changes in testing. I'll consider an update to this patch, but I think
>>> this series has carried on long enough.
>> I agree in this instance, but I'd like to note still that "this series
>> has carried on long enough" is not an argument to merge bad code (or
>> something incomplete without promise of a follow-up). This is just a
>> test for blkdebug, though, so it's OK (with the comment fixed, because
>> it doesn't prove anything).
> I wasn't implying that it's ok to merge bad code, but that at some point
> we have to just paint the shed a color and move on. At the risk of
> excess drama, at what point does a small addition become a complete
> tear-down and rebuild?
Depends on the case whether a tear down is necessary. :-)
>> (I'm sorry for not having looked at this series for so long, but qemu is
>> not my own, so it isn't like I could pay for my wrong by accepting
>> something incomplete -- if it were more important than this single test
>> case.)
>>
>> Also, we do support Python for iotests, and parsing should be simpler
>> there. Since blkdebug is just a debugging driver, I'm fine with not
>> knowing whether its features work, though.
>>
>> Maybe I'll write the test, that would kind of pay for my wrong...
>
> I think the real fix is to make QMP support async IO, but if you'd like
> to do more parsing, that's fine too.
Hm, yeah, that would work, too. But that's definitely more complicated
than a bit of parsing...
Max
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2019-02-13 21:12 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-12 7:06 [Qemu-devel] [PATCH v3 1/3] blkdebug: fix one shot rule processing Marc Olson
2018-11-12 7:06 ` [Qemu-devel] [PATCH v3 2/3] blkdebug: Extend rule check for additional types Marc Olson
2018-11-13 23:22 ` John Snow
2018-11-13 23:34 ` Marc Olson
2018-11-13 23:38 ` John Snow
2019-01-11 14:41 ` Max Reitz
2018-11-12 7:06 ` [Qemu-devel] [PATCH v3 3/3] blkdebug: Add latency injection rule type Marc Olson
2018-11-13 23:57 ` John Snow
2019-01-11 15:00 ` Max Reitz
2019-02-12 21:21 ` Marc Olson
2019-02-13 15:48 ` Max Reitz
2019-02-13 20:49 ` Marc Olson
2019-02-13 21:12 ` Max Reitz [this message]
2019-02-14 6:39 ` Markus Armbruster
2018-11-12 11:15 ` [Qemu-devel] [PATCH v3 1/3] blkdebug: fix one shot rule processing Dongli Zhang
2018-11-13 23:00 ` John Snow
2019-01-11 14:36 ` 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=27c761fc-59e0-785c-f6ea-d022baa11c96@redhat.com \
--to=mreitz@redhat.com \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=marcolso@amazon.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).