+ warn "clone $volname: $basename snapname $snap to $name\n";
+
+ if (length $snapname) {
+ my (undef, undef, undef, $protected) = rbd_volume_info($scfg, $storeid, $volname, $snapname);
+
+ if (!$protected){
+ my $cmd = &$rbd_cmd($scfg, $storeid, 'snap', 'protect', $volname, '--snap', $snapname);
+ run_rbd_command($cmd, errmsg => "rbd protect $volname snap $snapname error");
+ }
+ }