[pve-devel] [PATCH v10 manager 15/19] ui: HD edit: set drive: make specifying file/volid optional

Fabian Ebner f.ebner at proxmox.com
Wed Apr 6 10:04:12 CEST 2022


In preparation for the import from OVF functionality in the wizard,
where the disk's volid isn't known yet (only the import source is).

Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 www/manager6/qemu/HDEdit.js | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/www/manager6/qemu/HDEdit.js b/www/manager6/qemu/HDEdit.js
index 76c281c7..7acb922c 100644
--- a/www/manager6/qemu/HDEdit.js
+++ b/www/manager6/qemu/HDEdit.js
@@ -144,13 +144,16 @@ Ext.define('PVE.qemu.HDInputPanel', {
 
 	me.drive = drive;
 
-	var values = {};
-	var match = drive.file.match(/^([^:]+):/);
-	if (match) {
-	    values.hdstorage = match[1];
+	let values = {};
+	if (drive.file) {
+	    let match = drive.file.match(/^([^:]+):/);
+	    if (match) {
+		values.hdstorage = match[1];
+	    }
+
+	    values.hdimage = drive.file;
 	}
 
-	values.hdimage = drive.file;
 	values.backup = PVE.Parser.parseBoolean(drive.backup, 1);
 	values.noreplicate = !PVE.Parser.parseBoolean(drive.replicate, 1);
 	values.diskformat = drive.format || 'raw';
-- 
2.30.2






More information about the pve-devel mailing list