libxl: adjust 'ich6' sound card name

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@invisiblethingslab.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Marek Marczykowski-Górecki 2022-12-20 23:52:06 +01:00 committed by Michal Privoznik
parent f2fe8a3504
commit d7d4056645

View File

@ -592,8 +592,12 @@ libxlMakeDomBuildInfo(virDomainDef *def,
* a single device. From the man page: soundhw=DEVICE
*/
virDomainSoundDef *snd = def->sounds[0];
const char *model = virDomainSoundModelTypeToString(snd->model);
b_info->u.hvm.soundhw = g_strdup(virDomainSoundModelTypeToString(snd->model));
if (snd->model == VIR_DOMAIN_SOUND_MODEL_ICH6)
model = "hda";
b_info->u.hvm.soundhw = g_strdup(model);
}
for (i = 0; i < def->os.nBootDevs; i++) {