]> gitweb.fluxo.info Git - kvm-manager.git/commitdiff
trigger udev updates on lvm devices
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Sun, 20 Feb 2011 22:58:42 +0000 (17:58 -0500)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Sun, 20 Feb 2011 22:58:42 +0000 (17:58 -0500)
kvm-manager

index 8b96f0e6f60d2010b06d195ee291ec334867c532..9f445ec7903a386ae313f9bf6b310a4a06026378 100755 (executable)
@@ -47,6 +47,13 @@ up() {
         BOOTCHOICE=d
     fi
 
+    for disk in "$HDA" "$HDB" "HDC" "HDD"; do
+        if printf "%s" "$disk" | grep '^/dev/mapper/'; then
+            mappername=$(printf "%s" "$disk" | sed 's!^/dev/mapper/!!')
+            udevadm trigger --subsystem-match=block --attr-match=dm/name="$mappername"
+        fi
+    done
+
     # set up the disks, if needed:
     [ -z "$HDA" ] || KVMARGS="$KVMARGS -drive file=$HDA,if=virtio,id=hda,boot=on,format=raw"
     [ -z "$HDB" ] || KVMARGS="$KVMARGS -drive file=$HDB,if=virtio,id=hdb,format=raw"