mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-04 20:15:19 +00:00
Set a sensible default master start port for ehci companion controllers
The uhci1, uhci2, uhci3 companion controllers for ehci1 must
have a master start port set. Since this value is predictable
we should set it automatically if the app does not supply it
(cherry picked from commit 03b804a200
)
(crobinso: Drop an element that wasn't backported to -maint branch.)
This commit is contained in:
parent
19d309025b
commit
6b184ba1ce
@ -4035,6 +4035,28 @@ virDomainControllerDefParseXML(xmlNodePtr node,
|
|||||||
VIR_FREE(vectors);
|
VIR_FREE(vectors);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case VIR_DOMAIN_CONTROLLER_TYPE_USB: {
|
||||||
|
/* If the XML has a uhci1, uhci2, uhci3 controller and no
|
||||||
|
* master port was given, we should set a sensible one */
|
||||||
|
int masterPort = -1;
|
||||||
|
switch (def->model) {
|
||||||
|
case VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_UHCI1:
|
||||||
|
masterPort = 0;
|
||||||
|
break;
|
||||||
|
case VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_UHCI2:
|
||||||
|
masterPort = 2;
|
||||||
|
break;
|
||||||
|
case VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_UHCI3:
|
||||||
|
masterPort = 4;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (masterPort != -1 &&
|
||||||
|
def->info.mastertype == VIR_DOMAIN_CONTROLLER_MASTER_NONE) {
|
||||||
|
def->info.mastertype = VIR_DOMAIN_CONTROLLER_MASTER_USB;
|
||||||
|
def->info.master.usb.startport = masterPort;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -19,19 +19,13 @@
|
|||||||
<controller type='usb' index='1' model='ich9-ehci1'>
|
<controller type='usb' index='1' model='ich9-ehci1'>
|
||||||
</controller>
|
</controller>
|
||||||
|
|
||||||
<controller type='usb' index='0' model='ich9-uhci1'>
|
<controller type='usb' index='0' model='ich9-uhci1'/>
|
||||||
<master startport='0'/>
|
<controller type='usb' index='1' model='ich9-uhci1'/>
|
||||||
</controller>
|
|
||||||
<controller type='usb' index='1' model='ich9-uhci1'>
|
|
||||||
<master startport='0'/>
|
|
||||||
</controller>
|
|
||||||
<controller type='usb' index='2' model='ich9-uhci1'>
|
<controller type='usb' index='2' model='ich9-uhci1'>
|
||||||
<master startport='0'/>
|
<master startport='0'/>
|
||||||
</controller>
|
</controller>
|
||||||
|
|
||||||
<controller type='usb' index='0' model='ich9-uhci3'>
|
<controller type='usb' index='0' model='ich9-uhci3'/>
|
||||||
<master startport='4'/>
|
|
||||||
</controller>
|
|
||||||
<controller type='usb' index='1' model='ich9-uhci3'>
|
<controller type='usb' index='1' model='ich9-uhci3'>
|
||||||
<master startport='4'/>
|
<master startport='4'/>
|
||||||
</controller>
|
</controller>
|
||||||
@ -39,15 +33,9 @@
|
|||||||
<master startport='4'/>
|
<master startport='4'/>
|
||||||
</controller>
|
</controller>
|
||||||
|
|
||||||
<controller type='usb' index='2' model='ich9-uhci2'>
|
<controller type='usb' index='2' model='ich9-uhci2'/>
|
||||||
<master startport='2'/>
|
<controller type='usb' index='1' model='ich9-uhci2'/>
|
||||||
</controller>
|
<controller type='usb' index='0' model='ich9-uhci2'/>
|
||||||
<controller type='usb' index='1' model='ich9-uhci2'>
|
|
||||||
<master startport='2'/>
|
|
||||||
</controller>
|
|
||||||
<controller type='usb' index='0' model='ich9-uhci2'>
|
|
||||||
<master startport='2'/>
|
|
||||||
</controller>
|
|
||||||
<memballoon model='virtio'/>
|
<memballoon model='virtio'/>
|
||||||
</devices>
|
</devices>
|
||||||
</domain>
|
</domain>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||||
<memory unit='KiB'>219136</memory>
|
<memory unit='KiB'>219136</memory>
|
||||||
<currentMemory unit='KiB'>219136</currentMemory>
|
<currentMemory unit='KiB'>219136</currentMemory>
|
||||||
<vcpu placement='static'>1</vcpu>
|
<vcpu>1</vcpu>
|
||||||
<os>
|
<os>
|
||||||
<type arch='i686' machine='pc'>hvm</type>
|
<type arch='i686' machine='pc'>hvm</type>
|
||||||
<boot dev='hd'/>
|
<boot dev='hd'/>
|
||||||
|
Loading…
Reference in New Issue
Block a user