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.
|
2015-11-26 00:27:12 +01:00
|
|
|
Index: virt-manager-1.3.0/virtManager/create.py
|
2013-07-03 23:44:06 +02:00
|
|
|
===================================================================
|
2015-11-26 00:27:12 +01:00
|
|
|
--- virt-manager-1.3.0.orig/virtManager/create.py
|
|
|
|
+++ virt-manager-1.3.0/virtManager/create.py
|
2015-05-04 22:15:01 +02:00
|
|
|
@@ -21,6 +21,8 @@
|
2013-07-03 23:44:06 +02:00
|
|
|
import logging
|
- 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
|
|
|
|
|
2013-11-26 22:23:05 +01:00
|
|
|
from gi.repository import GObject
|
2014-10-29 18:03:15 +01:00
|
|
|
from gi.repository import Gtk
|
2015-11-26 00:27:12 +01:00
|
|
|
@@ -963,7 +965,7 @@ class vmmCreate(vmmGObjectUI):
|
2015-05-04 22:15:01 +02:00
|
|
|
preferred = self.config.preferred_distros
|
|
|
|
variants = virtinst.OSDB.list_os(typename=_type, sortpref=preferred)
|
|
|
|
supportl = virtinst.OSDB.list_os(typename=_type, sortpref=preferred,
|
|
|
|
- only_supported=True)
|
|
|
|
+ only_supported=False)
|
|
|
|
|
|
|
|
for v in variants:
|
|
|
|
supported = v in supportl or v.name == "generic"
|
2015-11-26 00:27:12 +01:00
|
|
|
@@ -1320,6 +1322,53 @@ class vmmCreate(vmmGObjectUI):
|
|
|
|
def _cdrom_changed(self, src):
|
|
|
|
self._detectable_media_widget_changed(src)
|
2013-07-03 23:44:06 +02:00
|
|
|
|
|
|
|
+ def _lookup_host_os(self):
|
|
|
|
+ if sys.platform == 'linux2':
|
|
|
|
+ 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
|
|
|
|
+ return 'linux', 'opensuse13.2'
|
2014-03-10 14:54:17 +01:00
|
|
|
+ if "SUSE Linux Enterprise Server 12" in line:
|
|
|
|
+ return 'linux', 'sles12'
|
|
|
|
+ if "SUSE Linux Enterprise Desktop 12" in line:
|
|
|
|
+ return 'linux', 'sled12'
|
2013-07-24 00:30:53 +02:00
|
|
|
+ if "SUSE Linux Enterprise Server 11" in line:
|
2013-07-03 23:44:06 +02:00
|
|
|
+ return 'linux', 'sles11'
|
2013-07-24 00:30:53 +02:00
|
|
|
+ if "SUSE Linux Enterprise Desktop 11" in line:
|
|
|
|
+ return 'linux', 'sled11'
|
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
|
|
|
|
+
|
2015-11-26 00:27:12 +01:00
|
|
|
def _toggle_detect_os(self, src):
|
2013-07-03 23:44:06 +02:00
|
|
|
dodetect = src.get_active()
|
|
|
|
|
2015-11-26 00:27:12 +01:00
|
|
|
@@ -1332,6 +1381,8 @@ class vmmCreate(vmmGObjectUI):
|
2014-10-29 18:03:15 +01:00
|
|
|
self.widget("install-os-version-entry").set_text("")
|
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()
|
|
|
|
|
|
|
|
def _selected_os_row(self):
|
2015-06-08 14:36:45 +02:00
|
|
|
return uiutil.get_list_selected_row(self.widget("install-os-type"))
|