a version of kvm like 2.4.10 would have claimed to be greater than
2.6.0 using the existing comparison. we'll rely on dpkg's
implementation of version comparisons instead.
this does make kvm-manager more specific to debian and debian-derived
systems, but if folks who prefer other systems want to offer patches,
they would be happily accepted :)
OWNERGROUP=$(groups "$OWNER" | cut -f1 -d\ )
OWNERHOME=$(getent passwd "$OWNER" | cut -f6 -d: )
-kvm_version=$(kvm --version | head -n1 | sed -E 's/QEMU emulator version ([0-9.]+).*/\1/' | tr -d '.')
+kvm_version=$(kvm --version | head -n1 | sed -E 's/^QEMU emulator version ([0-9.]+).*/\1/')
# Disks can be HDA, HDB, HDC, etc. For each disk, we want to detect the
# corresponding environment variables for disk read/write restrictions
local option variable argument value
disk_io_params=
- if [ "$kvm_version" -lt "260" ]; then
+ if dpkg --compare-versions "$kvm_version" lt 2.6.0; then
# Only supported in version 2.6.0 or above.
return
fi