[PATCH v2 2/2] libxl: adjust 'ich6' sound card name

Michal Prívozník mprivozn at redhat.com
Wed Dec 21 09:10:34 UTC 2022


On 12/20/22 23:52, Marek Marczykowski-Górecki wrote:
> Xen 4.17 has strict parsing of 'soundhw' option that allows only
> specific values (instead of passing through any value directly to
> qemu's -soundhw option, it uses -device now). For 'intel-hda' audio
> device, it requires "hda" string. "hda" works with older libxl too.
> Other supported models are the same as in libvirt XML.
> 
> Signed-off-by: Marek Marczykowski-Górecki <marmarek at invisiblethingslab.com>
> ---
> Changes in v2:
>  - move validation to libxlDomainDefValidate
> ---
>  src/libxl/libxl_conf.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
> index d13e48abb2..5ae60b76c1 100644
> --- a/src/libxl/libxl_conf.c
> +++ b/src/libxl/libxl_conf.c
> @@ -593,7 +593,10 @@ libxlMakeDomBuildInfo(virDomainDef *def,
>               */
>              virDomainSoundDef *snd = def->sounds[0];
>  
> -            b_info->u.hvm.soundhw = g_strdup(virDomainSoundModelTypeToString(snd->model));
> +            if (snd->model == VIR_DOMAIN_SOUND_MODEL_ICH6)
> +                b_info->u.hvm.soundhw = g_strdup("hda");
> +            else
> +                b_info->u.hvm.soundhw = g_strdup(virDomainSoundModelTypeToString(snd->model));
>          }
>  
>          for (i = 0; i < def->os.nBootDevs; i++) {


I find this more readable as:

const char *model = virDomainSoundModelTypeToString(snd->model);

if (snd->model == VIR_DOMAIN_SOUND_MODEL_ICH6)
  model = "hda";

b_info->u.hvm.soundhw = g_strdup(model);

I'll change it just before pushing.

Reviewed-by: Michal Privoznik <mprivozn at redhat.com>

Michal



More information about the libvir-list mailing list