mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 09:17:52 +03:00
virDomainAudioDef: Change type of "type" to virDomainAudioType
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
15670ebb17
commit
8f1b810333
@ -524,7 +524,7 @@ bhyveBuildSoundArgStr(const virDomainDef *def G_GNUC_UNUSED,
|
||||
virCommandAddArg(cmd, "-s");
|
||||
|
||||
if (audio) {
|
||||
switch ((virDomainAudioType) audio->type) {
|
||||
switch (audio->type) {
|
||||
case VIR_DOMAIN_AUDIO_TYPE_OSS:
|
||||
if (virDomainAudioIOCommonIsSet(&audio->input) ||
|
||||
virDomainAudioIOCommonIsSet(&audio->output)) {
|
||||
|
@ -2922,7 +2922,7 @@ virDomainAudioDefFree(virDomainAudioDef *def)
|
||||
if (!def)
|
||||
return;
|
||||
|
||||
switch ((virDomainAudioType) def->type) {
|
||||
switch (def->type) {
|
||||
case VIR_DOMAIN_AUDIO_TYPE_NONE:
|
||||
break;
|
||||
|
||||
@ -13123,24 +13123,26 @@ virDomainAudioDefParseXML(virDomainXMLOption *xmlopt G_GNUC_UNUSED,
|
||||
virDomainAudioDef *def;
|
||||
VIR_XPATH_NODE_AUTORESTORE(ctxt)
|
||||
g_autofree char *tmp = NULL;
|
||||
g_autofree char *type = NULL;
|
||||
g_autofree char *typestr = NULL;
|
||||
int type;
|
||||
xmlNodePtr inputNode, outputNode;
|
||||
|
||||
def = g_new0(virDomainAudioDef, 1);
|
||||
ctxt->node = node;
|
||||
|
||||
type = virXMLPropString(node, "type");
|
||||
if (!type) {
|
||||
typestr = virXMLPropString(node, "type");
|
||||
if (!typestr) {
|
||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||
_("missing audio 'type' attribute"));
|
||||
goto error;
|
||||
}
|
||||
|
||||
if ((def->type = virDomainAudioTypeTypeFromString(type)) < 0) {
|
||||
if ((type = virDomainAudioTypeTypeFromString(typestr)) < 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("unknown audio type '%s'"), type);
|
||||
_("unknown audio type '%s'"), typestr);
|
||||
goto error;
|
||||
}
|
||||
def->type = type;
|
||||
|
||||
tmp = virXMLPropString(node, "id");
|
||||
if (!tmp) {
|
||||
@ -13163,7 +13165,7 @@ virDomainAudioDefParseXML(virDomainXMLOption *xmlopt G_GNUC_UNUSED,
|
||||
if (outputNode && virDomainAudioCommonParse(&def->output, outputNode, ctxt) < 0)
|
||||
goto error;
|
||||
|
||||
switch ((virDomainAudioType) def->type) {
|
||||
switch (def->type) {
|
||||
case VIR_DOMAIN_AUDIO_TYPE_NONE:
|
||||
break;
|
||||
|
||||
@ -25465,7 +25467,7 @@ virDomainAudioDefFormat(virBuffer *buf,
|
||||
|
||||
virBufferAsprintf(buf, "<audio id='%d' type='%s'", def->id, type);
|
||||
|
||||
switch ((virDomainAudioType)def->type) {
|
||||
switch (def->type) {
|
||||
case VIR_DOMAIN_AUDIO_TYPE_NONE:
|
||||
break;
|
||||
|
||||
|
@ -1543,7 +1543,7 @@ struct _virDomainAudioIOSDL {
|
||||
};
|
||||
|
||||
struct _virDomainAudioDef {
|
||||
int type;
|
||||
virDomainAudioType type;
|
||||
|
||||
unsigned int id;
|
||||
|
||||
|
@ -7670,7 +7670,7 @@ qemuBuildAudioCommandLineArg(virCommand *cmd,
|
||||
qemuBuildAudioCommonArg(&buf, "in", &def->input);
|
||||
qemuBuildAudioCommonArg(&buf, "out", &def->output);
|
||||
|
||||
switch ((virDomainAudioType)def->type) {
|
||||
switch (def->type) {
|
||||
case VIR_DOMAIN_AUDIO_TYPE_NONE:
|
||||
break;
|
||||
|
||||
@ -7859,7 +7859,7 @@ qemuBuildAudioCommandLineEnv(virCommand *cmd,
|
||||
qemuBuildAudioCommonEnv(cmd, "QEMU_AUDIO_ADC_", &audio->input);
|
||||
qemuBuildAudioCommonEnv(cmd, "QEMU_AUDIO_DAC_", &audio->output);
|
||||
|
||||
switch ((virDomainAudioType)audio->type) {
|
||||
switch (audio->type) {
|
||||
case VIR_DOMAIN_AUDIO_TYPE_NONE:
|
||||
break;
|
||||
|
||||
|
@ -4223,7 +4223,7 @@ qemuValidateDomainDeviceDefAudio(virDomainAudioDef *audio,
|
||||
}
|
||||
}
|
||||
|
||||
switch ((virDomainAudioType)audio->type) {
|
||||
switch (audio->type) {
|
||||
case VIR_DOMAIN_AUDIO_TYPE_NONE:
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user