]> git.proxmox.com Git - qemu-server.git/commitdiff
clone: check is we can clone to target storage
authorDietmar Maurer <dietmar@proxmox.com>
Mon, 13 May 2013 09:16:21 +0000 (11:16 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 13 May 2013 09:17:38 +0000 (11:17 +0200)
PVE/API2/Qemu.pm
changelog.Debian

index 13263688bc68ea908c45b40dccf8e3d91cd2155f..f7ae89dbffdd107c285b580a4335a5452715e28e 100644 (file)
@@ -1936,6 +1936,18 @@ __PACKAGE__->register_method({
 
        my $storecfg = PVE::Storage::config();
 
+       if ($storage) {
+           # check if storage is enabled on local node
+           PVE::Storage::storage_check_enabled($storecfg, $storage);
+           if ($target) {
+               # check if storage is available on target node
+               PVE::Storage::storage_check_node($storecfg, $storage, $target);
+               # clone only works if target storage is shared
+               my $scfg = PVE::Storage::storage_config($storecfg, $storage);
+               die "can't clone to non-shared storage '$storage'\n" if !$scfg->{shared};
+           }
+       }
+
         PVE::Cluster::check_cfs_quorum();
 
        my $running = PVE::QemuServer::check_running($vmid) || 0;
index 17ce837cd3a8df047d5627c3ed1dc905de8dfaf5..ed8c2e9171fe57c41982214eb2db4aadfa5846f3 100644 (file)
@@ -1,6 +1,8 @@
 qemu-server (3.0-10) unstable; urgency=low
 
   * fix bug #381: use PVE::Tools::next_migrate_port()
+  
+  * clone: check is we can clone to target storage
 
  -- Proxmox Support Team <support@proxmox.com>  Mon, 13 May 2013 07:31:47 +0200