All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [XEN PATCH 0/2] libxl: replace deprecated -sdl and -soundhw qemu options
@ 2022-08-08 11:05 Anthony PERARD
  2022-08-08 11:05 ` [XEN PATCH 1/2] tools/libxl: Replace deprecated -sdl option on QEMU command line Anthony PERARD
  2022-08-08 11:05 ` [XEN PATCH 2/2] tools/libxl: Replace deprecated -soundhw " Anthony PERARD
  0 siblings, 2 replies; 7+ messages in thread
From: Anthony PERARD @ 2022-08-08 11:05 UTC (permalink / raw
  To: xen-devel; +Cc: Jan Beulich, Anthony PERARD, Juergen Gross, Wei Liu

Patch series available in this git branch:
https://xenbits.xen.org/git-http/people/aperard/xen-unstable.git br.qemu-deprecated-soundhw-v1

Hi,

There's some more QEMU options that are deprecated. We still don't need to
figure out which QEMU version we are going to run as the options that replace
them already existed in QEMU 1.0, so all the version QEMU upstream that we
could possible use as device model.

Thanks,

Anthony PERARD (2):
  tools/libxl: Replace deprecated -sdl option on QEMU command line
  tools/libxl: Replace deprecated -soundhw on QEMU command line

 docs/man/xl.cfg.5.pod.in                  |  6 +++---
 tools/libs/light/libxl_types_internal.idl | 10 ++++++++++
 tools/libs/light/libxl_dm.c               | 21 +++++++++++++++++++--
 3 files changed, 32 insertions(+), 5 deletions(-)

-- 
Anthony PERARD



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [XEN PATCH 1/2] tools/libxl: Replace deprecated -sdl option on QEMU command line
  2022-08-08 11:05 [XEN PATCH 0/2] libxl: replace deprecated -sdl and -soundhw qemu options Anthony PERARD
@ 2022-08-08 11:05 ` Anthony PERARD
  2022-08-09 12:08   ` Jason Andryuk
  2022-08-08 11:05 ` [XEN PATCH 2/2] tools/libxl: Replace deprecated -soundhw " Anthony PERARD
  1 sibling, 1 reply; 7+ messages in thread
From: Anthony PERARD @ 2022-08-08 11:05 UTC (permalink / raw
  To: xen-devel; +Cc: Jan Beulich, Anthony PERARD, Wei Liu, Juergen Gross

"-sdl" is deprecated upstream since 6695e4c0fd9e ("softmmu/vl:
Deprecate the -sdl and -curses option"), QEMU v6.2, and the option is
removed by 707d93d4abc6 ("ui: Remove deprecated options "-sdl" and
"-curses""), in upcoming QEMU v7.1.

Instead, use "-display sdl", available since 1472a95bab1e ("Introduce
-display argument"), before QEMU v1.0.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libs/light/libxl_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
index 1864ee30f0..04bf5d8563 100644
--- a/tools/libs/light/libxl_dm.c
+++ b/tools/libs/light/libxl_dm.c
@@ -1349,7 +1349,7 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
     flexarray_append_pair(dm_args, "-display", "none");
 
     if (sdl && !is_stubdom) {
-        flexarray_append(dm_args, "-sdl");
+        flexarray_append_pair(dm_args, "-display", "sdl");
         if (sdl->display)
             flexarray_append_pair(dm_envs, "DISPLAY", sdl->display);
         if (sdl->xauthority)
-- 
Anthony PERARD



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [XEN PATCH 2/2] tools/libxl: Replace deprecated -soundhw on QEMU command line
  2022-08-08 11:05 [XEN PATCH 0/2] libxl: replace deprecated -sdl and -soundhw qemu options Anthony PERARD
  2022-08-08 11:05 ` [XEN PATCH 1/2] tools/libxl: Replace deprecated -sdl option on QEMU command line Anthony PERARD
@ 2022-08-08 11:05 ` Anthony PERARD
  2022-08-09 12:17   ` Jason Andryuk
  1 sibling, 1 reply; 7+ messages in thread
From: Anthony PERARD @ 2022-08-08 11:05 UTC (permalink / raw
  To: xen-devel; +Cc: Jan Beulich, Anthony PERARD, Wei Liu, Juergen Gross

-soundhw is deprecated since 825ff02911c9 ("audio: add soundhw
deprecation notice"), QEMU v5.1, and is been remove for upcoming v7.1
by 039a68373c45 ("introduce -audio as a replacement for -soundhw").

Instead we can just add the sound card with "-device", for most option
that "-soundhw" could handle. "-device" is an option that existed
before QEMU 1.0, and could already be used to add audio hardware.

The list of possible option for libxl's "soundhw" is taken the list
from QEMU 7.0.

The list of options for "soundhw" are listed in order of preference in
the manual. The first three (hda, ac97, es1370) are PCI devices and
easy to test on Linux, and the last four are ISA devices which doesn't
seems to work out of the box on linux.

The sound card 'pcspk' isn't listed even if it used to be accepted by
'-soundhw' because QEMU crash when trying to add it to a Xen domain.
Also, it wouldn't work with "-device" might need to be "-machine
pcspk-audiodev=default" instead.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 docs/man/xl.cfg.5.pod.in                  |  6 +++---
 tools/libs/light/libxl_types_internal.idl | 10 ++++++++++
 tools/libs/light/libxl_dm.c               | 19 ++++++++++++++++++-
 3 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in
index 6d98d73d76..b2901e04cf 100644
--- a/docs/man/xl.cfg.5.pod.in
+++ b/docs/man/xl.cfg.5.pod.in
@@ -2555,9 +2555,9 @@ The form serial=DEVICE is also accepted for backwards compatibility.
 
 =item B<soundhw="DEVICE">
 
-Select the virtual sound card to expose to the guest. The valid
-devices are defined by the device model configuration, please see the
-B<qemu(1)> manpage for details. The default is not to export any sound
+Select the virtual sound card to expose to the guest. The valid devices are
+B<hda>, B<ac97>, B<es1370>, B<adlib>, B<cs4231a>, B<gus>, B<sb16> if there are
+available with the device model QEMU. The default is not to export any sound
 device.
 
 =item B<vkb_device=BOOLEAN>
diff --git a/tools/libs/light/libxl_types_internal.idl b/tools/libs/light/libxl_types_internal.idl
index 8f71980aec..fb0f4f23d7 100644
--- a/tools/libs/light/libxl_types_internal.idl
+++ b/tools/libs/light/libxl_types_internal.idl
@@ -56,3 +56,13 @@ libxl__device_action = Enumeration("device_action", [
     (1, "ADD"),
     (2, "REMOVE"),
     ])
+
+libxl__qemu_soundhw = Enumeration("qemu_soundhw", [
+    (1, "ac97"),
+    (2, "adlib"),
+    (3, "cs4231a"),
+    (4, "es1370"),
+    (5, "gus"),
+    (6, "hda"),
+    (7, "sb16"),
+    ])
diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
index 04bf5d8563..fc264a3a13 100644
--- a/tools/libs/light/libxl_dm.c
+++ b/tools/libs/light/libxl_dm.c
@@ -1204,6 +1204,7 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
     uint64_t ram_size;
     const char *path, *chardev;
     bool is_stubdom = libxl_defbool_val(b_info->device_model_stubdomain);
+    int rc;
 
     dm_args = flexarray_make(gc, 16, 1);
     dm_envs = flexarray_make(gc, 16, 1);
@@ -1531,7 +1532,23 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
             }
         }
         if (b_info->u.hvm.soundhw) {
-            flexarray_vappend(dm_args, "-soundhw", b_info->u.hvm.soundhw, NULL);
+            libxl__qemu_soundhw soundhw;
+
+            rc = libxl__qemu_soundhw_from_string(b_info->u.hvm.soundhw, &soundhw);
+            if (rc) {
+                LOGD(ERROR, guest_domid, "Unknown soundhw option '%s'", b_info->u.hvm.soundhw);
+                return ERROR_INVAL;
+            }
+
+            switch (soundhw) {
+            case LIBXL__QEMU_SOUNDHW_HDA:
+                flexarray_vappend(dm_args, "-device", "intel-hda",
+                                  "-device", "hda-duplex", NULL);
+                break;
+            default:
+                flexarray_append_pair(dm_args, "-device",
+                                      (char*)libxl__qemu_soundhw_to_string(soundhw));
+            }
         }
         if (!libxl__acpi_defbool_val(b_info)) {
             flexarray_append(dm_args, "-no-acpi");
-- 
Anthony PERARD



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [XEN PATCH 1/2] tools/libxl: Replace deprecated -sdl option on QEMU command line
  2022-08-08 11:05 ` [XEN PATCH 1/2] tools/libxl: Replace deprecated -sdl option on QEMU command line Anthony PERARD
@ 2022-08-09 12:08   ` Jason Andryuk
  0 siblings, 0 replies; 7+ messages in thread
From: Jason Andryuk @ 2022-08-09 12:08 UTC (permalink / raw
  To: Anthony PERARD; +Cc: xen-devel, Jan Beulich, Wei Liu, Juergen Gross

On Mon, Aug 8, 2022 at 7:06 AM Anthony PERARD <anthony.perard@citrix.com> wrote:
>
> "-sdl" is deprecated upstream since 6695e4c0fd9e ("softmmu/vl:
> Deprecate the -sdl and -curses option"), QEMU v6.2, and the option is
> removed by 707d93d4abc6 ("ui: Remove deprecated options "-sdl" and
> "-curses""), in upcoming QEMU v7.1.
>
> Instead, use "-display sdl", available since 1472a95bab1e ("Introduce
> -display argument"), before QEMU v1.0.
>
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Jason Andryuk <jandryuk@gmail.com>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [XEN PATCH 2/2] tools/libxl: Replace deprecated -soundhw on QEMU command line
  2022-08-08 11:05 ` [XEN PATCH 2/2] tools/libxl: Replace deprecated -soundhw " Anthony PERARD
@ 2022-08-09 12:17   ` Jason Andryuk
  2022-08-11 12:30     ` Anthony PERARD
  0 siblings, 1 reply; 7+ messages in thread
From: Jason Andryuk @ 2022-08-09 12:17 UTC (permalink / raw
  To: Anthony PERARD; +Cc: xen-devel, Jan Beulich, Wei Liu, Juergen Gross

On Mon, Aug 8, 2022 at 7:06 AM Anthony PERARD <anthony.perard@citrix.com> wrote:
>
> -soundhw is deprecated since 825ff02911c9 ("audio: add soundhw
> deprecation notice"), QEMU v5.1, and is been remove for upcoming v7.1
> by 039a68373c45 ("introduce -audio as a replacement for -soundhw").
>
> Instead we can just add the sound card with "-device", for most option
> that "-soundhw" could handle. "-device" is an option that existed
> before QEMU 1.0, and could already be used to add audio hardware.
>
> The list of possible option for libxl's "soundhw" is taken the list
> from QEMU 7.0.
>
> The list of options for "soundhw" are listed in order of preference in
> the manual. The first three (hda, ac97, es1370) are PCI devices and
> easy to test on Linux, and the last four are ISA devices which doesn't
> seems to work out of the box on linux.
>
> The sound card 'pcspk' isn't listed even if it used to be accepted by
> '-soundhw' because QEMU crash when trying to add it to a Xen domain.
> Also, it wouldn't work with "-device" might need to be "-machine
> pcspk-audiodev=default" instead.
>
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Jason Andryuk <jandryuk@gmail.com>

With one question below.

> ---
>  docs/man/xl.cfg.5.pod.in                  |  6 +++---
>  tools/libs/light/libxl_types_internal.idl | 10 ++++++++++
>  tools/libs/light/libxl_dm.c               | 19 ++++++++++++++++++-
>  3 files changed, 31 insertions(+), 4 deletions(-)
>
> diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in
> index 6d98d73d76..b2901e04cf 100644
> --- a/docs/man/xl.cfg.5.pod.in
> +++ b/docs/man/xl.cfg.5.pod.in
> @@ -2555,9 +2555,9 @@ The form serial=DEVICE is also accepted for backwards compatibility.
>
>  =item B<soundhw="DEVICE">
>
> -Select the virtual sound card to expose to the guest. The valid
> -devices are defined by the device model configuration, please see the
> -B<qemu(1)> manpage for details. The default is not to export any sound
> +Select the virtual sound card to expose to the guest. The valid devices are
> +B<hda>, B<ac97>, B<es1370>, B<adlib>, B<cs4231a>, B<gus>, B<sb16> if there are
> +available with the device model QEMU. The default is not to export any sound
>  device.

Is it worth mentioning driver support?  I think Windows 7 and later
only have a built-in driver for hda.  Windows 7 definitely doesn't
have a built-in driver for ac97.  I think all the other devices are
even older, so I doubt Windows has drivers for those, but I have not
checked.

Regards,
Jason


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [XEN PATCH 2/2] tools/libxl: Replace deprecated -soundhw on QEMU command line
  2022-08-09 12:17   ` Jason Andryuk
@ 2022-08-11 12:30     ` Anthony PERARD
  2022-08-16 17:45       ` Jason Andryuk
  0 siblings, 1 reply; 7+ messages in thread
From: Anthony PERARD @ 2022-08-11 12:30 UTC (permalink / raw
  To: Jason Andryuk; +Cc: xen-devel, Jan Beulich, Wei Liu, Juergen Gross

On Tue, Aug 09, 2022 at 08:17:49AM -0400, Jason Andryuk wrote:
> On Mon, Aug 8, 2022 at 7:06 AM Anthony PERARD <anthony.perard@citrix.com> wrote:
> > diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in
> > index 6d98d73d76..b2901e04cf 100644
> > --- a/docs/man/xl.cfg.5.pod.in
> > +++ b/docs/man/xl.cfg.5.pod.in
> > @@ -2555,9 +2555,9 @@ The form serial=DEVICE is also accepted for backwards compatibility.
> >
> >  =item B<soundhw="DEVICE">
> >
> > -Select the virtual sound card to expose to the guest. The valid
> > -devices are defined by the device model configuration, please see the
> > -B<qemu(1)> manpage for details. The default is not to export any sound
> > +Select the virtual sound card to expose to the guest. The valid devices are
> > +B<hda>, B<ac97>, B<es1370>, B<adlib>, B<cs4231a>, B<gus>, B<sb16> if there are
> > +available with the device model QEMU. The default is not to export any sound
> >  device.
> 
> Is it worth mentioning driver support?  I think Windows 7 and later
> only have a built-in driver for hda.  Windows 7 definitely doesn't
> have a built-in driver for ac97.  I think all the other devices are
> even older, so I doubt Windows has drivers for those, but I have not
> checked.

No, I don't think we can mention drivers support, we don't test any, it
would be incomplete, and we can't do anything if a driver is broken.
I've put "hda" first on the list in the hope that if someone wants a
sound card but don't know which one to use, they will try this one
first.

Thanks,

-- 
Anthony PERARD


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [XEN PATCH 2/2] tools/libxl: Replace deprecated -soundhw on QEMU command line
  2022-08-11 12:30     ` Anthony PERARD
@ 2022-08-16 17:45       ` Jason Andryuk
  0 siblings, 0 replies; 7+ messages in thread
From: Jason Andryuk @ 2022-08-16 17:45 UTC (permalink / raw
  To: Anthony PERARD; +Cc: xen-devel, Jan Beulich, Wei Liu, Juergen Gross

On Thu, Aug 11, 2022 at 8:30 AM Anthony PERARD
<anthony.perard@citrix.com> wrote:
>
> On Tue, Aug 09, 2022 at 08:17:49AM -0400, Jason Andryuk wrote:
> > On Mon, Aug 8, 2022 at 7:06 AM Anthony PERARD <anthony.perard@citrix.com> wrote:
> > > diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in
> > > index 6d98d73d76..b2901e04cf 100644
> > > --- a/docs/man/xl.cfg.5.pod.in
> > > +++ b/docs/man/xl.cfg.5.pod.in
> > > @@ -2555,9 +2555,9 @@ The form serial=DEVICE is also accepted for backwards compatibility.
> > >
> > >  =item B<soundhw="DEVICE">
> > >
> > > -Select the virtual sound card to expose to the guest. The valid
> > > -devices are defined by the device model configuration, please see the
> > > -B<qemu(1)> manpage for details. The default is not to export any sound
> > > +Select the virtual sound card to expose to the guest. The valid devices are
> > > +B<hda>, B<ac97>, B<es1370>, B<adlib>, B<cs4231a>, B<gus>, B<sb16> if there are
> > > +available with the device model QEMU. The default is not to export any sound
> > >  device.
> >
> > Is it worth mentioning driver support?  I think Windows 7 and later
> > only have a built-in driver for hda.  Windows 7 definitely doesn't
> > have a built-in driver for ac97.  I think all the other devices are
> > even older, so I doubt Windows has drivers for those, but I have not
> > checked.
>
> No, I don't think we can mention drivers support, we don't test any, it
> would be incomplete, and we can't do anything if a driver is broken.
> I've put "hda" first on the list in the hope that if someone wants a
> sound card but don't know which one to use, they will try this one
> first.

Ok.  That sounds fine.

Thanks,
Jason


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-08-16 17:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-08 11:05 [XEN PATCH 0/2] libxl: replace deprecated -sdl and -soundhw qemu options Anthony PERARD
2022-08-08 11:05 ` [XEN PATCH 1/2] tools/libxl: Replace deprecated -sdl option on QEMU command line Anthony PERARD
2022-08-09 12:08   ` Jason Andryuk
2022-08-08 11:05 ` [XEN PATCH 2/2] tools/libxl: Replace deprecated -soundhw " Anthony PERARD
2022-08-09 12:17   ` Jason Andryuk
2022-08-11 12:30     ` Anthony PERARD
2022-08-16 17:45       ` Jason Andryuk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.