[libvirt-users] Understanding and converting between type='drive' and type='pci'

Martin Kletzander mkletzan at redhat.com
Fri Dec 2 13:15:02 UTC 2016

On Thu, Nov 17, 2016 at 10:55:43PM -0600, Leroy Tennison wrote:
>First, if this isn't the right list please tell me where i should post.
>I've searched for an explanation and I'm either searching for the wrong
>thing or it's not there.  I'm trying to get an understanding of the
>"controller='0' bus='0' target='0' unit='0' " parameters for 'drive'
>compared to the "domain='0x0000' bus='0x00' slot='0x05' function='0x0' "
>parameters for 'pci'.  It appears that 'dev hda' to 'dev hdd' is the
>maximum associated with 'drive', how many are available with 'pci' and
>what are the valid ranges for those parameters?

The <address/> tells libvirt where the device should be plugged in.  How
many ports there are available for the address type really depends on
the controller and hypervisor etc.  There's a lot of code dealing with
different scenarios.  You should rely on libvirt to do the placement for
you and just adjust the <target/> instead of the <address/> unless you
know what you are doing.

>If I have an xml using 'drive' and want to convert it to 'pci' what do I
>need to do?  I've had trouble with this when moving disk images between

What is the problem you are trying to fix?  Can you paint a bigger
picture of what you are trying to achieve?  It's hard to help when I
don't know what is the goal =)

>hypervisors but have never had the time to investigate fully, does it
>have to do with how the drives are referenced (/dev/disk/by0id or
>/dev/[h|s|v]da as opposed to UUID)?

Libvirt is trying to get close, but due to the fact how that works we
cannot in any way guarantee what the device name in the guest will be.
I'm not sure where the uuid of the disk comes from exactly and how to
set that in the host.

>Thanks for your help.
>libvirt-users mailing list
>libvirt-users at redhat.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20161202/b19a45e7/attachment.sig>

More information about the libvirt-users mailing list