Bug 1043374 - Refuse to start a domain with a USB disk attached to a PCI bus
Summary: Refuse to start a domain with a USB disk attached to a PCI bus
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.5
Hardware: x86_64
OS: Linux
medium
low
Target Milestone: rc
: ---
Assignee: Jiri Denemark
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1043436
TreeView+ depends on / blocked
 
Reported: 2013-12-16 06:43 UTC by Hu Jianwei
Modified: 2014-04-04 21:27 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1043436 (view as bug list)
Environment:
Last Closed: 2014-04-04 21:27:08 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Hu Jianwei 2013-12-16 06:43:11 UTC
Description of problem:
Libvirt should check unnecessary pci-address for usb type disk before starting domain

Version-Release number of selected component (if applicable):
libvirt-0.10.2-29.el6.x86_64
qemu-kvm-0.12.1.2-2.398.el6.x86_64
kernel-2.6.32-412.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Edit domain and add a unavailable pci address to usb disk
   <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/usb-img/usb.img'/>
      <target dev='sdd' bus='usb'/>
      <alias name='usb-disk3'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </disk>

2. Dump domain xml
[root@test777 ~]# virsh dumpxml r6
...
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/usb-img/usb.img'/>
      <target dev='sdd' bus='usb'/>
      <alias name='usb-disk3'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </disk>
...

3. Start domain
[root@test777 ~]# virsh start r6
Domain r6 started

[root@test777 ~]# virsh dumpxml r6
...
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/usb-img/usb.img'/>
      <target dev='sdd' bus='usb'/>
      <alias name='usb-disk3'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </disk>
...

Actual results:
See above steps.

Expected results:
Libvirt should fail to start domain when we configure some wrong elements for usb disk. The expected results should be same as below:

Need give error info like bus='ide' or bus='scsi':
# virsh start rhel6u2
error: Failed to start domain rhel6u2
error: internal error unexpected address type for ide disk

# virsh start rhel6u2
error: Failed to start domain rhel6u2
error: internal error unexpected address type for scsi disk


Additional info:
On rhel7 host, I can not reproduce it.

Version:
libvirt-1.1.1-13.el7.x86_64
qemu-kvm-1.5.3-19.el7.x86_64
kernel-3.10.0-54.el7.x86_64

[root@ibm-x3850x5-07 216365]# virsh dumpxml r7
...
<disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/usb-img/usb-a-a.img'/>
      <target dev='sdd' bus='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0e' function='0x0'/>
    </disk>
...

[root@ibm-x3850x5-07 216365]# virsh start r7
error: Failed to start domain r7
error: internal error: early end of file from monitor: possible problem:
qemu-kvm: -device usb-storage,bus=pci.0,addr=0xe,drive=drive-usb-disk3,id=usb-disk3: Device 'usb-storage' can't go on a PCI bus

Comment 2 RHEL Program Management 2014-04-04 21:27:08 UTC
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.


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