Hi, I am adding a disk to my KVM virtual server, but for some reason it refuses to honor the <address> I have tried the following 3: <disk type='block' device='disk'> <driver name='phy' type='raw'/> <source dev='/dev/nbd2'/> <target dev='vdb' bus='virtio'/> <serial>my-fake-serial</serial> <address type='drive' controller='0' bus='1' target='3' unit='2'/> </disk> <disk type='block' device='disk'> <driver name='phy' type='raw'/> <source dev='/dev/nbd2'/> <target dev='vdb' bus='virtio'/> <serial>my-fake-serial</serial> <address type='pci' bus='0x00' slot='0x08' function='0x0'/> </disk> <disk type='block' device='disk'> <driver name='phy' type='raw'/> <source dev='/dev/nbd2'/> <target dev='vdb' bus='virtio'/> <serial>my-fake-serial</serial> <address type='virtio-serial' controller='0' bus='0' port='8'/> </disk> I would assume the last one is the one to use, as I am using a "virtio" bus. However, the <address> attribute is simply ignored and the disk is always attached as this: pci-0000:00:05.0 Further, how do I read the "my-fake-serial" from within the virtual machine? I have tried using this: udevadm info -a -p $(udevadm info -q path -n /dev/vdb) But it does not show the serial string there anywhere. Regards, Daniele -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20130408/b7e4cce4/attachment.htm>
Martin Kletzander
2013-Apr-09 11:29 UTC
[libvirt-users] How to device port on the controller
On 04/08/2013 11:58 PM, Daniele Testa wrote:> Hi, > > I am adding a disk to my KVM virtual server, but for some reason it refuses > to honor the <address> > > I have tried the following 3: > > <disk type='block' device='disk'> > <driver name='phy' type='raw'/> > <source dev='/dev/nbd2'/> > <target dev='vdb' bus='virtio'/> > <serial>my-fake-serial</serial> > <address type='drive' controller='0' bus='1' target='3' unit='2'/> > </disk> > > > <disk type='block' device='disk'> > <driver name='phy' type='raw'/> > <source dev='/dev/nbd2'/> > <target dev='vdb' bus='virtio'/> > <serial>my-fake-serial</serial> > <address type='pci' bus='0x00' slot='0x08' function='0x0'/> > </disk> > > > <disk type='block' device='disk'> > <driver name='phy' type='raw'/> > <source dev='/dev/nbd2'/> > <target dev='vdb' bus='virtio'/> > <serial>my-fake-serial</serial> > <address type='virtio-serial' controller='0' bus='0' port='8'/> > </disk> > > I would assume the last one is the one to use, as I am using a "virtio" > bus. However, the <address> attribute is simply ignored and the disk is > always attached as this: > > pci-0000:00:05.0 > > Further, how do I read the "my-fake-serial" from within the virtual machine? >The serial for vdb for example is in /sys/class/block/vdb/serial I know I haven't helped with the addresses, don't know much about that, but try attaching your libvirt version and the log of /var/log/libvirt/qemu/<machine_name>.log. I'll see when I'll get to you. Maybe somebody will found out in the meantime. If not, feel free to create a bug for this. Martin