Hide Forgot
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:
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.
Agreed; sometimes I wish that we hadn't even included the target dev, since it's really quite meaningless.