Re: [PATCH 19/23] Add support for hotplug/unplug of USB host devices in 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>
> 
> Wire up the attach/detach device drivers in LXC to support the
> hotplug/unplug of USB host devices.
> 
> Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
> ---
>  src/lxc/lxc_driver.c | 332 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 332 insertions(+)
> 

[...]

>  static int
> +lxcDomainDetachDeviceHostdevUSBLive(virLXCDriverPtr driver,
> +                                    virDomainObjPtr vm,
> +                                    virDomainDeviceDefPtr dev)
> +{
> +    virLXCDomainObjPrivatePtr priv = vm->privateData;
> +    virDomainHostdevDefPtr def = NULL;
> +    virCgroupPtr group = NULL;
> +    int idx, ret = -1;
> +    char *dst = NULL;
> +    char *vroot = NULL;
> +    usbDevice *usb = NULL;
> +
> +    if (!priv->initpid) {

No need,already checked in lxcDomainDetachDeviceHostdevLive

> +        virReportError(VIR_ERR_OPERATION_INVALID, "%s",
> +                       _("Cannot attach hostdev until init PID is known"));
> +        goto cleanup;
> +    }
> +

[...]

> +static int
> +lxcDomainDetachDeviceHostdevLive(virLXCDriverPtr driver,
> +                                 virDomainObjPtr vm,
> +                                 virDomainDeviceDefPtr dev)
> +{
> +    virLXCDomainObjPrivatePtr priv = vm->privateData;
> +
> +    if (!priv->initpid) {
> +        virReportError(VIR_ERR_OPERATION_INVALID, "%s",
> +                       _("Cannot attach hostdev until init PID is known"));
> +        return -1;
> +    }
> +

ACK

--
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]