public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager] ui: add netdevice: fix #3203: Use OS default model
@ 2021-01-07 10:04 Dominic Jäger
  2021-01-12 10:49 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Dominic Jäger @ 2021-01-07 10:04 UTC (permalink / raw)
  To: pve-devel

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@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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-12 10:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-07 10:04 [pve-devel] [PATCH manager] ui: add netdevice: fix #3203: Use OS default model Dominic Jäger
2021-01-12 10:49 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal