Re: [PATCH 10/23] Add support for USB host device passthrough with LXC

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

 



On 2012/12/01 04:26, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
> 
> This adds support for host device passthrough with the
> LXC driver. Since there is only a single kernel image,
> it doesn't make sense to pass through PCI devices, but
> USB devices are fine. For the latter we merely need to
> make the /dev/bus/usb/NNN/MMM character device exist
> in the container's /dev
> 
> Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
> ---

[...]

>  
>  
> +static int lxcContainerSetupHostdevSubsysUSB(virDomainDefPtr vmDef ATTRIBUTE_UNUSED,
> +                                             virDomainHostdevDefPtr def ATTRIBUTE_UNUSED,
> +                                             const char *dstprefix ATTRIBUTE_UNUSED,
> +                                             virSecurityManagerPtr securityDriver ATTRIBUTE_UNUSED)
> +{
> +    int ret = -1;
> +    char *src = NULL;
> +    char *dstdir = NULL;
> +    char *dstfile = NULL;
> +    struct stat sb;
> +    mode_t mode;
> +
> +    if (virAsprintf(&dstdir, "/dev/bus/usb/%03d",
> +                    def->source.subsys.u.usb.bus) < 0) {

better to use USB_DEVFS instead of /dev/bus/usb/

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]