Bug 781981 - libvirt should show some error when start the guest which disk's dev and bus is not fit
Summary: libvirt should show some error when start the guest which disk's dev and bu...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.3
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Jiri Denemark
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-01-16 09:07 UTC by Huang Wenlong
Modified: 2013-10-20 21:45 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-01-17 21:04:16 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Huang Wenlong 2012-01-16 09:07:13 UTC
Description of problem:
libvirt should show some error  when start the guest which  disk's dev and bus is not fit

<target dev='hda' bus='virtio'/> and <target dev='vdb' bus='ide'/>


Version-Release number of selected component (if applicable):
libvirt-0.9.9-1.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. edit guest's xml
#virsh edit $guest

disk like this :
<target dev='hda' bus='virtio'/> or <target dev='vda' bus='ide'/>

2. start the guest
#virsh start q2
Domain q2 started

3. no error or warning
# virsh dumpxml q2

...
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='none'/>
<source file='/var/lib/libvirt/images/q2.img'/>
<target dev='hda' bus='virtio'/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</disk>
...

in the guest

disk is  /dev/vda


Actual results:
not fit but no check

Expected results:
show some message when disk dev and bus is not fit

Additional info:

Comment 3 Jiri Denemark 2012-01-17 21:04:16 UTC
I don't really think this is worth fixing. Target dev doesn't really mean anything, it is merely used to easily identify the device (when using virsh commands, for example) and for sorting devices on the same bus. This is also explicitly mentioned in domain XML documentation. Target dev doesn't have to match the in-guest device name and if you run any BSD system or even Windows as a guest, the in-guest device name will not be even close to target dev. Actually since libata started to include drivers for IDE controles, the correspondence doesn't work in Linux either (<target dev='hdc' bus='ide'/> will most likely be /dev/sr0 in a guest). Not to mention that one can rename the devices easily with udev.

In other words, I don't think we should pretend there's something special about target dev and enforce unnecessary relation between dev and bus.

Comment 4 Dave Allan 2012-01-17 21:15:37 UTC
Agreed; sometimes I wish that we hadn't even included the target dev, since it's really quite meaningless.


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