virt-manager/virtman-default-guest-from-host-os.patch
Charles Arnold f71f619bc9 - Update to virt-manager 1.2.0
virt-manager-1.2.0.tar.bz2
  virtinst-default-xen-to-qcow2-format.patch
  * OVMF/AAVMF Support (Laszlo Ersek, Giuseppe Scrivano, Cole Robinson)
  * Improved support for AArch64 qemu/kvm
  * virt-install: Support –disk type=network parameters
  * virt-install: Make –disk just work
  * virt-install: Add –disk sgio= option (Giuseppe Scrivano)
  * addhardware: default to an existing bus when adding a new disk (Giuseppe Scrivano)
  * virt-install: Add –input device option
  * virt-manager: Unify storagebrowser and storage details functionality
  * virt-manager: allow setting a custom connection row name
  * virt-install: Support –hostdev scsi passthrough
  * virt-install: Fill in a bunch of –graphics spice options
  * Disable spice image compression for new local VMs
  * virt-manager: big reworking of the migration dialog
- Dropped tarball and patches
  virt-manager-1.1.0.tar.bz2
  0b391fe9-Gtk-30.patch
  20fe2873-check-for-empty-network-name.patch
  24faf867-ignore-error-403-on-directories.patch
  65f7017e-createnet-fix.patch
  activate-default-console.patch
  ce74cd77-connection-state-tick-updates-lock.patch
  virtinst-ppc64le.patch
  virtinst-supported-disk-formats.patch
  virtinst-support-suse-distros.patch
  virt-manager-1.1.0.tar.bz2
  virtman-default-lxc-uri.patch
  virtman-stable-os-support.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=226
2015-05-04 20:15:01 +00:00

88 lines
3.2 KiB
Diff

Enhancement to default to the host os version when creating a VM
and media detection of the install source is turned off.
Index: virt-manager-1.1.0/virtManager/create.py
===================================================================
--- virt-manager-1.1.0.orig/virtManager/create.py
+++ virt-manager-1.1.0/virtManager/create.py
@@ -21,6 +21,8 @@
import logging
import threading
import time
+import sys
+import os
from gi.repository import GObject
from gi.repository import Gtk
@@ -836,7 +838,7 @@ class vmmCreate(vmmGObjectUI):
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"
@@ -1158,6 +1160,53 @@ 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 " 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'
+ 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'
+ 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()
@@ -1170,6 +1219,8 @@ class vmmCreate(vmmGObjectUI):
self.widget("install-os-version-entry").set_text("")
self.mediaDetected = False
self.detect_media_os()
+ else:
+ self.detect_host_os()
def _selected_os_row(self):
return uiutil.get_list_selection(