Re: [PATCH 20/23] Add support for hotplug/unplug of host storage 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 host storage devices.
> 
> Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
> ---
>  src/lxc/lxc_driver.c | 237 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 237 insertions(+)
> 
[...]
>  static int
> +lxcDomainAttachDeviceHostdevStorageLive(virLXCDriverPtr driver,
> +                                        virDomainObjPtr vm,
> +                                        virDomainDeviceDefPtr dev)
> +{

[...]

> +
> +    if (virCgroupAllowDevicePath(group, def->source.caps.u.storage.block,
> +                                 VIR_CGROUP_DEVICE_RW |
> +                                 VIR_CGROUP_DEVICE_MKNOD) != 0) {


VIR_CGROUP_DEVICE_RWM, prev patch has the same problem.

> +        virReportError(VIR_ERR_INTERNAL_ERROR,
> +                       _("cannot allow device %s for domain %s"),
> +                       def->source.caps.u.storage.block, vm->def->name);
> +        goto cleanup;
> +    }
> +
> +    vm->def->hostdevs[vm->def->nhostdevs++] = def;
> +
> +    ret = 0;
> +
> +cleanup:
> +    virDomainAuditHostdev(vm, def, "attach", ret == 0);
> +    if (group)
> +        virCgroupFree(&group);
> +    if (dst && created && ret < 0)
> +        unlink(dst);

dst and vroot need be freed.

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]