mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 23:37:42 +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;
|
virDomainSoundDef *def;
|
||||||
VIR_XPATH_NODE_AUTORESTORE(ctxt)
|
VIR_XPATH_NODE_AUTORESTORE(ctxt)
|
||||||
g_autofree char *model = NULL;
|
g_autofree char *model = NULL;
|
||||||
|
int modelval;
|
||||||
xmlNodePtr audioNode;
|
xmlNodePtr audioNode;
|
||||||
|
|
||||||
def = g_new0(virDomainSoundDef, 1);
|
def = g_new0(virDomainSoundDef, 1);
|
||||||
ctxt->node = node;
|
ctxt->node = node;
|
||||||
|
|
||||||
model = virXMLPropString(node, "model");
|
model = virXMLPropString(node, "model");
|
||||||
if ((def->model = virDomainSoundModelTypeFromString(model)) < 0) {
|
if ((modelval = virDomainSoundModelTypeFromString(model)) < 0) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("unknown sound model '%s'"), model);
|
_("unknown sound model '%s'"), model);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
def->model = modelval;
|
||||||
|
|
||||||
if (virDomainSoundModelSupportsCodecs(def)) {
|
if (virDomainSoundModelSupportsCodecs(def)) {
|
||||||
int ncodecs;
|
int ncodecs;
|
||||||
|
@ -1449,7 +1449,7 @@ struct _virDomainSoundCodecDef {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct _virDomainSoundDef {
|
struct _virDomainSoundDef {
|
||||||
int model;
|
virDomainSoundModel model;
|
||||||
virDomainDeviceInfo info;
|
virDomainDeviceInfo info;
|
||||||
|
|
||||||
size_t ncodecs;
|
size_t ncodecs;
|
||||||
|
@ -4133,7 +4133,7 @@ qemuBuildSoundDevStr(const virDomainDef *def,
|
|||||||
const char *model = NULL;
|
const char *model = NULL;
|
||||||
|
|
||||||
/* Hack for devices with different names in QEMU and libvirt */
|
/* Hack for devices with different names in QEMU and libvirt */
|
||||||
switch ((virDomainSoundModel) sound->model) {
|
switch (sound->model) {
|
||||||
case VIR_DOMAIN_SOUND_MODEL_ES1370:
|
case VIR_DOMAIN_SOUND_MODEL_ES1370:
|
||||||
model = "ES1370";
|
model = "ES1370";
|
||||||
break;
|
break;
|
||||||
|
@ -759,7 +759,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDef *dev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
case VIR_DOMAIN_DEVICE_SOUND:
|
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_ES1370:
|
||||||
case VIR_DOMAIN_SOUND_MODEL_AC97:
|
case VIR_DOMAIN_SOUND_MODEL_AC97:
|
||||||
case VIR_DOMAIN_SOUND_MODEL_ICH6:
|
case VIR_DOMAIN_SOUND_MODEL_ICH6:
|
||||||
|
@ -4385,7 +4385,7 @@ qemuValidateDomainDeviceDefSound(virDomainSoundDef *sound,
|
|||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
switch ((virDomainSoundModel) sound->model) {
|
switch (sound->model) {
|
||||||
case VIR_DOMAIN_SOUND_MODEL_USB:
|
case VIR_DOMAIN_SOUND_MODEL_USB:
|
||||||
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_USB_AUDIO)) {
|
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_USB_AUDIO)) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
Loading…
Reference in New Issue
Block a user