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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxxxxx>
> ---
> 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@xxxxxxxxxx>

Michal




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux