From: Kevin Wolf <kwolf@redhat.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
qemu-devel@nongnu.org, qemu-block@nongnu.org,
"Eric Blake" <eblake@redhat.com>,
qemu-trivial@nongnu.org
Subject: Re: [PATCH-for-10.1] tests/qemu-iotests/tests/mirror-sparse: skip if O_DIRECT is not supported
Date: Wed, 6 Aug 2025 09:30:01 +0200 [thread overview]
Message-ID: <aJMEeVr1BU-abnNb@redhat.com> (raw)
In-Reply-To: <4f0a804d-d448-4dc0-97e1-20b3f669c8a2@tls.msk.ru>
Am 05.08.2025 um 19:56 hat Michael Tokarev geschrieben:
> On 05.08.2025 20:23, Philippe Mathieu-Daudé wrote:
>
> > > diff --git a/tests/qemu-iotests/tests/mirror-sparse b/tests/qemu-
> > > iotests/tests/mirror-sparse
> > > index cfcaa600ab..19843a622c 100755
> > > --- a/tests/qemu-iotests/tests/mirror-sparse
> > > +++ b/tests/qemu-iotests/tests/mirror-sparse
> > > @@ -41,6 +41,7 @@ _supported_fmt qcow2 raw # Format of the source.
> > > dst is always raw file
> > > _supported_proto file
> > > _supported_os Linux
> > > _require_disk_usage
> > > +_require_o_direct
> >
> > Could the correct use be:
> >
> > _supported_cache_modes none directsync
>
> Yes that works too. I've no idea which is "better" - we've
> a bit too many options here, I think. I'll change it to your
> suggestion.
No, _require_o_direct is better because it directly checks if files in
the scratch directory support O_DIRECT, which is what we need here
because the test unconditionally opens the file this way:
-blockdev '{"driver":"file", "cache":{"direct":true, "no-flush":false},
"filename":"'"$TEST_IMG.base"'", "node-name":"src-file"}' \
_supported_cache_modes is about the cache mode requested on the command
line when running qemu-iotests, which is not what we're interested in.
The relevant call doesn't even consider the command line option. It
still "fixes" the failure because requesting "none" or "directsync"
makes it do the O_DIRECT check, too.
But the effect is different: With "_supported_cache_modes none
directsync", the test will always be skipped if on the command line
"writeback" was requested (it's the default, so we'll skip the test by
default - that's a bad idea). With _require_o_direct it will only be
skipped if the filesystem really doesn't support O_DIRECT.
Kevin
next prev parent reply other threads:[~2025-08-06 7:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-01 12:28 [PATCH trivial] tests/qemu-iotests/tests/mirror-sparse: skip if O_DIRECT is not supported Michael Tokarev
2025-08-05 17:23 ` [PATCH-for-10.1] " Philippe Mathieu-Daudé
2025-08-05 17:56 ` Michael Tokarev
2025-08-06 7:30 ` Kevin Wolf [this message]
2025-08-06 7:33 ` 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=aJMEeVr1BU-abnNb@redhat.com \
--to=kwolf@redhat.com \
--cc=eblake@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=philmd@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@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).