rbd: skip unmap if device is not mapped

This commit is contained in:
Wolfgang Link
2015-09-10 10:29:10 +02:00
committed by Dietmar Maurer
parent c2c312175b
commit b50812f941

View File

@ -510,6 +510,8 @@ sub deactivate_volume {
my $pool = $scfg->{pool} ? $scfg->{pool} : 'rbd';
my $path = "/dev/rbd/$pool/$name";
return if ! -b $path;
my $cmd = &$rbd_cmd($scfg, $storeid, 'unmap', $path);
run_rbd_command($cmd, errmsg => "can't unmount rbd volume $name");