From aa0fb4623e9f5658ebb03b960d0f0754d99e8099 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Thu, 18 Jul 2013 21:15:59 -0400 Subject: 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. --- kvm-manager | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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" -- cgit v1.2.3