2015-05-04 22:15:01 +02:00
|
|
|
Enhancement to default to the host os version when creating a VM
|
|
|
|
and media detection of the install source is turned off.
|
2019-02-04 19:46:20 +01:00
|
|
|
Index: virt-manager-2.1.0/virtManager/create.py
|
2013-07-03 23:44:06 +02:00
|
|
|
===================================================================
|
2019-02-04 19:46:20 +01:00
|
|
|
--- virt-manager-2.1.0.orig/virtManager/create.py
|
|
|
|
+++ virt-manager-2.1.0/virtManager/create.py
|
2018-10-30 23:00:52 +01:00
|
|
|
@@ -10,6 +10,9 @@ import pkgutil
|
2017-10-30 21:23:56 +01:00
|
|
|
import os
|
- If connection is Xen, default to PV instead of HVM.
virtman-default-to-xen-pv.patch
- Update to virt-manager 1.0.0
* virt-manager: Snapshot support
* New tool virt-xml: Edit libvirt XML in one shot from the command line. Check out some examples: http://www.redhat.com/archives/libvir-list/2014-January/msg01226.html
* Improved defaults: qcow2, USB2, host CPU model, guest agent channel, …
* Introspect command line options like –disk=? or –network=help
* The virt-image tool will be removed before the next release, speak up if you have a good reason not to remove it.
* virt-manager: Support arm vexpress VM creation
* virt-manager: Add guest memory usage graphs (Thorsten Behrens)
* virt-manager: UI for editing devices (Cédric Bosdonnat)
* Spice USB redirection support (Guannan Ren)
* UI and command line support (Stefan Berger)
* UI and command line support (Giuseppe Scrivano)
* UI and command line support (Chen Hanxiao)
* command line support (Chen Hanxiao)
* virt-manager: support for glusterfs storage pools (Giuseppe Scrivano)
* cli: New options –memory, –features, –clock, –metadata, –pm
* Greatly improve app responsiveness when connecting to remote hosts
* Lots of UI cleanup and improvements
virt-manager-1.0.0.tar.bz2
- Dropped the following patches by taking a newer upstream tarball
virt-manager-0.10.0.tar.bz2
Add-memory-stats-widget-also-to-manager-tree-view.patch
Attempt-empty-path-on-virDomainBlockStats.patch
Base-mem-statistics-on-virDomainMemoryStats-if-avail.patch
virtinst-add-cache-modes.patch
virtinst-allow-ide-hdb.patch
virtinst-clone-disks.patch
OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=143
2014-02-15 16:46:55 +01:00
|
|
|
import threading
|
|
|
|
import time
|
2013-07-03 23:44:06 +02:00
|
|
|
+import sys
|
|
|
|
+import os
|
2017-03-20 21:23:05 +01:00
|
|
|
+import re
|
2013-07-03 23:44:06 +02:00
|
|
|
|
2018-10-30 23:00:52 +01:00
|
|
|
from gi.repository import Gdk
|
2014-10-29 18:03:15 +01:00
|
|
|
from gi.repository import Gtk
|
2019-02-04 19:46:20 +01:00
|
|
|
@@ -1184,6 +1187,63 @@ class vmmCreate(vmmGObjectUI):
|
2018-10-30 23:00:52 +01:00
|
|
|
def _iso_activated_cb(self, mediacombo, entry):
|
|
|
|
self._detectable_media_widget_changed(entry, checkfocus=False)
|
2013-07-03 23:44:06 +02:00
|
|
|
|
|
|
|
+ def _lookup_host_os(self):
|
2017-03-20 21:23:05 +01:00
|
|
|
+ def _lookup_sp(line):
|
|
|
|
+ sp = ""
|
2018-10-30 23:00:52 +01:00
|
|
|
+ m = re.search(' SP[12345] ', line)
|
2017-03-20 21:23:05 +01:00
|
|
|
+ if m:
|
|
|
|
+ sp = m.group(0).strip().lower()
|
|
|
|
+ return sp
|
2018-02-06 21:28:37 +01:00
|
|
|
+ if sys.platform.startswith('linux'):
|
2013-07-03 23:44:06 +02:00
|
|
|
+ if os.path.exists('/etc/issue'):
|
|
|
|
+ f = open('/etc/issue')
|
|
|
|
+ lines = f.readlines()
|
|
|
|
+ f.close()
|
|
|
|
+ for line in lines:
|
2015-05-04 22:15:01 +02:00
|
|
|
+ if "openSUSE " in line:
|
|
|
|
+ parts = line.split(' ')
|
|
|
|
+ if len(parts) > 2 and len(parts[3]) <= 4:
|
|
|
|
+ os_ver = "opensuse" + parts[3]
|
|
|
|
+ return 'linux', os_ver
|
2017-04-27 22:58:57 +02:00
|
|
|
+ return 'linux', 'opensuse42.2'
|
2018-07-17 17:30:34 +02:00
|
|
|
+ if "SUSE Linux Enterprise Server 15" in line:
|
2018-07-17 16:59:44 +02:00
|
|
|
+ return 'linux', ('sle15' + _lookup_sp(line))
|
2014-03-10 14:54:17 +01:00
|
|
|
+ if "SUSE Linux Enterprise Server 12" in line:
|
2017-03-20 21:23:05 +01:00
|
|
|
+ return 'linux', ('sles12' + _lookup_sp(line))
|
2013-07-24 00:30:53 +02:00
|
|
|
+ if "SUSE Linux Enterprise Server 11" in line:
|
2017-03-20 21:23:05 +01:00
|
|
|
+ return 'linux', ('sles11' + _lookup_sp(line))
|
2017-04-27 22:58:57 +02:00
|
|
|
+ if "SUSE Linux Enterprise Desktop 15" in line:
|
2018-10-30 23:00:52 +01:00
|
|
|
+ return 'linux', ('sled15' + _lookup_sp(line))
|
2017-04-27 22:58:57 +02:00
|
|
|
+ if "SUSE Linux Enterprise Desktop 12" in line:
|
|
|
|
+ return 'linux', ('sled12' + _lookup_sp(line))
|
2013-07-24 00:30:53 +02:00
|
|
|
+ if "SUSE Linux Enterprise Desktop 11" in line:
|
2017-03-20 21:23:05 +01:00
|
|
|
+ return 'linux', ('sled11' + _lookup_sp(line))
|
2013-07-03 23:44:06 +02:00
|
|
|
+ return None, None
|
|
|
|
+
|
|
|
|
+ def detect_host_os(self):
|
|
|
|
+ box = self.widget('install-os-type')
|
|
|
|
+ if box.get_active() <= 0:
|
|
|
|
+ os_type, os_variant = self._lookup_host_os()
|
|
|
|
+ if os_type is None:
|
|
|
|
+ return
|
|
|
|
+ model = box.get_model()
|
|
|
|
+ index = 0
|
|
|
|
+ for row in model:
|
|
|
|
+ if row[0] == 'linux':
|
|
|
|
+ box.set_active(index)
|
|
|
|
+ break
|
|
|
|
+ index += 1
|
|
|
|
+ if os_variant is None:
|
|
|
|
+ return
|
|
|
|
+ box = self.widget('install-os-version')
|
|
|
|
+ model = box.get_model()
|
|
|
|
+ index = 0
|
|
|
|
+ for row in model:
|
|
|
|
+ if row[0] == os_variant:
|
|
|
|
+ box.set_active(index)
|
|
|
|
+ break
|
|
|
|
+ index += 1
|
|
|
|
+
|
2018-10-30 23:00:52 +01:00
|
|
|
def _detect_os_toggled_cb(self, src):
|
|
|
|
if not src.is_visible():
|
|
|
|
return
|
2019-02-04 19:46:20 +01:00
|
|
|
@@ -1194,6 +1254,8 @@ class vmmCreate(vmmGObjectUI):
|
2018-10-30 23:00:52 +01:00
|
|
|
if dodetect:
|
2015-11-26 00:27:12 +01:00
|
|
|
self._os_already_detected_for_media = False
|
|
|
|
self._start_detect_os_if_needed()
|
- If connection is Xen, default to PV instead of HVM.
virtman-default-to-xen-pv.patch
- Update to virt-manager 1.0.0
* virt-manager: Snapshot support
* New tool virt-xml: Edit libvirt XML in one shot from the command line. Check out some examples: http://www.redhat.com/archives/libvir-list/2014-January/msg01226.html
* Improved defaults: qcow2, USB2, host CPU model, guest agent channel, …
* Introspect command line options like –disk=? or –network=help
* The virt-image tool will be removed before the next release, speak up if you have a good reason not to remove it.
* virt-manager: Support arm vexpress VM creation
* virt-manager: Add guest memory usage graphs (Thorsten Behrens)
* virt-manager: UI for editing devices (Cédric Bosdonnat)
* Spice USB redirection support (Guannan Ren)
* UI and command line support (Stefan Berger)
* UI and command line support (Giuseppe Scrivano)
* UI and command line support (Chen Hanxiao)
* command line support (Chen Hanxiao)
* virt-manager: support for glusterfs storage pools (Giuseppe Scrivano)
* cli: New options –memory, –features, –clock, –metadata, –pm
* Greatly improve app responsiveness when connecting to remote hosts
* Lots of UI cleanup and improvements
virt-manager-1.0.0.tar.bz2
- Dropped the following patches by taking a newer upstream tarball
virt-manager-0.10.0.tar.bz2
Add-memory-stats-widget-also-to-manager-tree-view.patch
Attempt-empty-path-on-virDomainBlockStats.patch
Base-mem-statistics-on-virDomainMemoryStats-if-avail.patch
virtinst-add-cache-modes.patch
virtinst-allow-ide-hdb.patch
virtinst-clone-disks.patch
OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=143
2014-02-15 16:46:55 +01:00
|
|
|
+ else:
|
2013-07-03 23:44:06 +02:00
|
|
|
+ self.detect_host_os()
|
|
|
|
|
2018-10-30 23:00:52 +01:00
|
|
|
def _browse_oscontainer(self, ignore):
|
|
|
|
self._browse_file("install-oscontainer-fs", is_dir=True)
|