2015-05-04 22:15:01 +02:00
|
|
|
Enhancement for the following GUI wizard installation options.
|
|
|
|
1) If Xen, leave 'Architecture options' expanded so users know PV
|
|
|
|
is the default
|
|
|
|
2) Under 'Network selection' default to a bridge that has an actual
|
|
|
|
IP address if available (not just the first one found).
|
2017-08-09 21:02:00 +02:00
|
|
|
Index: virt-manager-1.4.2/virtManager/create.py
|
2014-03-19 16:18:34 +01:00
|
|
|
===================================================================
|
2017-08-09 21:02:00 +02:00
|
|
|
--- virt-manager-1.4.2.orig/virtManager/create.py
|
|
|
|
+++ virt-manager-1.4.2/virtManager/create.py
|
|
|
|
@@ -397,8 +397,20 @@ class vmmCreate(vmmGObjectUI):
|
2014-03-19 16:18:34 +01:00
|
|
|
self.widget("method-local").set_active(True)
|
|
|
|
self.widget("create-conn").set_active(-1)
|
2015-11-26 00:27:12 +01:00
|
|
|
activeconn = self._populate_conn_list(urihint)
|
2014-03-19 16:18:34 +01:00
|
|
|
- self.widget("arch-expander").set_expanded(False)
|
2017-08-09 21:02:00 +02:00
|
|
|
self.widget("vz-virt-type-hvm").set_active(True)
|
2015-05-04 22:15:01 +02:00
|
|
|
+ # For Xen have the expander open so users can see PV is the default
|
2014-03-24 16:05:15 +01:00
|
|
|
+ if activeconn and activeconn.is_xen():
|
2014-03-19 16:18:34 +01:00
|
|
|
+ self.widget("arch-expander").set_expanded(True)
|
|
|
|
+ else:
|
|
|
|
+ self.widget("arch-expander").set_expanded(False)
|
|
|
|
+
|
|
|
|
+ # Default to Network install if host was installed that way
|
|
|
|
+ host_instsrc = util.getHostInstallSource()
|
|
|
|
+ if host_instsrc is not None and \
|
2014-03-19 23:29:53 +01:00
|
|
|
+ (host_instsrc.startswith('ftp:') or host_instsrc.startswith('http:') or \
|
|
|
|
+ host_instsrc.startswith('smb:') or host_instsrc.startswith('nfs:')):
|
2014-03-19 16:18:34 +01:00
|
|
|
+ self.widget("method-local").set_active(False)
|
|
|
|
+ self.widget("method-tree").set_active(True)
|
|
|
|
|
2015-11-26 00:27:12 +01:00
|
|
|
if self._set_conn(activeconn) is False:
|
|
|
|
return False
|
2017-08-09 21:02:00 +02:00
|
|
|
Index: virt-manager-1.4.2/virtManager/netlist.py
|
2014-03-19 16:18:34 +01:00
|
|
|
===================================================================
|
2017-08-09 21:02:00 +02:00
|
|
|
--- virt-manager-1.4.2.orig/virtManager/netlist.py
|
|
|
|
+++ virt-manager-1.4.2/virtManager/netlist.py
|
|
|
|
@@ -170,9 +170,19 @@ class vmmNetworkList(vmmGObjectUI):
|
2014-10-29 18:03:15 +01:00
|
|
|
return rows, vnet_bridges, default_label
|
2014-03-19 16:18:34 +01:00
|
|
|
|
2014-10-29 18:03:15 +01:00
|
|
|
def _find_physical_devices(self, vnet_bridges):
|
2014-03-19 16:18:34 +01:00
|
|
|
+ def check_for_inet(bname):
|
|
|
|
+ if bname is not None:
|
|
|
|
+ from subprocess import Popen, PIPE
|
|
|
|
+ p = Popen(['/sbin/ip', 'addr', 'show', bname], stdout=PIPE, stderr=PIPE)
|
|
|
|
+ stdout, stderr = p.communicate()
|
|
|
|
+ if stdout and 'inet' in stdout:
|
|
|
|
+ return True
|
|
|
|
+ return False
|
|
|
|
+
|
2014-10-29 18:03:15 +01:00
|
|
|
rows = []
|
|
|
|
can_default = False
|
|
|
|
default_label = None
|
|
|
|
+ default_label_with_inet = None
|
2014-03-19 16:18:34 +01:00
|
|
|
skip_ifaces = ["lo"]
|
|
|
|
|
2014-10-29 18:03:15 +01:00
|
|
|
vnet_taps = []
|
2017-08-09 21:02:00 +02:00
|
|
|
@@ -232,10 +242,18 @@ class vmmNetworkList(vmmGObjectUI):
|
2014-10-29 18:03:15 +01:00
|
|
|
if can_default and not default_label:
|
|
|
|
default_label = label
|
2014-03-19 16:18:34 +01:00
|
|
|
|
|
|
|
+ # Default to a bridge that has an actual inet addr
|
2014-10-29 18:03:15 +01:00
|
|
|
+ if default_label_with_inet is None:
|
|
|
|
+ if check_for_inet(source_name):
|
|
|
|
+ default_label_with_inet = label
|
2014-03-19 16:18:34 +01:00
|
|
|
+
|
2014-10-29 18:03:15 +01:00
|
|
|
rows.append(self._build_source_row(
|
|
|
|
nettype, source_name, label, sensitive, True,
|
|
|
|
key=name))
|
2014-03-19 16:18:34 +01:00
|
|
|
|
2014-10-29 18:03:15 +01:00
|
|
|
+ if default_label and default_label_with_inet is not None:
|
|
|
|
+ default_label = default_label_with_inet
|
2014-03-19 16:18:34 +01:00
|
|
|
+
|
2014-10-29 18:03:15 +01:00
|
|
|
return rows, default_label
|
2014-03-19 16:18:34 +01:00
|
|
|
|
2015-11-26 00:27:12 +01:00
|
|
|
def _populate_network_model(self, model):
|