mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 15:27:47 +00:00
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:
parent
7e07c50dc0
commit
fa88832b8f
@ -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;
|
||||
|
@ -1449,7 +1449,7 @@ struct _virDomainSoundCodecDef {
|
||||
};
|
||||
|
||||
struct _virDomainSoundDef {
|
||||
int model;
|
||||
virDomainSoundModel model;
|
||||
virDomainDeviceInfo info;
|
||||
|
||||
size_t ncodecs;
|
||||
|
@ -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;
|
||||
|
@ -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:
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user