Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
question about <controller> element of libvirt
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
fpemud
Guru
Guru


Joined: 15 Feb 2012
Posts: 349

PostPosted: Mon Apr 15, 2013 2:12 pm    Post subject: question about <controller> element of libvirt Reply with quote

I'm confused with the logical relationship of <address> and <controller>.

My understanding of <controller>:
1. one <controller> means one bus.
2. <controller> has a "type" attribute, it is als the bus type.
3. each controller has a mandatory attribute type, which must be one of "ide", "fdc", "scsi", "sata", "usb", "ccid", or "virtio-serial" -- from libvirt doc
4. every type of controller has a isolated index space, which means I can have "ide controller 0", "ide contoller 1" and "pci controller 0", "pci controller 1" and also "usb controller 0", "usb controller 1"

My understanding of <address> sub-element in <disk>:
1. the type attribute is mandatory, and is typically "pci" or "drive". -- from libvirt doc

Question 1:
<address type='pci'> is clear, but what does type='drive' mean? type='drive' doesn't match any controller type above.
If I have a virtual ide disk, can't I use <address type='ide' ...> directly?

Question 2:
Quote:
For <address> sub-element of <disk>,
type='drive'
Drive addresses have the following additional attributes: controller (a 2-digit controller number), bus (a 2-digit bus number), target (a 2-digit bus number), and unit (a 2-digit unit number on the bus).

Quote:
For <target> sub-element of <disk>,
The target element controls the bus / device under which the disk is exposed to the guest OS. The dev attribute indicates the "logical" device name. The actual device name specified is not guaranteed to map to the device name in the guest OS. Treat it as a device ordering hint. The optional bus attribute specifies the type of disk device to emulate; possible values are driver specific, with typical values being "ide", "scsi", "virtio", "xen", "usb" or "sata". If omitted, the bus type is inferred from the style of the device name (e.g. a device named 'sda' will typically be exported using a SCSI bus). ...


Since one controller maps one bus, then why <address type='drive'> has both a "controller" and a "bus" attribute?

<address unit=x> is a way to specify disk sequence, and <target dev='sdb'> is another way to do the same thing.
So I think they must be the same? Can I just omit "dev='sdb'"?
I think it's critical in the case of <target dev='sdb' bus='virtio'> and <target dev='vdb' bus='virtio'>, so libvirt can tell qemu to use virtio-scsi-pci or virtio-blk-pci?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum