[pve-devel] [PATCH manager 3/4] ui: guest import: correctly set default scsihw value

Dominik Csapak d.csapak at proxmox.com
Tue Mar 19 14:00:31 CET 2024


we have to set it to '__default__' if we didn't get one from the api

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/window/GuestImport.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/www/manager6/window/GuestImport.js b/www/manager6/window/GuestImport.js
index 719bab31..297e2198 100644
--- a/www/manager6/window/GuestImport.js
+++ b/www/manager6/window/GuestImport.js
@@ -204,7 +204,8 @@ Ext.define('PVE.window.GuestImport', {
 		rec.commit();
 	    }
 	    let prepareVirtio = me.lookup('mapSata').getValue();
-	    me.lookup('scsihw').setValue(prepareVirtio && isWindows ? 'virtio-scsi-single' : me.getView().vmConfig.scsihw);
+	    let defaultScsiHw = me.getView().vmConfig.scsihw ?? '__default__';
+	    me.lookup('scsihw').setValue(prepareVirtio && isWindows ? 'virtio-scsi-single' : defaultScsiHw );
 
 	    me.refreshGrids();
 	},
@@ -662,6 +663,7 @@ Ext.define('PVE.window.GuestImport', {
 			    xtype: 'pveScsiHwSelector',
 			    reference: 'scsihw',
 			    name: 'scsihw',
+			    value: '__default__',
 			    submitValue: false,
 			    fieldLabel: gettext('SCSI Controller'),
 			},
-- 
2.39.2





More information about the pve-devel mailing list