[pve-devel] [PATCH] be more verebose on rbd commands to get progress
Stefan Priebe
s.priebe at profihost.ag
Fri May 31 11:46:08 CEST 2013
Signed-off-by: Stefan Priebe <s.priebe at profihost.ag>
---
PVE/Storage/RBDPlugin.pm | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm
index e147346..b3f9d20 100644
--- a/PVE/Storage/RBDPlugin.pm
+++ b/PVE/Storage/RBDPlugin.pm
@@ -293,7 +293,7 @@ sub create_base {
my $newvolname = $basename ? "$basename/$newname" : "$newname";
my $cmd = &$rbd_cmd($scfg, $storeid, 'rename', &$add_pool_to_disk($scfg, $name), &$add_pool_to_disk($scfg, $newname));
- run_command($cmd, errmsg => "rbd rename $name' error", errfunc => sub {});
+ run_command($cmd, errmsg => "rbd rename '$name' error");
my $running = undef; #fixme : is create_base always offline ?
@@ -303,7 +303,7 @@ sub create_base {
if (!$protected){
my $cmd = &$rbd_cmd($scfg, $storeid, 'snap', 'protect', $newname, '--snap', $snap);
- run_command($cmd, errmsg => "rbd protect $newname snap $snap' error", errfunc => sub {});
+ run_command($cmd, errmsg => "rbd protect $newname snap $snap' error");
}
return $newvolname;
@@ -327,7 +327,7 @@ sub clone_image {
my $newvol = "$basename/$name";
my $cmd = &$rbd_cmd($scfg, $storeid, 'clone', &$add_pool_to_disk($scfg, $basename), '--snap', $snap, &$add_pool_to_disk($scfg, $name));
- run_command($cmd, errmsg => "rbd clone $basename' error", errfunc => sub {});
+ run_command($cmd, errmsg => "rbd clone $basename' error");
return $newvol;
}
@@ -342,7 +342,7 @@ sub alloc_image {
$name = &$find_free_diskname($storeid, $scfg, $vmid);
my $cmd = &$rbd_cmd($scfg, $storeid, 'create', '--format' , 2, '--size', int(($size+1023)/1024), $name);
- run_command($cmd, errmsg => "rbd create $name' error", errfunc => sub {});
+ run_command($cmd, errmsg => "rbd create $name' error");
return $name;
}
@@ -358,15 +358,15 @@ sub free_image {
my (undef, undef, undef, $protected) = rbd_volume_info($scfg, $storeid, $name, $snap);
if ($protected){
my $cmd = &$rbd_cmd($scfg, $storeid, 'snap', 'unprotect', $name, '--snap', $snap);
- run_command($cmd, errmsg => "rbd unprotect $name snap $snap' error", errfunc => sub {});
+ run_command($cmd, errmsg => "rbd unprotect $name snap $snap' error");
}
}
my $cmd = &$rbd_cmd($scfg, $storeid, 'snap', 'purge', $name);
- run_command($cmd, errmsg => "rbd snap purge $volname' error", outfunc => sub {}, errfunc => sub {});
+ run_command($cmd, errmsg => "rbd snap purge $volname' error");
$cmd = &$rbd_cmd($scfg, $storeid, 'rm', $name);
- run_command($cmd, errmsg => "rbd rm $volname' error", outfunc => sub {}, errfunc => sub {});
+ run_command($cmd, errmsg => "rbd rm $volname' error");
return undef;
}
@@ -467,7 +467,7 @@ sub volume_resize {
my ($vtype, $name, $vmid) = $class->parse_volname($volname);
my $cmd = &$rbd_cmd($scfg, $storeid, 'resize', '--size', ($size/1024/1024), $name);
- run_command($cmd, errmsg => "rbd resize $volname' error", errfunc => sub {});
+ run_command($cmd, errmsg => "rbd resize $volname' error");
return undef;
}
@@ -479,7 +479,7 @@ sub volume_snapshot {
my ($vtype, $name, $vmid) = $class->parse_volname($volname);
my $cmd = &$rbd_cmd($scfg, $storeid, 'snap', 'create', '--snap', $snap, $name);
- run_command($cmd, errmsg => "rbd snapshot $volname' error", errfunc => sub {});
+ run_command($cmd, errmsg => "rbd snapshot $volname' error");
return undef;
}
@@ -489,7 +489,7 @@ sub volume_snapshot_rollback {
my ($vtype, $name, $vmid) = $class->parse_volname($volname);
my $cmd = &$rbd_cmd($scfg, $storeid, 'snap', 'rollback', '--snap', $snap, $name);
- run_command($cmd, errmsg => "rbd snapshot $volname to $snap' error", errfunc => sub {});
+ run_command($cmd, errmsg => "rbd snapshot $volname to $snap' error");
}
sub volume_snapshot_delete {
@@ -500,7 +500,7 @@ sub volume_snapshot_delete {
my ($vtype, $name, $vmid) = $class->parse_volname($volname);
my $cmd = &$rbd_cmd($scfg, $storeid, 'snap', 'rm', '--snap', $snap, $name);
- run_command($cmd, errmsg => "rbd snapshot $volname' error", errfunc => sub {});
+ run_command($cmd, errmsg => "rbd snapshot $volname' error");
return undef;
}
--
1.7.10.4
More information about the pve-devel
mailing list