Signed-off-by: Fabian Ebner <[email protected]>
---
 www/manager6/qemu/HDEdit.js | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/www/manager6/qemu/HDEdit.js b/www/manager6/qemu/HDEdit.js
index 7acb922c..991cc16a 100644
--- a/www/manager6/qemu/HDEdit.js
+++ b/www/manager6/qemu/HDEdit.js
@@ -142,6 +142,9 @@ Ext.define('PVE.qemu.HDInputPanel', {
     setDrive: function(drive) {
        var me = this;
 
+       let importPath = drive.importPath;
+       delete drive.importPath;
+
        me.drive = drive;
 
        let values = {};
@@ -173,6 +176,15 @@ Ext.define('PVE.qemu.HDInputPanel', {
        values.iops_rd_max = drive.iops_rd_max;
        values.iops_wr_max = drive.iops_wr_max;
 
+       if (importPath) {
+           values[`diskSource-${me.id}`] = 'path';
+           values.sourcePath = importPath;
+
+           // Doesn't happen automatically if not rendered yet.
+           me.down('radiofield[inputValue=empty]').setValue(false);
+           me.down('radiofield[inputValue=volume]').setValue(false);
+       }
+
        me.setValues(values);
     },
 
-- 
2.30.2



_______________________________________________
pve-devel mailing list
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to