Bug 1300919 - Libvirt should check controller value in scsi disk address before attach device
Summary: Libvirt should check controller value in scsi disk address before attach device
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-01-22 04:55 UTC by Pei Zhang
Modified: 2016-04-21 20:24 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-04-21 20:24:34 UTC


Attachments (Terms of Use)

Description Pei Zhang 2016-01-22 04:55:48 UTC
Description of problem:
Since now libvirt will add scsi controller automatically when attach a scsi disk, it should check the value of controller if it's useful before attach it.

Version-Release number of selected component (if applicable):
libvirt-1.3.2-1.fc24_v1.3.1_29_gdaeace5.x86_64

How reproducible:
100%

Steps to Reproduce:
1.prepare a scsi disk xml like following, the controller is a large value 100
# cat disk/iscsi/disk-net-auth-iscsi.xml
<disk type='network' device='lun' sgio='filtered'>
        <driver name='qemu' type='raw'/>
        <auth username='redhat'>
                <secret type='iscsi' usage='libvirtiscsi'/>
        </auth>
        <source protocol='iscsi' name='iqn.2008-09.5.165.3ffe.104:server.target3/1'>
                <host name='$IP' port='3260'/>
        </source>
        <target dev='sdb' bus='scsi'/>
        <address type='drive' controller='100' bus='0' target='0' unit='0'/>
</disk>

2. attach this disk to guest, fail to attach

# virsh attach-device fd23 disk/iscsi/disk-net-auth-iscsi.xml
error: Failed to attach device from disk/iscsi/disk-net-auth-iscsi.xml
error: internal error: No more available PCI slots

3. check guest xml, it already attached a lot of scsi controllers.

# virsh dumpxml fd23 | grep scsi
      <target dev='sde' bus='scsi'/>
      <alias name='scsi1-0-0'/>
    <controller type='scsi' index='0'>
      <alias name='scsi0'/>
    <controller type='scsi' index='1'>
      <alias name='scsi1'/>
    <controller type='scsi' index='2'>
      <alias name='scsi2'/>
......
   <controller type='scsi' index='23'>
      <alias name='scsi23'/>


Actual results:
As steps 2 and step 3, it fails to attach scsi disk but it attached a lot of scsi controllers.

Expected results:
Libvirt should check scsi disk address and limit the controller before attach device.

Additional info:

Comment 1 Cole Robinson 2016-04-21 20:24:34 UTC
Personally I think this is just one of those 'dont do that' situations :) it's so unlikely someone will hit this in practice that it's not worth tracking the bug or writing libvirt code to handle it IMO


Note You need to log in before you can comment on or make changes to this bug.