f42ba1daac
533d708d-fix-showing-vcpus-values.patch 533d7602-fix-changing-graphics-type.patch 533d7be7-clarify-iscsi-IQN-fields.patch - Dropped virtman-init-vm-processor-topology.patch in favor of upstream 533d708d-fix-showing-vcpus-values.patch - bnc#869024 - Build0198: Only option to create a virtual machine is "import existing disk image" virtman-add-s390x-arch-support.patch - bnc#871642 - virt-manager wants to install libvirt-daemon-xen even when it is installed xen.spec - Xen: Virt-install won't reboot VM after install of SLE HVM guest because of libxl exception. virtinst-keep-cdrom-media-attached.patch - Fate#315125: add NOCOW flag virtinst-vol-default-nocow.patch - Upstream bug fixes 53375bad-raise-value-error-when-no-ipaddr-set.patch 53388de2-show-port-number-for-active-autoport-VM.patch 53397ae0-check-ip-address-format.patch 53399b45-hook-into-domain-balloon-event.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=162
79 lines
2.7 KiB
Diff
79 lines
2.7 KiB
Diff
Index: virt-manager-1.0.1/virtManager/create.py
|
|
===================================================================
|
|
--- virt-manager-1.0.1.orig/virtManager/create.py
|
|
+++ virt-manager-1.0.1/virtManager/create.py
|
|
@@ -21,6 +21,8 @@
|
|
import logging
|
|
import threading
|
|
import time
|
|
+import sys
|
|
+import os
|
|
|
|
# pylint: disable=E0611
|
|
from gi.repository import GObject
|
|
@@ -1142,6 +1144,55 @@ class vmmCreate(vmmGObjectUI):
|
|
return
|
|
self.start_detection(forward=forward)
|
|
|
|
+ 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:
|
|
+ if "openSUSE 13" in line:
|
|
+ return 'linux', 'opensuse13'
|
|
+ if "openSUSE 12" in line:
|
|
+ return 'linux', 'opensuse12'
|
|
+ if "SUSE Linux Enterprise Server 12" in line:
|
|
+ return 'linux', 'sles12'
|
|
+ if "SUSE Linux Enterprise Desktop 12" in line:
|
|
+ return 'linux', 'sled12'
|
|
+ if "SUSE Linux Enterprise Server 11" in line:
|
|
+ return 'linux', 'sles11'
|
|
+ if "SUSE Linux Enterprise Desktop 11" in line:
|
|
+ return 'linux', 'sled11'
|
|
+ if "Fedora" in line:
|
|
+ return 'linux', 'fedora17'
|
|
+ if "Red Hat Enterprise Linux Server" in line:
|
|
+ return 'linux', 'rhel6'
|
|
+ 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
|
|
+
|
|
def toggle_detect_os(self, src):
|
|
dodetect = src.get_active()
|
|
|
|
@@ -1153,6 +1204,8 @@ class vmmCreate(vmmGObjectUI):
|
|
if dodetect:
|
|
self.mediaDetected = False
|
|
self.detect_media_os()
|
|
+ else:
|
|
+ self.detect_host_os()
|
|
|
|
def _selected_os_row(self):
|
|
return uiutil.get_list_selection(
|