From: Paolo Bonzini <pbonzini@redhat.com>
To: Claudio Fontana <cfontana@suse.de>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Alex Bennée" <alex.bennee@linaro.org>,
qemu-devel@nongnu.org, "Pavel Dovgalyuk" <dovgaluk@ispras.ru>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Richard Henderson" <rth@twiddle.net>
Subject: Re: [PATCH v2 3/3] replay: do not build if TCG is not available
Date: Tue, 13 Oct 2020 10:05:41 +0200 [thread overview]
Message-ID: <2fb23024-6a20-2d0e-19e9-21e648212308@redhat.com> (raw)
In-Reply-To: <0c9eb5ef-5817-06f6-f622-09cb9a22505e@suse.de>
On 13/10/20 09:56, Claudio Fontana wrote:
> Hi Paolo,
>
> On 10/13/20 12:29 AM, Paolo Bonzini wrote:
>> On 12/10/20 23:45, Claudio Fontana wrote:
>>> + ctx = blk_get_aio_context(blk);
>>> + if (!replay_bh_schedule_oneshot_event(ctx, error_callback_bh, acb)) {
>>> + /* regular case without replay */
>>> + aio_bh_schedule_oneshot(ctx, error_callback_bh, acb);
>>> + }
>>
>> Why can't the stub just call aio_bh_schedule_oneshot?
>
> Absolutely, it can, I just considered the option and dropped it in the end.
>
>> This makes the API even more complicated.
>
> In my view not really, the API just returns a boolean that tells you if the event was consumed or not.
The question to ask is, is there _any_ other way to use
replay_bh_schedule_oneshot_event other than
if (!replay_bh_schedule_oneshot_event(ctx, error_callback_bh, acb)) {
aio_bh_schedule_oneshot(ctx, error_callback_bh, acb);
}
and I think there isn't. Your point of avoiding functional code in the stubs
is also valid though.
Perhaps you could have replay_bh_schedule_oneshot_event as you have it now, but
also add a wrapper (called for example replay_bh_schedule_oneshot) that takes
care of calling aio_bh_schedule_oneshot too. But in my opinion the "if" has
no place in block/io.c.
Paolo
> If people feel strongly that this is a wrong step, we can do the alternative and put production code inside the stubs, but it just seems wrong.
>
> Thanks!
>
> Ciao,
>
> Claudio
>
next prev parent reply other threads:[~2020-10-13 8:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-12 21:45 [PATCH v2 0/3] unbreak non-tcg builds Claudio Fontana
2020-10-12 21:45 ` [PATCH v2 1/3] tests/Makefile.include: " Claudio Fontana
2020-10-12 21:45 ` [PATCH v2 2/3] qtest: unbreak non-TCG builds in bios-tables-test Claudio Fontana
2020-10-12 21:45 ` [PATCH v2 3/3] replay: do not build if TCG is not available Claudio Fontana
2020-10-12 22:29 ` Paolo Bonzini
2020-10-13 7:56 ` Claudio Fontana
2020-10-13 8:05 ` Paolo Bonzini [this message]
2020-10-13 8:24 ` Claudio Fontana
2020-10-13 8:25 ` [PATCH v2 0/3] unbreak non-tcg builds Philippe Mathieu-Daudé
2020-10-13 8:28 ` Claudio Fontana
2020-10-13 8:50 ` Philippe Mathieu-Daudé
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=2fb23024-6a20-2d0e-19e9-21e648212308@redhat.com \
--to=pbonzini@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=cfontana@suse.de \
--cc=dovgaluk@ispras.ru \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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).