virDomainSoundDef: Change type of model to virDomainSoundModel

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Tim Wiederhake 2021-04-23 17:39:18 +02:00 committed by Peter Krempa
parent 7e07c50dc0
commit fa88832b8f
5 changed files with 7 additions and 5 deletions

View File

@ -13307,17 +13307,19 @@ virDomainSoundDefParseXML(virDomainXMLOption *xmlopt,
virDomainSoundDef *def;
VIR_XPATH_NODE_AUTORESTORE(ctxt)
g_autofree char *model = NULL;
int modelval;
xmlNodePtr audioNode;
def = g_new0(virDomainSoundDef, 1);
ctxt->node = node;
model = virXMLPropString(node, "model");
if ((def->model = virDomainSoundModelTypeFromString(model)) < 0) {
if ((modelval = virDomainSoundModelTypeFromString(model)) < 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("unknown sound model '%s'"), model);
goto error;
}
def->model = modelval;
if (virDomainSoundModelSupportsCodecs(def)) {
int ncodecs;

View File

@ -1449,7 +1449,7 @@ struct _virDomainSoundCodecDef {
};
struct _virDomainSoundDef {
int model;
virDomainSoundModel model;
virDomainDeviceInfo info;
size_t ncodecs;

View File

@ -4133,7 +4133,7 @@ qemuBuildSoundDevStr(const virDomainDef *def,
const char *model = NULL;
/* Hack for devices with different names in QEMU and libvirt */
switch ((virDomainSoundModel) sound->model) {
switch (sound->model) {
case VIR_DOMAIN_SOUND_MODEL_ES1370:
model = "ES1370";
break;

View File

@ -759,7 +759,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDef *dev,
}
case VIR_DOMAIN_DEVICE_SOUND:
switch ((virDomainSoundModel) dev->data.sound->model) {
switch (dev->data.sound->model) {
case VIR_DOMAIN_SOUND_MODEL_ES1370:
case VIR_DOMAIN_SOUND_MODEL_AC97:
case VIR_DOMAIN_SOUND_MODEL_ICH6:

View File

@ -4385,7 +4385,7 @@ qemuValidateDomainDeviceDefSound(virDomainSoundDef *sound,
{
size_t i;
switch ((virDomainSoundModel) sound->model) {
switch (sound->model) {
case VIR_DOMAIN_SOUND_MODEL_USB:
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_USB_AUDIO)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",