[pve-devel] [PATCH manager] ui: add netdevice: fix #3203: Use OS default model

Dominic Jäger d.jaeger at proxmox.com
Thu Jan 7 11:04:38 CET 2021


In the VM create wizard we automatically set e1000 for Windows and virtio for
Linux.  We should also do this when adding a network device in the hardware
view.

OSDefaults.generic.networkCard (=e1000) is always available.  Hence, leave this
as default value for the field and then try to get the ostype via API and
overwrite the default e1000.

Signed-off-by: Dominic Jäger <d.jaeger at proxmox.com>
---
 www/manager6/qemu/NetworkEdit.js | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/www/manager6/qemu/NetworkEdit.js b/www/manager6/qemu/NetworkEdit.js
index 3b093b46..f8b448ce 100644
--- a/www/manager6/qemu/NetworkEdit.js
+++ b/www/manager6/qemu/NetworkEdit.js
@@ -217,7 +217,14 @@ Ext.define('PVE.qemu.NetworkEdit', {
 			    break;
 			}
 		    }
-		    ipanel.setNetwork(me.confid);		    
+
+		    let ostype = me.vmconfig.ostype;
+		    let defaults = PVE.qemu.OSDefaults.getDefaults(ostype);
+		    let data = {
+			model: defaults.networkCard,
+		    };
+
+		    ipanel.setNetwork(me.confid, data);
 		}
 	    }
 	});
-- 
2.20.1





More information about the pve-devel mailing list