Re: How to attach USB disk to specified USB controller in domian?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/17/2013 02:47 AM, Jianwei Hu wrote:
> Hi guys,
> 
> I want to attach a few USB disks to specified USB controller in domain on libvirt layer, but I didn't find any method to deal with it. Anyone can help me on that?
> 
> I added some USB type disk to my domain, started it, I found all USB disk had been attached to same USB controller automatically, I want to assign some USB disks to another controller manually but I can't find the entry. qemu-kvm has provided command line to support it by using "bus" argument.(like: device_add usb-storage,id=my_usb_disk,drive=my_usb_disk,bus=usb.0 )
> 
> Action steps:
> 1. Add some USB disks to domain xml, 
> <disk type='file' device='disk'>
>       <driver name='qemu' type='raw'/>
>       <source file='/var/lib/libvirt/images/usb-img/usb-1.img'/>
>       <target dev='sda' bus='usb'/>
>       <alias name='usb-disk0'/>
>     </disk>

To force the guest to see the device under a particular UBS controller,
you need to include an <address> designation in your XML.

Check the 'virsh dumpxml' output to see what <address> got autogenerated
for your use case, then adjust the bus number in that address to instead
point to the controller number you want it associated with.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
libvirt-users mailing list
libvirt-users@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvirt-users

[Index of Archives]     [Virt Tools]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux