diff mbox series

fuzz: specify audiodev for usb-audio

Message ID 20240527040711.311865-1-alxndr@bu.edu (mailing list archive)
State New, archived
Headers show
Series fuzz: specify audiodev for usb-audio | expand

Commit Message

Alexander Bulekov May 27, 2024, 4:07 a.m. UTC
Fixes test-failure on Fedora 40 CI.

Reported-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
---
 tests/qtest/fuzz/generic_fuzz_configs.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Thomas Huth May 27, 2024, 5:34 a.m. UTC | #1
On 27/05/2024 06.07, Alexander Bulekov wrote:
> Fixes test-failure on Fedora 40 CI.
> 
> Reported-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
> ---
>   tests/qtest/fuzz/generic_fuzz_configs.h | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/qtest/fuzz/generic_fuzz_configs.h b/tests/qtest/fuzz/generic_fuzz_configs.h
> index 4d7c8ca4ec..ef0ad95712 100644
> --- a/tests/qtest/fuzz/generic_fuzz_configs.h
> +++ b/tests/qtest/fuzz/generic_fuzz_configs.h
> @@ -150,7 +150,8 @@ const generic_fuzz_config predefined_configs[] = {
>           "-chardev null,id=cd0 -chardev null,id=cd1 "
>           "-device usb-braille,chardev=cd0 -device usb-ccid -device usb-ccid "
>           "-device usb-kbd -device usb-mouse -device usb-serial,chardev=cd1 "
> -        "-device usb-tablet -device usb-wacom-tablet -device usb-audio",
> +        "-device usb-tablet -device usb-wacom-tablet "
> +        "-device usb-audio,audiodev=snd0 -audiodev none,id=snd0",
>           .objects = "*usb* *uhci* *xhci*",
>       }

Reviewed-by: Thomas Huth <thuth@redhat.com>

The patch makes sense and I think we should include it, thanks! .. but I 
still don't understand why the behavior of the fuzzing job was different 
between Fedora 38 and 40, do you? Why does it complain about "no default 
audio driver available" on F40 but works fine on F38, though both build jobs 
include the Alsa, pulseaudio and OSS backends?

  Thomas
Alexander Bulekov May 27, 2024, 2:07 p.m. UTC | #2
On 240527 0734, Thomas Huth wrote:
> On 27/05/2024 06.07, Alexander Bulekov wrote:
> > Fixes test-failure on Fedora 40 CI.
> > 
> > Reported-by: Thomas Huth <thuth@redhat.com>
> > Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
> > ---
> >   tests/qtest/fuzz/generic_fuzz_configs.h | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tests/qtest/fuzz/generic_fuzz_configs.h b/tests/qtest/fuzz/generic_fuzz_configs.h
> > index 4d7c8ca4ec..ef0ad95712 100644
> > --- a/tests/qtest/fuzz/generic_fuzz_configs.h
> > +++ b/tests/qtest/fuzz/generic_fuzz_configs.h
> > @@ -150,7 +150,8 @@ const generic_fuzz_config predefined_configs[] = {
> >           "-chardev null,id=cd0 -chardev null,id=cd1 "
> >           "-device usb-braille,chardev=cd0 -device usb-ccid -device usb-ccid "
> >           "-device usb-kbd -device usb-mouse -device usb-serial,chardev=cd1 "
> > -        "-device usb-tablet -device usb-wacom-tablet -device usb-audio",
> > +        "-device usb-tablet -device usb-wacom-tablet "
> > +        "-device usb-audio,audiodev=snd0 -audiodev none,id=snd0",
> >           .objects = "*usb* *uhci* *xhci*",
> >       }
> 
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> 
> The patch makes sense and I think we should include it, thanks! .. but I
> still don't understand why the behavior of the fuzzing job was different
> between Fedora 38 and 40, do you? Why does it complain about "no default
> audio driver available" on F40 but works fine on F38, though both build jobs
> include the Alsa, pulseaudio and OSS backends?
> 

Yes that's strange, if the behavior is different.
The full config here is:

.args = "-machine q35 -nodefaults "
"-drive file=null-co://,if=none,format=raw,id=disk0 "
"-device qemu-xhci,id=xhci -device usb-tablet,bus=xhci.0 "
"-device usb-bot -device usb-storage,drive=disk0 "
"-chardev null,id=cd0 -chardev null,id=cd1 "
"-device usb-braille,chardev=cd0 -device usb-ccid -device usb-ccid "
"-device usb-kbd -device usb-mouse -device usb-serial,chardev=cd1 "
"-device usb-tablet -device usb-wacom-tablet "
"-device usb-audio"

This contains "nodefaults", which should always be causing the error,
since this change:
c753bf479a ("audio: disable default backends if -audio/-audiodev is used")

This adds audio to qemu_disable_default_devices, which should be called
by -nodefaults. I wonder if for some reason the order in which the
audiodev is configured and the default audiodev is disabled is different
between builds.
Alexander Bulekov May 27, 2024, 2:37 p.m. UTC | #3
On 240527 1007, Alexander Bulekov wrote:
> On 240527 0734, Thomas Huth wrote:
> > On 27/05/2024 06.07, Alexander Bulekov wrote:
> > > Fixes test-failure on Fedora 40 CI.
> > > 
> > > Reported-by: Thomas Huth <thuth@redhat.com>
> > > Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
> > > ---
> > >   tests/qtest/fuzz/generic_fuzz_configs.h | 3 ++-
> > >   1 file changed, 2 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/tests/qtest/fuzz/generic_fuzz_configs.h b/tests/qtest/fuzz/generic_fuzz_configs.h
> > > index 4d7c8ca4ec..ef0ad95712 100644
> > > --- a/tests/qtest/fuzz/generic_fuzz_configs.h
> > > +++ b/tests/qtest/fuzz/generic_fuzz_configs.h
> > > @@ -150,7 +150,8 @@ const generic_fuzz_config predefined_configs[] = {
> > >           "-chardev null,id=cd0 -chardev null,id=cd1 "
> > >           "-device usb-braille,chardev=cd0 -device usb-ccid -device usb-ccid "
> > >           "-device usb-kbd -device usb-mouse -device usb-serial,chardev=cd1 "
> > > -        "-device usb-tablet -device usb-wacom-tablet -device usb-audio",
> > > +        "-device usb-tablet -device usb-wacom-tablet "
> > > +        "-device usb-audio,audiodev=snd0 -audiodev none,id=snd0",
> > >           .objects = "*usb* *uhci* *xhci*",
> > >       }
> > 
> > Reviewed-by: Thomas Huth <thuth@redhat.com>
> > 
> > The patch makes sense and I think we should include it, thanks! .. but I
> > still don't understand why the behavior of the fuzzing job was different
> > between Fedora 38 and 40, do you? Why does it complain about "no default
> > audio driver available" on F40 but works fine on F38, though both build jobs
> > include the Alsa, pulseaudio and OSS backends?
> > 
> 
> Yes that's strange, if the behavior is different.
> The full config here is:
> 
> .args = "-machine q35 -nodefaults "
> "-drive file=null-co://,if=none,format=raw,id=disk0 "
> "-device qemu-xhci,id=xhci -device usb-tablet,bus=xhci.0 "
> "-device usb-bot -device usb-storage,drive=disk0 "
> "-chardev null,id=cd0 -chardev null,id=cd1 "
> "-device usb-braille,chardev=cd0 -device usb-ccid -device usb-ccid "
> "-device usb-kbd -device usb-mouse -device usb-serial,chardev=cd1 "
> "-device usb-tablet -device usb-wacom-tablet "
> "-device usb-audio"
> 
> This contains "nodefaults", which should always be causing the error,
> since this change:
> c753bf479a ("audio: disable default backends if -audio/-audiodev is used")
> 
> This adds audio to qemu_disable_default_devices, which should be called
> by -nodefaults. I wonder if for some reason the order in which the
> audiodev is configured and the default audiodev is disabled is different
> between builds.
> 

It might be even simpler. The recent jobs on Fedora 38 don't seem to
ever even make it to the xhci test, because of a detected leak:

https://gitlab.com/qemu-project/qemu/-/jobs/6949417820#L4375
diff mbox series

Patch

diff --git a/tests/qtest/fuzz/generic_fuzz_configs.h b/tests/qtest/fuzz/generic_fuzz_configs.h
index 4d7c8ca4ec..ef0ad95712 100644
--- a/tests/qtest/fuzz/generic_fuzz_configs.h
+++ b/tests/qtest/fuzz/generic_fuzz_configs.h
@@ -150,7 +150,8 @@  const generic_fuzz_config predefined_configs[] = {
         "-chardev null,id=cd0 -chardev null,id=cd1 "
         "-device usb-braille,chardev=cd0 -device usb-ccid -device usb-ccid "
         "-device usb-kbd -device usb-mouse -device usb-serial,chardev=cd1 "
-        "-device usb-tablet -device usb-wacom-tablet -device usb-audio",
+        "-device usb-tablet -device usb-wacom-tablet "
+        "-device usb-audio,audiodev=snd0 -audiodev none,id=snd0",
         .objects = "*usb* *uhci* *xhci*",
     },{
         .name = "pc-i440fx",