aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2013-07-18 21:15:59 -0400
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>2013-07-18 21:15:59 -0400
commitaa0fb4623e9f5658ebb03b960d0f0754d99e8099 (patch)
treedb9a412d43e7ba11713c341bde263a8c35834f34
parent7ec3940969c7c3e6751a2b00d145d027685d7d50 (diff)
downloadkvm-manager-aa0fb4623e9f5658ebb03b960d0f0754d99e8099.tar.gz
kvm-manager-aa0fb4623e9f5658ebb03b960d0f0754d99e8099.tar.bz2
boot=on is deprecated in wheezy, but squeeze needs it.
despite -boot=c, squeeze's kvm will not boot the first disk if it does not have boot=on. So we have this hacky check to see if we need it.
-rwxr-xr-xkvm-manager9
1 files changed, 8 insertions, 1 deletions
diff --git a/kvm-manager b/kvm-manager
index 0b170b2..b2ed2d6 100755
--- a/kvm-manager
+++ b/kvm-manager
@@ -57,8 +57,15 @@ up() {
done
udevadm trigger /dev/kvm
+ # older versions need to have at least the first disk marked as boot=on or they cannot boot.
+ if kvm --version 2>/dev/null | sed 's/.*version \([0-9.]*\).*/\1/' | grep -q '^0' ; then
+ first_disk_extra_args=",boot=on"
+ else
+ first_disk_extra_args=
+ fi
+
# set up the disks, if needed:
- [ -z "$HDA" ] || KVMARGS="$KVMARGS -drive file=$HDA,if=virtio,id=hda,boot=on,format=raw"
+ [ -z "$HDA" ] || KVMARGS="$KVMARGS -drive file=$HDA,if=virtio,id=hda,format=raw$first_disk_extra_args"
[ -z "$HDB" ] || KVMARGS="$KVMARGS -drive file=$HDB,if=virtio,id=hdb,format=raw"
[ -z "$HDC" ] || KVMARGS="$KVMARGS -drive file=$HDC,if=virtio,id=hdc,format=raw"
[ -z "$HDD" ] || KVMARGS="$KVMARGS -drive file=$HDD,if=virtio,id=hdd,format=raw"