#!/bin/sh

# If libvirt is not installed on the host permissions need to be set
chmod 660 /dev/kvm
chown root:kvm /dev/kvm

echo "Starting libvirtd."
exec /usr/sbin/libvirtd

#!/bin/sh

# If libvirt is not installed on the host permissions need to be set
# If running in qemu, we don't need to set anything as /dev/kvm won't exist
if [[ -c /dev/kvm ]]; then
    chmod 660 /dev/kvm
    chown root:kvm /dev/kvm
fi

echo "Starting libvirtd."
exec /usr/sbin/libvirtd

Test for presence of /dev/kvm before setting permissions
Test for presence of /dev/kvm before setting permissions

In a native QEMU environment there is no /dev/kvm.

Change-Id: I4d0eb32fd6fad3a4c9c15c7c2b12430b2e4db154