* [PATCH] iotests: fix default MT detection
@ 2023-11-22 12:15 Andrey Drobyshev
2023-11-27 12:17 ` Kevin Wolf
0 siblings, 1 reply; 2+ messages in thread
From: Andrey Drobyshev @ 2023-11-22 12:15 UTC (permalink / raw)
To: qemu-block; +Cc: qemu-devel, hreitz, kwolf, andrey.drobyshev, den
MT is being detected based on "-M help" output, and we're searching for
the line ending with " (default)". However, in downstream one of the
MTs marked as deprecated might become the default, in which case this
logic breaks as the line would now end with " (default) (deprecated)".
To fix potential issues here, let's relax that requirement and detect
the mere presence of " (default)" line instead.
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
---
tests/qemu-iotests/testenv.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py
index e67ebd254b..3ff38f2661 100644
--- a/tests/qemu-iotests/testenv.py
+++ b/tests/qemu-iotests/testenv.py
@@ -40,7 +40,7 @@ def get_default_machine(qemu_prog: str) -> str:
machines = outp.split('\n')
try:
- default_machine = next(m for m in machines if m.endswith(' (default)'))
+ default_machine = next(m for m in machines if ' (default)' in m)
except StopIteration:
return ''
default_machine = default_machine.split(' ', 1)[0]
--
2.39.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] iotests: fix default MT detection
2023-11-22 12:15 [PATCH] iotests: fix default MT detection Andrey Drobyshev
@ 2023-11-27 12:17 ` Kevin Wolf
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2023-11-27 12:17 UTC (permalink / raw)
To: Andrey Drobyshev; +Cc: qemu-block, qemu-devel, hreitz, den
Am 22.11.2023 um 13:15 hat Andrey Drobyshev geschrieben:
> MT is being detected based on "-M help" output, and we're searching for
> the line ending with " (default)". However, in downstream one of the
> MTs marked as deprecated might become the default, in which case this
> logic breaks as the line would now end with " (default) (deprecated)".
> To fix potential issues here, let's relax that requirement and detect
> the mere presence of " (default)" line instead.
>
> Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Thanks, applied to the block branch. (I did however change "MT" to
"machine type" in the commit message because at first I was confused
what you meant with it.)
Kevin
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-11-27 12:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-22 12:15 [PATCH] iotests: fix default MT detection Andrey Drobyshev
2023-11-27 12:17 ` Kevin Wolf
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).