On 1/2/13, Daniel P. Berrange <berrange(a)redhat.com> wrote:
On Wed, Jan 02, 2013 at 08:31:59PM +0800, lei yang wrote:
> I don't understand the domain bus slot fuction in below xml,becase,
> this is used when deal with management of host devices that can be
> handed to guests via passthrough as <hostdev> elements in the domain
> XML.( from
http://libvirt.org/formatnode.html)
>
> I don't see it use passthrough feature, why it has "domain" bus"
slot"
> and function here
You're mixing up two different addresses here - host addresses vs guest
addresses. Every device added to QEMU has a guest address of some kind,
typically either PCI or USB based. This specifies where the device
appears to the guest OS. When using host device passthrough, you also
need to specify the address of the host PCI device to assign.
> <disk type='file' device='disk'>
> <driver name='qemu' type='raw'/>
> <source file='/kvm/images/disk/vmname_boot.img'/>
> <target dev='vda' bus='virtio'/>
> <address type='pci' domain='0x0000' bus='0x00'
slot='0x04'
> function='0x0'/>
> </disk>
>
> <interface type='bridge'>
> <mac address='52:54:00:07:ab:b0'/>
> <source bridge='br0'/>
> <model type='virtio'/>
> <address type='pci' domain='0x0000' bus='0x00'
slot='0x03'
> function='0x0'/>
> </interface>
These are both guest addresses.
They are important, because when you start/stop guests, you want the
devices to always have the same address. If the address changed, then
some OS like Windows get unhappy and require re-activation.
Thanks for pointing me for this
I have two questiones.
1)I'm using guest as guest,I don't assgin address(disk or nic) to
guest,but it works well, any risk here?
2)I don't know how to set the address for guest, or just set a host
unused address to guest
Lei