]> git.proxmox.com Git - pve-storage.git/commitdiff
remove running from Storage and check it in QemuServer
authorWolfgang Link <w.link@proxmox.com>
Wed, 6 May 2015 07:57:35 +0000 (09:57 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 6 May 2015 09:42:38 +0000 (11:42 +0200)
It is better to check if a VM is running in QemuServer then in Storage.
for the Storage there is no difference if it is running or not.

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
PVE/Storage.pm
PVE/Storage/ISCSIDirectPlugin.pm
PVE/Storage/LVMPlugin.pm
PVE/Storage/Plugin.pm
PVE/Storage/RBDPlugin.pm
PVE/Storage/SheepdogPlugin.pm
PVE/Storage/ZFSPoolPlugin.pm

index b542ee69b4fcf3d660adf4a9231ce18e646e107b..92c7d146c61ab0d6bfec4e2d8f180be39409c1fc 100755 (executable)
@@ -162,13 +162,13 @@ sub volume_rollback_is_possible {
 }
 
 sub volume_snapshot {
-    my ($cfg, $volid, $snap, $running) = @_;
+    my ($cfg, $volid, $snap) = @_;
 
     my ($storeid, $volname) = parse_volume_id($volid, 1);
     if ($storeid) {
         my $scfg = storage_config($cfg, $storeid);
         my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
-        return $plugin->volume_snapshot($scfg, $storeid, $volname, $snap, $running);
+        return $plugin->volume_snapshot($scfg, $storeid, $volname, $snap);
     } elsif ($volid =~ m|^(/.+)$| && -e $volid) {
         die "snapshot file/device '$volid' is not possible\n";
     } else {
index c957aded0a9bc03362fc7e8e08042fe14d4d3d4d..763c48280e179909e78cbf1f199a608b87ad9680 100644 (file)
@@ -205,7 +205,7 @@ sub volume_resize {
 }
 
 sub volume_snapshot {
-    my ($class, $scfg, $storeid, $volname, $snap, $running) = @_;
+    my ($class, $scfg, $storeid, $volname, $snap) = @_;
     die "volume snapshot is not possible on iscsi device";
 }
 
index 1688bb58d82ddee0e9870bb95f95cca6d3115249..19eb78cf5e862e5d7e8d2b53944bd99b59a975ee 100644 (file)
@@ -456,7 +456,7 @@ sub volume_resize {
 }
 
 sub volume_snapshot {
-    my ($class, $scfg, $storeid, $volname, $snap, $running) = @_;
+    my ($class, $scfg, $storeid, $volname, $snap) = @_;
 
     die "lvm snapshot is not implemented";
 }
index eaae5b80ae6718fdd514c1a9efbce645dd355922..ab1baa4954c6b00f292cd29f786bb88b2402c733 100644 (file)
@@ -641,12 +641,10 @@ sub volume_resize {
 }
 
 sub volume_snapshot {
-    my ($class, $scfg, $storeid, $volname, $snap, $running) = @_;
+    my ($class, $scfg, $storeid, $volname, $snap) = @_;
 
     die "can't snapshot this image format\n" if $volname !~ m/\.(qcow2|qed)$/;
 
-    return 1 if $running;
-
     my $path = $class->filesystem_path($scfg, $volname);
 
     my $cmd = ['/usr/bin/qemu-img', 'snapshot','-c', $snap, $path];
index 2c45a68dc09871721c9a6074b963e8de1624eb5b..878fa169c2dcfe6f008926f719b053bd26f2493b 100644 (file)
@@ -510,9 +510,7 @@ sub volume_resize {
 }
 
 sub volume_snapshot {
-    my ($class, $scfg, $storeid, $volname, $snap, $running) = @_;
-
-    return 1 if $running;
+    my ($class, $scfg, $storeid, $volname, $snap) = @_;
 
     my ($vtype, $name, $vmid) = $class->parse_volname($volname);
 
index 3e2c12657151e8dad2d3c97f53800acb7e38a6cc..e358f9e4d10e438efff49d0315f42298cc7ba457 100644 (file)
@@ -389,9 +389,7 @@ sub volume_resize {
 }
 
 sub volume_snapshot {
-    my ($class, $scfg, $storeid, $volname, $snap, $running) = @_;
-
-    return 1 if $running;
+    my ($class, $scfg, $storeid, $volname, $snap) = @_;
 
     my ($vtype, $name, $vmid, $basename, $basevmid, $isBase) =
        $class->parse_volname($volname);
index 37e031ca6d6b5e8c9e46ba000d366c26e155ec82..cae598dd1c49c0742b580424d1fae32b04284fd8 100644 (file)
@@ -446,7 +446,7 @@ sub volume_size_info {
 }
 
 sub volume_snapshot {
-    my ($class, $scfg, $storeid, $volname, $snap, $running) = @_;
+    my ($class, $scfg, $storeid, $volname, $snap) = @_;
 
     $class->zfs_request($scfg, undef, 'snapshot', "$scfg->{pool}/$volname\@$snap");
 }