nova-libvirt: fix kvm permission issue

When deploy in AArch64, will meet kvm permission issue.
Fix it with Arch specified.

Closes-bug: #1715356

Change-Id: I09dc27693a83dc77704773a25547725de480dbe8
Signed-off-by: Kevin Zhao <kevin.zhao@arm.com>
This commit is contained in:
Kevin Zhao 2017-09-07 17:28:29 +08:00 committed by Duong Ha-Quang
parent a0700e5181
commit f1b98a4925
1 changed files with 11 additions and 2 deletions

View File

@ -4,8 +4,17 @@
# Fix permissions for libvirt
# Do not remove unless CentOS has been validated
if [[ -c /dev/kvm ]]; then
chmod 660 /dev/kvm
chown root:qemu /dev/kvm
if [[ "${KOLLA_BASE_DISTRO}" =~ debian|ubuntu ]]; then
chmod 660 /dev/kvm
if [[ "$(uname -m)" == "aarch64" ]]; then
chown root:kvm /dev/kvm
else
chown root:qemu /dev/kvm
fi
else
chmod 666 /dev/kvm
chown root:kvm /dev/kvm
fi
fi
# Mount xenfs for libxl to work