all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: "Dominic Jäger" <d.jaeger@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager] ui: add netdevice: fix #3203: Use OS default model
Date: Thu,  7 Jan 2021 11:04:38 +0100	[thread overview]
Message-ID: <20210107100438.73753-1-d.jaeger@proxmox.com> (raw)

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




             reply	other threads:[~2021-01-07 10:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-07 10:04 Dominic Jäger [this message]
2021-01-12 10:49 ` [pve-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210107100438.73753-1-d.jaeger@proxmox.com \
    --to=d.jaeger@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal