zfs: fix wait by alloc_image

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
This commit is contained in:
Wolfgang Link
2015-01-28 10:37:58 +01:00
committed by Dietmar Maurer
parent 584d97f646
commit 9b61bc9e88
2 changed files with 15 additions and 1 deletions

View File

@ -184,6 +184,13 @@ sub alloc_image {
$name = $class->zfs_find_free_diskname($storeid, $scfg, $vmid) if !$name;
$class->zfs_create_zvol($scfg, $name, $size);
run_command ("udevadm trigger --subsystem-match block");
run_command ("udevadm settle --timeout 5");
for (1..10) {
last if -e "/dev/zvol/$scfg->{pool}/$name" ;
Time::HiRes::usleep(100);
}
return $name;
}