rbd, zfs, sheepdog: bugfix : fix alloc_image if name is specified

Currently vmstate snapshot with rbd have wrong name,
because rbd alloc_image don't care if $name is provided

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
Alexandre Derumier
2014-11-20 16:01:44 +01:00
committed by Dietmar Maurer
parent e3c51a6c38
commit 3fad260379
3 changed files with 3 additions and 3 deletions

View File

@ -478,7 +478,7 @@ sub alloc_image {
die "illegal name '$name' - sould be 'vm-$vmid-*'\n"
if $name && $name !~ m/^vm-$vmid-/;
$name = &$find_free_diskname($storeid, $scfg, $vmid);
$name = &$find_free_diskname($storeid, $scfg, $vmid) if !$name;
zfs_create_zvol($scfg, $name, $size);
my $guid = zfs_create_lu($scfg, $name);