]> gitweb.fluxo.info Git - kvm-manager.git/commitdiff
boot=on is deprecated in wheezy, but squeeze needs it.
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Fri, 19 Jul 2013 01:15:59 +0000 (21:15 -0400)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Fri, 19 Jul 2013 01:15:59 +0000 (21:15 -0400)
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

index 0b170b2a3f5690108786c15f7bc486dc06fcb2fc..b2ed2d649b42ac6711d6d3c11e4b13a41a274016 100755 (executable)
@@ -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"