Skip to content

Controller.py: add driver_iothreads for scsi controller #4132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

meinaLi
Copy link
Contributor

@meinaLi meinaLi commented May 27, 2025

Add new iothread and queues to driver element of scsi controller

@meinaLi meinaLi force-pushed the scsi_queue branch 4 times, most recently from e32e7f5 to 8b157be Compare May 28, 2025 01:38
Add new iothread and queues to driver element of scsi controller

Signed-off-by: meinaLi <[email protected]>
@meinaLi
Copy link
Contributor Author

meinaLi commented May 28, 2025

Test result for fetch_attrs:

>>> from virttest.libvirt_xml.devices import controller
>>> controller_dev = controller.Controller()
>>> controller_dev.xml = """
... <controller type='scsi' index='1' model='virtio-scsi'>
...       <driver queues='2'>
...         <iothreads>
...           <iothread id='4'>
...             <queue id='0'/>
...           </iothread>
...           <iothread id='2'>
...             <queue id='1'/>
...           </iothread>
...         </iothreads>
...       </driver>
...       <address type='pci' domain='0x0000' bus='0x00' slot='0x0c' function='0x0'/>
...     </controller>
... """
>>> controller_dev.fetch_attrs()
{'driver_iothreads': {'iothread': [{'queue': [{'id': '0'}], 'id': '4'}, {'queue': [{'id': '1'}], 'id': '2'}]}, 'model': 'virtio-scsi', 'address': {'attrs': {'type': 'pci', 'domain': '0x0000', 'bus': '0x00', 'slot': '0x0c', 'function': '0x0'}, 'type_name': 'pci'}, 'type_name': 'scsi', 'driver': {'queues': '2'}, 'type': 'scsi', 'index': '1'}

@meinaLi
Copy link
Contributor Author

meinaLi commented May 28, 2025

Test result for setup_attrs():

>>> from virttest.libvirt_xml.devices import controller
>>> controller_dev = controller.Controller()
>>> controller_dict = {'driver_iothreads': {'iothread': [{'queue': [{'id': '0'}], 'id': '4'}, {'queue': [{'id': '1'}], 'id': '2'}]}, 'model': 'virtio-scsi', 'address': {'attrs': {'type': 'pci', 'domain': '0x0000', 'bus': '0x00', 'slot': '0x0c', 'function': '0x0'}, 'type_name': 'pci'}, 'type_name': 'scsi', 'driver': {'queues': '2'}, 'type': 'scsi', 'index': '1'}
>>> controller_dev.setup_attrs(**controller_dict)
>>> controller_dev
{'xmltreefile': None, 'validates': None, 'xml': <_io.FileIO name='/tmp/xml_utils_temp_rcug4_0d.xml' mode='rb+' closefd=True>, 'virsh': <module 'virttest.virsh' from '/var/ci/libvirt-ci/runtest/avocado-vt/avocado-vt/virttest/virsh.py'>, 'device_tag': 'controller'}

# cat /tmp/xml_utils_temp_rcug4_0d.xml
<controller type="scsi" model="virtio-scsi" index="1"><driver queues="2"><iothreads><iothread id="4"><queue id="0" /></iothread><iothread id="2"><queue id="1" /></iothread></iothreads></driver><address type="pci" domain="0x0000" bus="0x00" slot="0x0c" function="0x0" /></controller>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant