[libvirt] [PATCH RESEND V2 1/1] Add hw random number generator (/dev/hwrng) to cgroup ACL
Eric Blake
eblake at redhat.com
Mon Jan 27 16:51:39 UTC 2014
On 01/16/2014 06:41 AM, Pradipta Kr. Banerjee wrote:
> From: "Pradipta Kr. Banerjee" <bpradip at in.ibm.com>
>
> Creating a qemu VM with /dev/hwrng as backend RNG device throws the
> following error - "Could not open '/dev/hwrng': Permission denied"
> This patch fixes the issue
>
> Signed-off-by: Pradipta Kr. Banerjee <bpradip at in.ibm.com>
> ---
> v2: Added acl code as part of per-VM cgroup setup
>
> src/qemu/qemu_cgroup.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
> index f0cacd0..8e2076e 100644
> --- a/src/qemu/qemu_cgroup.c
> +++ b/src/qemu/qemu_cgroup.c
> @@ -533,6 +533,18 @@ qemuSetupDevicesCgroup(virQEMUDriverPtr driver,
> goto cleanup;
> }
>
> + if (vm->def->rng &&
> + (vm->def->rng->backend == VIR_DOMAIN_RNG_BACKEND_RANDOM)) {
> + VIR_DEBUG("Setting Cgroup ACL for RNG device");
> + rv = virCgroupAllowDevicePath(priv->cgroup, vm->def->rng->source.file,
> + VIR_CGROUP_DEVICE_RW);
Indentation is off. ACK with that fixed, so I pushed the patch.
Congrats on your first libvirt patch, and apologies for the delayed review.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140127/63ccf9b3/attachment-0001.sig>
More information about the libvir-list
mailing list