mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
Remove restriction on duplicated sound devices in parser
It is perfectly acceptable to have multiple sound devices of same type in guest configuration. If the underlying hypervisor does not like this, it is its job to complain, not the XML parser's * src/conf/domain_conf.c: Remove hack which deleted duplicated sound device models. * tests/xml2sexprdata/xml2sexpr-fv-sound.xml: Remove duplicate models
This commit is contained in:
parent
989051a85e
commit
4359900ed1
@ -3764,23 +3764,12 @@ static virDomainDefPtr virDomainDefParseXML(virConnectPtr conn,
|
|||||||
if (n && VIR_ALLOC_N(def->sounds, n) < 0)
|
if (n && VIR_ALLOC_N(def->sounds, n) < 0)
|
||||||
goto no_memory;
|
goto no_memory;
|
||||||
for (i = 0 ; i < n ; i++) {
|
for (i = 0 ; i < n ; i++) {
|
||||||
int collision = 0, j;
|
|
||||||
virDomainSoundDefPtr sound = virDomainSoundDefParseXML(conn,
|
virDomainSoundDefPtr sound = virDomainSoundDefParseXML(conn,
|
||||||
nodes[i],
|
nodes[i],
|
||||||
flags);
|
flags);
|
||||||
if (!sound)
|
if (!sound)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
/* Verify there's no duplicated sound card */
|
|
||||||
for (j = 0 ; j < def->nsounds ; j++) {
|
|
||||||
if (def->sounds[j]->model == sound->model)
|
|
||||||
collision = 1;
|
|
||||||
}
|
|
||||||
if (collision) {
|
|
||||||
virDomainSoundDefFree(sound);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
def->sounds[def->nsounds++] = sound;
|
def->sounds[def->nsounds++] = sound;
|
||||||
}
|
}
|
||||||
VIR_FREE(nodes);
|
VIR_FREE(nodes);
|
||||||
|
@ -32,9 +32,6 @@
|
|||||||
</disk>
|
</disk>
|
||||||
<graphics type='vnc' port='5917' keymap='ja'/>
|
<graphics type='vnc' port='5917' keymap='ja'/>
|
||||||
<sound model='sb16'/>
|
<sound model='sb16'/>
|
||||||
<sound model='sb16'/>
|
|
||||||
<sound model='es1370'/>
|
|
||||||
<sound model='sb16'/>
|
|
||||||
<sound model='es1370'/>
|
<sound model='es1370'/>
|
||||||
</devices>
|
</devices>
|
||||||
</domain>
|
</domain>
|
||||||
|
Loading…
Reference in New Issue
Block a user