[pve-devel] [PATCH 1/3] Latest changes which removes unused config.

mir at datanom.net mir at datanom.net
Wed Oct 2 22:24:56 CEST 2013


From: Michael Rasmussen <mir at datanom.net>

Signed-off-by: Michael Rasmussen <mir at datanom.net>
---
 PVE/API2/OpenVZ.pm            |  6 ++++--
 www/manager/Makefile          |  1 +
 www/manager/Utils.js          |  2 ++
 www/manager/dc/StorageView.js | 11 +++++++++++
 www/manager/qemu/Clone.js     |  3 ++-
 www/manager/qemu/HDEdit.js    |  3 ++-
 6 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/PVE/API2/OpenVZ.pm b/PVE/API2/OpenVZ.pm
index 06fe60b..e6820d8 100644
--- a/PVE/API2/OpenVZ.pm
+++ b/PVE/API2/OpenVZ.pm
@@ -342,8 +342,10 @@ __PACKAGE__->register_method({
 		if !$param->{restore};
 	    $archive = '-';
 	} else {
-	    $rpcenv->check_volume_access($authuser, $storage_cfg, $vmid, $ostemplate);
-	    $archive = PVE::Storage::abs_filesystem_path($storage_cfg, $ostemplate);
+	    $archive = $rpcenv->check_volume_access($authuser, $storage_cfg, $vmid, $ostemplate);
+	    $archive = PVE::Storage::path($storage_cfg, $ostemplate) if !$archive;
+
+	    die "can't find file '$archive'\n" if ! -f $archive;
 	}
 
 	if (!defined($param->{searchdomain}) && 
diff --git a/www/manager/Makefile b/www/manager/Makefile
index fa0b585..6b85683 100644
--- a/www/manager/Makefile
+++ b/www/manager/Makefile
@@ -135,6 +135,7 @@ JSSRC= 				                 	\
 	storage/RBDEdit.js				\
 	storage/SheepdogEdit.js				\
 	storage/NexentaEdit.js				\
+	storage/ZFSEdit.js				\
 	dc/Summary.js					\
 	dc/OptionView.js				\
 	dc/StorageView.js				\
diff --git a/www/manager/Utils.js b/www/manager/Utils.js
index d301395..66f7f5c 100644
--- a/www/manager/Utils.js
+++ b/www/manager/Utils.js
@@ -689,6 +689,8 @@ Ext.define('PVE.Utils', { statics: {
 	    return 'Sheepdog';
 	} else if (value === 'nexenta') {
 	    return 'Nexenta';
+	} else if (value === 'zfs') {
+	    return 'ZFS';
 	} else if (value === 'iscsidirect') {
 	    return 'iSCSIDirect';
 	} else {
diff --git a/www/manager/dc/StorageView.js b/www/manager/dc/StorageView.js
index e7e0ee4..be5f81a 100644
--- a/www/manager/dc/StorageView.js
+++ b/www/manager/dc/StorageView.js
@@ -48,6 +48,8 @@ Ext.define('PVE.dc.StorageView', {
 		editor = 'PVE.storage.SheepdogEdit';
 	    } else if (type === 'nexenta') {
 		editor = 'PVE.storage.NexentaEdit';
+	    } else if (type === 'zfs') {
+		editor = 'PVE.storage.ZFSEdit';
 	    } else {
 		return;
 	    }
@@ -175,6 +177,15 @@ Ext.define('PVE.dc.StorageView', {
 				    win.show();
 				}
 			    },
+			    {
+				text: PVE.Utils.format_storage_type('ZFS'),
+				iconCls: 'pve-itype-icon-node',
+				handler: function() {
+				    var win = Ext.create('PVE.storage.ZFSEdit', {});
+				    win.on('destroy', reload);
+				    win.show();
+				}
+			    }
 */
 			]
 		    })
diff --git a/www/manager/qemu/Clone.js b/www/manager/qemu/Clone.js
index 87b4a98..5501a52 100644
--- a/www/manager/qemu/Clone.js
+++ b/www/manager/qemu/Clone.js
@@ -69,7 +69,8 @@ Ext.define('PVE.window.Clone', {
             rec.data.type === 'rbd' ||
             rec.data.type === 'iscsi' ||
             rec.data.type === 'sheepdog' ||
-            rec.data.type === 'nexenta'
+            rec.data.type === 'nexenta' ||
+			rec.data.type === 'zfs'
            ) {
             me.formatsel.setValue('raw');
             me.formatsel.setDisabled(true);
diff --git a/www/manager/qemu/HDEdit.js b/www/manager/qemu/HDEdit.js
index 311b67e..fc9dae8 100644
--- a/www/manager/qemu/HDEdit.js
+++ b/www/manager/qemu/HDEdit.js
@@ -192,7 +192,8 @@ Ext.define('PVE.qemu.HDInputPanel', {
 			} else if (rec.data.type === 'lvm' || 
 				   rec.data.type === 'rbd' ||
 				   rec.data.type === 'sheepdog' ||
-				   rec.data.type === 'nexenta') {
+				   rec.data.type === 'nexenta' ||
+				   rec.data.type === 'zfs') {
 			    me.hdfilesel.setDisabled(true);
 			    me.hdfilesel.setVisible(false);
 			    me.formatsel.setValue('raw');
-- 
1.8.4.rc3




More information about the pve-devel mailing list