- bnc#868676 - Error changing VM configuration: unsupported

configuration: unknown driver format value 'block' 
  virtinst-xen-drive-type.patch

- bnc#868200 - Unable to complete install: "NoneType' object has no
  attribute '__getitem__" 
  virtinst-detect-suse-distros.patch

- For Xen always have the arch expander expanded.
- For Xen and KVM default to Network install if host was installed
  from the network
- Default to a bridge with an actual inet address if available
  virtinst-modify-gui-defaults.patch
- We are not supporting PV ISO installs with virt-install.
  Drop the following patches
  virtinst-allow-pv-iso-install.patch
  virtman-allow-pv-iso-install.patc

- Upstream bug fixes
  5321d3cd-virtinst-drop-cpu_map-parsing-of-arch-features.patch
  5321d3d0-virtinst-drop-parsing-of-cpu-features.patch
  5321f256-virtinst-use-libvirt-getCPUModelNames.patch
  532255b4-unselect_all-members-before-clear-model.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=152
This commit is contained in:
Charles Arnold 2014-03-19 15:18:34 +00:00 committed by Git OBS Bridge
parent f54391e5a2
commit 898a7107e7
14 changed files with 609 additions and 140 deletions

View File

@ -0,0 +1,102 @@
Subject: virtinst: drop cpu_map parsing of arch features
From: Giuseppe Scrivano gscrivan@redhat.com Wed Mar 12 12:36:17 2014 +0100
Date: Thu Mar 13 16:50:37 2014 +0100:
Git: 143a68959277e01f8fb90f09e2ba9e9d4b0fd9d1
This information is not used anywhere and there is no way to read
it directly from libvirt without parsing the cpu_map.xml file.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
diff --git a/tests/capabilities.py b/tests/capabilities.py
index b712f8d..b718dc1 100644
--- a/tests/capabilities.py
+++ b/tests/capabilities.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2013 Red Hat, Inc.
+# Copyright (C) 2013, 2014 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -225,14 +225,12 @@ class TestCapabilities(unittest.TestCase):
cpu_32 = caps.get_cpu_values("i486")
cpu_random = caps.get_cpu_values("mips")
- def test_cpu_map(cpumap, vendors, features, cpus):
+ def test_cpu_map(cpumap, vendors, cpus):
cpunames = sorted([c.model for c in cpumap.cpus],
key=str.lower)
for v in vendors:
self.assertTrue(v in cpumap.vendors)
- for f in features:
- self.assertTrue(f in cpumap.features)
for c in cpus:
self.assertTrue(c in cpunames)
@@ -244,25 +242,14 @@ class TestCapabilities(unittest.TestCase):
self.assertEquals(cpu_64, cpu_32)
x86_vendors = ["AMD", "Intel"]
- x86_features = [
- '3dnow', '3dnowext', '3dnowprefetch', 'abm', 'acpi', 'apic',
- 'cid', 'clflush', 'cmov', 'cmp_legacy', 'cr8legacy', 'cx16',
- 'cx8', 'dca', 'de', 'ds', 'ds_cpl', 'est', 'extapic', 'fpu',
- 'fxsr', 'fxsr_opt', 'ht', 'hypervisor', 'ia64', 'lahf_lm', 'lm',
- 'mca', 'mce', 'misalignsse', 'mmx', 'mmxext', 'monitor', 'msr',
- 'mtrr', 'nx', 'osvw', 'pae', 'pat', 'pbe', 'pdpe1gb', 'pge', 'pn',
- 'pni', 'popcnt', 'pse', 'pse36', 'rdtscp', 'sep', 'skinit', 'ss',
- 'sse', 'sse2', 'sse4.1', 'sse4.2', 'sse4a', 'ssse3', 'svm',
- 'syscall', 'tm', 'tm2', 'tsc', 'vme', 'vmx', 'wdt', 'x2apic',
- 'xtpr']
x86_cpunames = [
'486', 'athlon', 'Conroe', 'core2duo', 'coreduo', 'n270',
'Nehalem', 'Opteron_G1', 'Opteron_G2', 'Opteron_G3', 'Penryn',
'pentium', 'pentium2', 'pentium3', 'pentiumpro', 'phenom',
'qemu32', 'qemu64']
- test_cpu_map(cpu_64, x86_vendors, x86_features, x86_cpunames)
- test_cpu_map(cpu_random, [], [], [])
+ test_cpu_map(cpu_64, x86_vendors, x86_cpunames)
+ test_cpu_map(cpu_random, [], [])
athlon_features = [
'3dnow', '3dnowext', 'apic', 'cmov', 'cx8', 'de', 'fpu', 'fxsr',
diff --git a/virtinst/capabilities.py b/virtinst/capabilities.py
index b8d3330..2fe2c0a 100644
--- a/virtinst/capabilities.py
+++ b/virtinst/capabilities.py
@@ -1,7 +1,7 @@
#
# Some code for parsing libvirt's capabilities XML
#
-# Copyright 2007, 2012-2013 Red Hat, Inc.
+# Copyright 2007, 2012-2014 Red Hat, Inc.
# Mark McLoughlin <markmc@redhat.com>
#
# This program is free software; you can redistribute it and/or modify
@@ -75,7 +75,6 @@ class CPUValuesArch(object):
self.arch = arch
self.vendors = []
self.cpus = []
- self.features = []
if node:
self._parseXML(node)
@@ -85,8 +84,6 @@ class CPUValuesArch(object):
while child:
if child.name == "vendor":
self.vendors.append(child.prop("name"))
- if child.name == "feature":
- self.features.append(child.prop("name"))
if child.name == "model":
newcpu = CPUValuesModel(child)
if newcpu.parent:
@@ -98,7 +95,6 @@ class CPUValuesArch(object):
child = child.next
self.vendors.sort()
- self.features.sort()
def get_cpu(self, model):
for c in self.cpus:

View File

@ -0,0 +1,111 @@
Subject: virtinst: drop parsing of cpu features
From: Giuseppe Scrivano gscrivan@redhat.com Wed Mar 12 20:59:33 2014 +0100
Date: Thu Mar 13 16:50:40 2014 +0100:
Git: 6c2645f0d2a33bdd189858b07ad771d9242ea4a5
As for the previous patch, this information is not used anywhere and
this information should be retrieved using the libvirt baselineCPU
API.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
diff --git a/tests/capabilities.py b/tests/capabilities.py
index b718dc1..c062e4c 100644
--- a/tests/capabilities.py
+++ b/tests/capabilities.py
@@ -225,37 +225,23 @@ class TestCapabilities(unittest.TestCase):
cpu_32 = caps.get_cpu_values("i486")
cpu_random = caps.get_cpu_values("mips")
- def test_cpu_map(cpumap, vendors, cpus):
+ def test_cpu_map(cpumap, cpus):
cpunames = sorted([c.model for c in cpumap.cpus],
key=str.lower)
- for v in vendors:
- self.assertTrue(v in cpumap.vendors)
for c in cpus:
self.assertTrue(c in cpunames)
- def test_single_cpu(cpumap, model, vendor, features):
- cpu = cpumap.get_cpu(model)
- self.assertEquals(cpu.vendor, vendor)
- self.assertEquals(cpu.features, features)
-
self.assertEquals(cpu_64, cpu_32)
- x86_vendors = ["AMD", "Intel"]
x86_cpunames = [
'486', 'athlon', 'Conroe', 'core2duo', 'coreduo', 'n270',
'Nehalem', 'Opteron_G1', 'Opteron_G2', 'Opteron_G3', 'Penryn',
'pentium', 'pentium2', 'pentium3', 'pentiumpro', 'phenom',
'qemu32', 'qemu64']
- test_cpu_map(cpu_64, x86_vendors, x86_cpunames)
- test_cpu_map(cpu_random, [], [])
-
- athlon_features = [
- '3dnow', '3dnowext', 'apic', 'cmov', 'cx8', 'de', 'fpu', 'fxsr',
- 'mce', 'mmx', 'mmxext', 'msr', 'mtrr', 'pae', 'pat', 'pge', 'pse',
- 'pse36', 'sep', 'sse', 'sse2', 'tsc', 'vme']
- test_single_cpu(cpu_64, "athlon", "AMD", athlon_features)
+ test_cpu_map(cpu_64, x86_cpunames)
+ test_cpu_map(cpu_random, [])
if __name__ == "__main__":
unittest.main()
diff --git a/virtinst/capabilities.py b/virtinst/capabilities.py
index 2fe2c0a..2ab39cd 100644
--- a/virtinst/capabilities.py
+++ b/virtinst/capabilities.py
@@ -37,34 +37,10 @@ def xpathString(node, path, default=None):
class CPUValuesModel(object):
"""
- Single <model> definition from cpu_map
+ Single CPU model
"""
- def __init__(self, node):
- self.model = node.prop("name")
- self.features = []
- self.parent = None
- self.vendor = None
-
- self._parseXML(node)
-
- def _parseXML(self, node):
- child = node.children
- while child:
- if child.name == "model":
- self.parent = child.prop("name")
- if child.name == "vendor":
- self.vendor = child.prop("name")
- if child.name == "feature":
- self.features.append(child.prop("name"))
-
- child = child.next
-
- self.features.sort()
-
- def inheritParent(self, parentcpu):
- self.vendor = parentcpu.vendor or self.vendor
- self.features += parentcpu.features
- self.features.sort()
+ def __init__(self, model):
+ self.model = model
class CPUValuesArch(object):
@@ -85,11 +61,7 @@ class CPUValuesArch(object):
if child.name == "vendor":
self.vendors.append(child.prop("name"))
if child.name == "model":
- newcpu = CPUValuesModel(child)
- if newcpu.parent:
- for chkcpu in self.cpus:
- if chkcpu.model == newcpu.parent:
- newcpu.inheritParent(chkcpu)
+ newcpu = CPUValuesModel(child.prop("name"))
self.cpus.append(newcpu)
child = child.next

View File

@ -0,0 +1,176 @@
Subject: virtinst: use libvirt getCPUModelNames when available
From: Giuseppe Scrivano gscrivan@redhat.com Thu Mar 13 12:52:51 2014 +0100
Date: Thu Mar 13 19:00:54 2014 +0100:
Git: 81696a514441f2320ea10299e1852795f8cb1682
Read the list of CPU models trough getCPUModelNames instead of
accessing directly the file cpu_map.xml.
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1060316
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Index: virt-manager-1.0.0/tests/capabilities.py
===================================================================
--- virt-manager-1.0.0.orig/tests/capabilities.py
+++ virt-manager-1.0.0/tests/capabilities.py
@@ -18,6 +18,7 @@
import os
import unittest
+from tests import utils
from virtinst import CapabilitiesParser as capabilities
@@ -221,13 +222,12 @@ class TestCapabilities(unittest.TestCase
def testCPUMap(self):
caps = self._buildCaps("libvirt-0.7.6-qemu-caps.xml")
- cpu_64 = caps.get_cpu_values("x86_64")
- cpu_32 = caps.get_cpu_values("i486")
- cpu_random = caps.get_cpu_values("mips")
+ cpu_64 = caps.get_cpu_values(None, "x86_64")
+ cpu_32 = caps.get_cpu_values(None, "i486")
+ cpu_random = caps.get_cpu_values(None, "mips")
def test_cpu_map(cpumap, cpus):
- cpunames = sorted([c.model for c in cpumap.cpus],
- key=str.lower)
+ cpunames = sorted([c.model for c in cpumap], key=str.lower)
for c in cpus:
self.assertTrue(c in cpunames)
@@ -243,5 +243,10 @@ class TestCapabilities(unittest.TestCase
test_cpu_map(cpu_64, x86_cpunames)
test_cpu_map(cpu_random, [])
+ conn = utils.open_testdriver()
+ cpu_64 = caps.get_cpu_values(conn, "x86_64")
+ self.assertTrue(len(cpu_64) > 0)
+
+
if __name__ == "__main__":
unittest.main()
Index: virt-manager-1.0.0/virtManager/details.py
===================================================================
--- virt-manager-1.0.0.orig/virtManager/details.py
+++ virt-manager-1.0.0/virtManager/details.py
@@ -969,7 +969,8 @@ class vmmDetails(vmmGObjectUI):
no_default = not self.is_customize_dialog
try:
- cpu_names = caps.get_cpu_values(self.vm.get_arch()).cpus
+ cpu_names = caps.get_cpu_values(self.conn.get_backend(),
+ self.vm.get_arch())
except:
cpu_names = []
logging.exception("Error populating CPU model list")
Index: virt-manager-1.0.0/virtinst/capabilities.py
===================================================================
--- virt-manager-1.0.0.orig/virtinst/capabilities.py
+++ virt-manager-1.0.0/virtinst/capabilities.py
@@ -77,13 +77,33 @@ class CPUValuesArch(object):
class CPUValues(object):
"""
- Lists valid values for domain <cpu> parameters, parsed from libvirt's
- local cpu_map.xml
+ Lists valid values for cpu models obtained trough libvirt's getCPUModelNames
"""
- def __init__(self, cpu_filename=None):
+ def __init__(self):
+ self._cpus = None
+
+ def get_cpus(self, arch, conn):
+ if self._cpus is not None:
+ return self._cpus
+
+ if (conn and
+ conn.check_support(conn.SUPPORT_CONN_CPU_MODEL_NAMES)):
+ self._cpus = [CPUValuesModel(i) for i in
+ conn.libvirtconn.getCPUModelNames(arch, 0)]
+ return self._cpus
+
+ return []
+
+
+class CPUMapFileValues(CPUValues):
+ """
+ Fallback method to lists cpu models, parsed directly from libvirt's local
+ cpu_map.xml
+ """
+ def __init__(self):
+ CPUValues.__init__(self)
self.archmap = {}
- if not cpu_filename:
- cpu_filename = "/usr/share/libvirt/cpu_map.xml"
+ cpu_filename = "/usr/share/libvirt/cpu_map.xml"
xml = file(cpu_filename).read()
util.parse_node_helper(xml, "cpus",
@@ -99,7 +119,8 @@ class CPUValues(object):
child = child.next
- def get_arch(self, arch):
+ def get_cpus(self, arch, conn):
+ ignore = conn
if not arch:
return None
if re.match(r'i[4-9]86', arch):
@@ -112,7 +133,7 @@ class CPUValues(object):
cpumap = CPUValuesArch(arch)
self.archmap[arch] = cpumap
- return cpumap
+ return cpumap.cpus
class Features(object):
@@ -613,12 +634,19 @@ class Capabilities(object):
self.guests.append(Guest(child))
child = child.next
- def get_cpu_values(self, arch):
- if not self._cpu_values:
- self._cpu_values = CPUValues()
-
- return self._cpu_values.get_arch(arch)
+ def get_cpu_values(self, conn, arch):
+ if self._cpu_values:
+ return self._cpu_values.get_cpus(arch, conn)
+
+ # Iterate over the available methods until a set of CPU models is found
+ for mode in (CPUValues, CPUMapFileValues):
+ cpu_values = mode()
+ cpus = cpu_values.get_cpus(arch, conn)
+ if cpus and len(cpus) > 0:
+ self._cpu_values = cpu_values
+ return cpus
+ return []
def guest_lookup(self, os_type=None, arch=None, typ=None,
accelerated=False, machine=None):
Index: virt-manager-1.0.0/virtinst/support.py
===================================================================
--- virt-manager-1.0.0.orig/virtinst/support.py
+++ virt-manager-1.0.0/virtinst/support.py
@@ -1,7 +1,7 @@
#
# Helper functions for determining if libvirt supports certain features
#
-# Copyright 2009, 2013 Red Hat, Inc.
+# Copyright 2009, 2013, 2014 Red Hat, Inc.
# Cole Robinson <crobinso@redhat.com>
#
# This program is free software; you can redistribute it and/or modify
@@ -288,6 +288,8 @@ SUPPORT_CONN_USBREDIR = _make(
version="0.9.5", hv_version={"qemu": "1.3.0", "test": 0})
SUPPORT_CONN_DEVICE_BOOTORDER = _make(
version="0.8.8", hv_version={"qemu": 0, "test": 0})
+SUPPORT_CONN_CPU_MODEL_NAMES = _make(function="virConnect.getCPUModelNames",
+ run_args=("x86_64", 0))
# Domain checks

View File

@ -0,0 +1,63 @@
Subject: host: unselect_all members before clear model
From: Chen Hanxiao chenhanxiao@cn.fujitsu.com Fri Mar 14 09:04:34 2014 +0800
Date: Fri Mar 14 09:04:52 2014 +0800:
Git: 1d3980015a942e5aceee0233c9b90d2bbe32ffdd
Interface_selected is being triggered by model.clear() in
populate_interfaces. It usually calls interface_selected
on every interface after the current selected row.
So the gtk code is probably removing the first
row over and over, and when it removes the
current selection (the interface we are deleting),
it selects the next row in line.
It will raise a KeyError.
This patch will fix this issue.
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
diff --git a/virtManager/host.py b/virtManager/host.py
index c8d7ee0..a1aa2fd 100644
--- a/virtManager/host.py
+++ b/virtManager/host.py
@@ -679,6 +679,7 @@ class vmmHost(vmmGObjectUI):
curnet = self.current_network()
net_list = self.widget("net-list")
+ net_list.get_selection().unselect_all()
model.clear()
for uuid in self.conn.list_net_uuids():
net = self.conn.get_net(uuid)
@@ -1220,6 +1221,7 @@ class vmmHost(vmmGObjectUI):
curiface = self.current_interface()
iface_list = self.widget("interface-list")
+ iface_list.get_selection().unselect_all()
model.clear()
for name in self.conn.list_interface_names():
iface = self.conn.get_interface(name)
@@ -1234,6 +1236,7 @@ class vmmHost(vmmGObjectUI):
interface = self.current_interface()
child_list = self.widget("interface-child-list")
model = child_list.get_model()
+ child_list.get_selection().unselect_all()
model.clear()
if not interface:
@@ -1278,6 +1281,7 @@ def populate_storage_pools(pool_list, conn, curpool):
model = pool_list.get_model()
# Prevent events while the model is modified
pool_list.set_model(None)
+ pool_list.get_selection().unselect_all()
model.clear()
for uuid in conn.list_pool_uuids():
per = get_pool_size_percent(conn, uuid)
@@ -1297,6 +1301,7 @@ def populate_storage_pools(pool_list, conn, curpool):
def populate_storage_volumes(list_widget, pool, sensitive_cb):
vols = pool and pool.get_volumes() or {}
model = list_widget.get_model()
+ list_widget.get_selection().unselect_all()
model.clear()
for key in vols.keys():

View File

@ -1,3 +1,39 @@
-------------------------------------------------------------------
Tue Mar 18 14:15:06 MDT 2014 - carnold@suse.com
- bnc#868676 - Error changing VM configuration: unsupported
configuration: unknown driver format value 'block'
virtinst-xen-drive-type.patch
-------------------------------------------------------------------
Tue Mar 18 11:38:42 MDT 2014 - carnold@suse.com
- bnc#868200 - Unable to complete install: "NoneType' object has no
attribute '__getitem__"
virtinst-detect-suse-distros.patch
-------------------------------------------------------------------
Fri Mar 14 11:33:09 MDT 2014 - carnold@suse.com
- For Xen always have the arch expander expanded.
- For Xen and KVM default to Network install if host was installed
from the network
- Default to a bridge with an actual inet address if available
virtinst-modify-gui-defaults.patch
- We are not supporting PV ISO installs with virt-install.
Drop the following patches
virtinst-allow-pv-iso-install.patch
virtman-allow-pv-iso-install.patc
-------------------------------------------------------------------
Fri Mar 14 11:33:09 MDT 2014 - carnold@suse.com
- Upstream bug fixes
5321d3cd-virtinst-drop-cpu_map-parsing-of-arch-features.patch
5321d3d0-virtinst-drop-parsing-of-cpu-features.patch
5321f256-virtinst-use-libvirt-getCPUModelNames.patch
532255b4-unselect_all-members-before-clear-model.patch
-------------------------------------------------------------------
Tue Mar 13 08:19:52 MDT 2014 - carnold@suse.com

View File

@ -64,6 +64,10 @@ Patch25: 531dbfa7-handle-errors-when-deregistering-events-on-close.patch
Patch26: 531dd0ca-lxc-define-private-network.patch
Patch27: 53207f40-invalidate-cached-caps.patch
Patch28: 5320c976-fix-adding-empty-cdrom-floppy-drive.patch
Patch29: 5321d3cd-virtinst-drop-cpu_map-parsing-of-arch-features.patch
Patch30: 5321d3d0-virtinst-drop-parsing-of-cpu-features.patch
Patch31: 5321f256-virtinst-use-libvirt-getCPUModelNames.patch
Patch32: 532255b4-unselect_all-members-before-clear-model.patch
Patch50: virtman-desktop.patch
Patch51: virtman-cdrom.patch
Patch52: virtman-kvm.patch
@ -77,20 +81,19 @@ Patch65: virtman-slow-mouse.patch
Patch66: virtman-reverse-serialcon.patch
Patch67: virtman-default-guest-from-host-os.patch
Patch68: virtman-default-to-xen-pv.patch
Patch69: virtman-allow-pv-iso-install.patch
Patch70: virtman-autoyast-support.patch
Patch71: virtman-vminstall.patch
Patch72: virtman-show-suse-install-repos.patch
Patch73: virtman-packages.patch
Patch74: virtman-load-stored-uris.patch
Patch75: virtman-libvirtd-not-running.patch
Patch69: virtman-autoyast-support.patch
Patch70: virtman-vminstall.patch
Patch71: virtman-show-suse-install-repos.patch
Patch72: virtman-packages.patch
Patch73: virtman-load-stored-uris.patch
Patch74: virtman-libvirtd-not-running.patch
Patch150: virtinst-cdrom.patch
Patch151: virtinst-storage-ocfs2.patch
Patch152: virtinst-qed.patch
Patch153: virtinst-support-suse-distros.patch
Patch154: virtinst-detect-suse-distros.patch
Patch155: virtinst-xen-drive-type.patch
Patch156: virtinst-allow-pv-iso-install.patch
Patch156: virtinst-modify-gui-defaults.patch
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -206,6 +209,10 @@ machine).
%patch26 -p1
%patch27 -p1
%patch28 -p1
%patch29 -p1
%patch30 -p1
%patch31 -p1
%patch32 -p1
%patch50 -p1
%patch51 -p1
%patch52 -p1
@ -220,20 +227,18 @@ machine).
%patch67 -p1
%patch68 -p1
%patch69 -p1
#%patch69 -p1 pv iso install
%patch70 -p1
%patch71 -p1
%patch72 -p1
%patch73 -p1
%patch74 -p1
%patch75 -p1
#%patch150 -p1 use 'c' for cdrom
%patch151 -p1
%patch152 -p1
%patch153 -p1
%patch154 -p1
%patch155 -p1
#%patch156 -p1 pv iso install
%patch156 -p1
%build
%if %{qemu_user}

View File

@ -1,66 +0,0 @@
Index: virt-manager-1.0.0/virtinst/distroinstaller.py
===================================================================
--- virt-manager-1.0.0.orig/virtinst/distroinstaller.py
+++ virt-manager-1.0.0/virtinst/distroinstaller.py
@@ -421,8 +421,14 @@ class DistroInstaller(Installer):
dev = None
if mediatype == MEDIA_CDROM_PATH:
- dev = self._prepare_local()
- else:
+ if guest.os.is_xenpv() and guest._lookup_osdict_key('pv_cdrom_install', False):
+ fetcher = urlfetcher.fetcherForURI(self.location,
+ scratchdir, meter)
+ dev = self._prepare_kernel_url(guest, fetcher)
+ else:
+ dev = self._prepare_local()
+
+ if dev is None:
fetcher = urlfetcher.fetcherForURI(self.location,
scratchdir, meter)
try:
Index: virt-manager-1.0.0/virtinst/osdict.py
===================================================================
--- virt-manager-1.0.0.orig/virtinst/osdict.py
+++ virt-manager-1.0.0/virtinst/osdict.py
@@ -143,6 +143,8 @@ class _OSVariant(object):
@xen_disable_acpi: If True, disable acpi/apic for this OS if on old xen.
This corresponds with the SUPPORT_CONN_CAN_DEFAULT_ACPI check
@qemu_ga: If True, this distro has qemu_ga available by default
+ @pv_cdrom_install: If True, this distro can be installed from an ISO or
+ cdrom as a para-virtualized guest.
The rest of the parameters are about setting device/guest defaults
based on the OS. They should be self explanatory. See guest.py for
@@ -158,7 +160,7 @@ class _OSVariant(object):
videomodel=_SENTINEL, virtionet=_SENTINEL,
virtiodisk=_SENTINEL, virtiommio=_SENTINEL,
virtioconsole=_SENTINEL, xen_disable_acpi=_SENTINEL,
- qemu_ga=_SENTINEL):
+ qemu_ga=_SENTINEL, pv_cdrom_install=_SENTINEL):
if is_type:
if parent != _SENTINEL:
raise RuntimeError("OS types must not specify parent")
@@ -218,6 +220,7 @@ class _OSVariant(object):
self.virtiommio = _get_default("virtiommio", virtiommio)
self.virtioconsole = _get_default("virtioconsole", virtioconsole)
self.qemu_ga = _get_default("qemu_ga", qemu_ga)
+ self.pv_cdrom_install = _get_default("pv_cdrom_install", pv_cdrom_install)
def _add_type(*args, **kwargs):
@@ -259,12 +262,12 @@ _add_var("fedora18", "Fedora 18", suppor
_add_var("fedora19", "Fedora 19", virtiommio=True, parent="fedora18")
_add_var("fedora20", "Fedora 20 (or later)", parent="fedora19")
-_add_var("opensuse11", "openSUSE 11", urldistro="opensuse", supported=True, virtiodisk=True, virtionet=True, parent="linux")
+_add_var("opensuse11", "openSUSE 11", urldistro="opensuse", supported=True, pv_cdrom_install=True, virtiodisk=True, virtionet=True, parent="linux")
_add_var("opensuse12", "openSUSE 12", parent="opensuse11")
_add_var("opensuse13", "openSUSE 13 (or later)", parent="opensuse12")
_add_var("sles", "Suse Linux Enterprise Server", urldistro="suse", supported=True, parent="linux")
-_add_var("sles10", "Suse Linux Enterprise Server 10", supported=True, virtiodisk=True, virtionet=True, parent="sles")
+_add_var("sles10", "Suse Linux Enterprise Server 10", supported=True, pv_cdrom_install=True, virtiodisk=True, virtionet=True, parent="sles")
_add_var("sles11", "Suse Linux Enterprise Server 11", supported=True, virtiodisk=True, virtionet=True, parent="sles10")
_add_var("sles12", "Suse Linux Enterprise Server 12 (or later)", supported=True, virtiodisk=True, virtionet=True, parent="sles11")

View File

@ -2,7 +2,7 @@ Index: virt-manager-1.0.0/virtinst/urlfetcher.py
===================================================================
--- virt-manager-1.0.0.orig/virtinst/urlfetcher.py
+++ virt-manager-1.0.0/virtinst/urlfetcher.py
@@ -296,6 +296,60 @@ def _distroFromTreeinfo(fetcher, arch, v
@@ -296,6 +296,68 @@ def _distroFromTreeinfo(fetcher, arch, v
return ob
@ -37,20 +37,28 @@ Index: virt-manager-1.0.0/virtinst/urlfetcher.py
+ distro_version = line.split(' ', 1)
+ if distribution:
+ break
+ if line.startswith("SUMMARY "):
+ distro_summary = line.split(' ', 1)
+
+ if re.match(".*SUSE Linux Enterprise Server*", distribution[1]) or \
+ re.match(".*SUSE SLES*", distribution[1]):
+ dclass = SLESDistro
+ if distro_version is None:
+ distro_version = ['VERSION', distribution[1].strip().rsplit(' ')[4]]
+ elif re.match(".*SUSE Linux Enterprise Desktop*", distribution[1]):
+ dclass = SLEDDistro
+ if distro_version is None:
+ distro_version = ['VERSION', distribution[1].strip().rsplit(' ')[4]]
+ elif re.match(".*openSUSE.*", distribution[1]):
+ dclass = OpensuseDistro
+ else:
+ dclass = GenericDistro
+ if not distribution and distro_summary:
+ distribution = distro_summary
+
+ if distribution:
+ if re.match(".*SUSE Linux Enterprise Server*", distribution[1]) or \
+ re.match(".*SUSE SLES*", distribution[1]):
+ dclass = SLESDistro
+ if distro_version is None:
+ distro_version = ['VERSION', distribution[1].strip().rsplit(' ')[4]]
+ elif re.match(".*SUSE Linux Enterprise Desktop*", distribution[1]):
+ dclass = SLEDDistro
+ if distro_version is None:
+ distro_version = ['VERSION', distribution[1].strip().rsplit(' ')[4]]
+ elif re.match(".*openSUSE.*", distribution[1]):
+ dclass = OpensuseDistro
+ if distro_version is None:
+ distro_version = ['VERSION', '13.1']
+ else:
+ dclass = GenericDistro
+
+ ob = dclass(fetcher, arch, vmtype)
+ if dclass != GenericDistro:
@ -63,7 +71,7 @@ Index: virt-manager-1.0.0/virtinst/urlfetcher.py
def getDistroStore(guest, fetcher):
stores = []
@@ -312,6 +366,10 @@ def getDistroStore(guest, fetcher):
@@ -312,6 +374,10 @@ def getDistroStore(guest, fetcher):
if dist:
return dist
@ -74,7 +82,7 @@ Index: virt-manager-1.0.0/virtinst/urlfetcher.py
# FIXME: This 'distro ==' doesn't cut it. 'distro' is from our os
# dictionary, so would look like 'fedora9' or 'rhel5', so this needs
# to be a bit more intelligent
@@ -808,12 +866,11 @@ class SLDistro(RHELDistro):
@@ -808,12 +874,11 @@ class SLDistro(RHELDistro):
class SuseDistro(Distro):
name = "SUSE"
@ -88,7 +96,7 @@ Index: virt-manager-1.0.0/virtinst/urlfetcher.py
Distro.__init__(self, *args, **kwargs)
if re.match(r'i[4-9]86', self.arch):
self.arch = 'i386'
@@ -824,18 +881,32 @@ class SuseDistro(Distro):
@@ -824,18 +889,32 @@ class SuseDistro(Distro):
oldkern += "64"
oldinit += "64"
@ -131,7 +139,7 @@ Index: virt-manager-1.0.0/virtinst/urlfetcher.py
if not self.fetcher.hasFile("directory.yast"):
return False
@@ -860,6 +931,27 @@ class SuseDistro(Distro):
@@ -860,6 +939,27 @@ class SuseDistro(Distro):
return name
return self.os_variant

View File

@ -0,0 +1,71 @@
Index: virt-manager-1.0.0/virtManager/create.py
===================================================================
--- virt-manager-1.0.0.orig/virtManager/create.py
+++ virt-manager-1.0.0/virtManager/create.py
@@ -337,7 +337,18 @@ class vmmCreate(vmmGObjectUI):
self.widget("method-local").set_active(True)
self.widget("create-conn").set_active(-1)
activeconn = self.populate_conn_list(urihint)
- self.widget("arch-expander").set_expanded(False)
+ if activeconn.is_xen():
+ 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 \
+ host_instsrc.startswith('ftp:') or host_instsrc.startswith('http:') or \
+ host_instsrc.startswith('smb:') or host_instsrc.startswith('nfs:'):
+ self.widget("method-local").set_active(False)
+ self.widget("method-tree").set_active(True)
try:
self.set_conn(activeconn, force_validate=True)
Index: virt-manager-1.0.0/virtManager/netlist.py
===================================================================
--- virt-manager-1.0.0.orig/virtManager/netlist.py
+++ virt-manager-1.0.0/virtManager/netlist.py
@@ -174,10 +174,20 @@ class vmmNetworkList(vmmGObjectUI):
if nic.target_dev and nic.target_dev not in vnet_taps:
vnet_taps.append(nic.target_dev)
+ 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
+
bridge_dict = {}
iface_dict = {}
hasShared = False
brIdxLabel = None
+ brIdxLabel_with_inet = None
skip_ifaces = ["lo"]
for name in self.conn.list_net_device_paths():
@@ -218,6 +228,11 @@ class vmmNetworkList(vmmGObjectUI):
if hasShared and not brIdxLabel:
brIdxLabel = label
+ # Default to a bridge that has an actual inet addr
+ if brIdxLabel_with_inet is None:
+ if check_for_inet(bridge_name):
+ brIdxLabel_with_inet = label
+
row = self._build_source_row(
nettype, bridge_name, label, sensitive, True,
key=br.get_name())
@@ -227,6 +242,9 @@ class vmmNetworkList(vmmGObjectUI):
else:
iface_dict[label] = row
+ if brIdxLabel and brIdxLabel_with_inet is not None:
+ brIdxLabel = brIdxLabel_with_inet
+
return bridge_dict, iface_dict, brIdxLabel
def _populate_network_list(self):

View File

@ -21,7 +21,7 @@ Index: virt-manager-1.0.0/virtinst/devicedisk.py
http://lists.gnu.org/archive/html/qemu-devel/2008-04/msg00675.html
"""
if self.driver_name != self.DRIVER_QEMU:
+ if self.type != 'file':
+ if self.driver_name and self.type != 'file':
+ return self.type
return None

View File

@ -1,37 +0,0 @@
Index: virt-manager-1.0.0/virtManager/create.py
===================================================================
--- virt-manager-1.0.0.orig/virtManager/create.py
+++ virt-manager-1.0.0/virtManager/create.py
@@ -419,8 +419,8 @@ class vmmCreate(vmmGObjectUI):
method_tree.set_sensitive((is_local or can_remote_url) and
installable_arch)
- method_local.set_sensitive(not is_pv and can_storage and
- installable_arch)
+ # Allow PV ISO/CDROM install for SLES
+ method_local.set_sensitive(can_storage and installable_arch)
method_pxe.set_sensitive(not is_pv and installable_arch)
method_import.set_sensitive(can_storage)
virt_methods = [method_local, method_tree, method_pxe, method_import]
@@ -637,6 +637,21 @@ class vmmCreate(vmmGObjectUI):
self.capsdomain.hypervisor_type == domtype):
default = len(model)
+ if gtype == "xen":
+ pv_cdrom = False
+ if self.guest and self.guest._lookup_osdict_key('pv_cdrom_install', False):
+ pv_cdrom = True
+
+ instmethod = self.get_config_install_page()
+ if (instmethod == INSTALL_PAGE_PXE or
+ instmethod == INSTALL_PAGE_ISO and
+ pv_cdrom == False):
+ sensitive = False
+ tooltip = _("Only URL or import installs are supported "
+ "for paravirt.")
+ else:
+ default = 0
+
model.append([label, gtype])
show = bool(guests)

View File

@ -2,7 +2,7 @@ Index: virt-manager-1.0.0/virtManager/details.py
===================================================================
--- virt-manager-1.0.0.orig/virtManager/details.py
+++ virt-manager-1.0.0/virtManager/details.py
@@ -2018,12 +2018,10 @@ class vmmDetails(vmmGObjectUI):
@@ -2019,12 +2019,10 @@ class vmmDetails(vmmGObjectUI):
return self._change_config_helper(df, da, hf, ha)
@ -19,7 +19,7 @@ Index: virt-manager-1.0.0/virtManager/details.py
auto = self.widget("config-autostart")
try:
self.vm.set_autostart(auto.get_active())
@@ -2032,6 +2030,11 @@ class vmmDetails(vmmGObjectUI):
@@ -2033,6 +2031,11 @@ class vmmDetails(vmmGObjectUI):
(_("Error changing autostart value: %s") % str(e)))
return False
@ -31,7 +31,7 @@ Index: virt-manager-1.0.0/virtManager/details.py
if self.edited(EDIT_BOOTORDER):
bootdevs = self.get_config_boot_order()
add_define(self.vm.set_boot_order, bootdevs)
@@ -2386,6 +2389,8 @@ class vmmDetails(vmmGObjectUI):
@@ -2387,6 +2390,8 @@ class vmmDetails(vmmGObjectUI):
buttons=Gtk.ButtonsType.OK,
dialog_type=dtype)

View File

@ -2,7 +2,7 @@ Index: virt-manager-1.0.0/virtManager/create.py
===================================================================
--- virt-manager-1.0.0.orig/virtManager/create.py
+++ virt-manager-1.0.0/virtManager/create.py
@@ -1232,11 +1232,34 @@ class vmmCreate(vmmGObjectUI):
@@ -1217,11 +1217,34 @@ class vmmCreate(vmmGObjectUI):
variant = self.widget("install-os-version")
variant.set_active(0)
@ -37,7 +37,7 @@ Index: virt-manager-1.0.0/virtManager/create.py
# Get previous
type_row = self._selected_os_row()
if not type_row:
@@ -1591,7 +1614,10 @@ class vmmCreate(vmmGObjectUI):
@@ -1576,7 +1599,10 @@ class vmmCreate(vmmGObjectUI):
if extra:
extraargs += extra
if ks:
@ -49,7 +49,7 @@ Index: virt-manager-1.0.0/virtManager/create.py
if extraargs:
self.guest.installer.extraargs = extraargs
@@ -1984,6 +2010,7 @@ class vmmCreate(vmmGObjectUI):
@@ -1969,6 +1995,7 @@ class vmmCreate(vmmGObjectUI):
dl = self.set_os_val(self.widget("install-os-type"), distro_type)
vl = self.set_os_val(self.widget("install-os-version"), distro_var)
self.set_distro_labels(dl, vl)

View File

@ -25,7 +25,7 @@ Index: virt-manager-1.0.0/virtManager/details.py
===================================================================
--- virt-manager-1.0.0.orig/virtManager/details.py
+++ virt-manager-1.0.0/virtManager/details.py
@@ -2279,6 +2279,17 @@ class vmmDetails(vmmGObjectUI):
@@ -2280,6 +2280,17 @@ class vmmDetails(vmmGObjectUI):
text1=(_("Are you sure you want to remove this device?"))):
return