0ab97a4010
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
162 lines
5.4 KiB
Diff
162 lines
5.4 KiB
Diff
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
|
|
@@ -287,6 +287,60 @@ def _distroFromTreeinfo(fetcher, arch, v
|
|
|
|
return ob
|
|
|
|
+def _distroFromContent(fetcher, arch, vmtype=None):
|
|
+ # Parse content file for the 'LABEL' field containing the distribution name
|
|
+ # None if no content, GenericDistro if unknown label type.
|
|
+ if not fetcher.hasFile("content"):
|
|
+ return None
|
|
+
|
|
+ distribution = None
|
|
+ distro_version = None
|
|
+ filename = fetcher.acquireFile("content")
|
|
+ cbuf = f = None
|
|
+ try:
|
|
+ f = open(filename, "r")
|
|
+ cbuf = f.read()
|
|
+ except:
|
|
+ if f:
|
|
+ f.close()
|
|
+ os.unlink(filename)
|
|
+ return None
|
|
+ f.close()
|
|
+ os.unlink(filename)
|
|
+
|
|
+ lines = cbuf.splitlines()[1:]
|
|
+ for line in lines:
|
|
+ if line.startswith("LABEL "):
|
|
+ distribution = line.split(' ', 1)
|
|
+ if distro_version:
|
|
+ break
|
|
+ if line.startswith("VERSION "):
|
|
+ distro_version = line.split(' ', 1)
|
|
+ if distribution:
|
|
+ break
|
|
+
|
|
+ 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
|
|
+
|
|
+ ob = dclass(fetcher, arch, vmtype)
|
|
+ if dclass != GenericDistro:
|
|
+ ob.content = distro_version
|
|
+
|
|
+ # Explictly call this, so we populate os_type/variant info
|
|
+ ob.isValidStore()
|
|
+
|
|
+ return ob
|
|
|
|
def getDistroStore(guest, fetcher):
|
|
stores = []
|
|
@@ -303,6 +357,10 @@ def getDistroStore(guest, fetcher):
|
|
if dist:
|
|
return dist
|
|
|
|
+ dist = _distroFromContent(fetcher, arch, _type)
|
|
+ if dist:
|
|
+ return dist
|
|
+
|
|
# 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
|
|
@@ -799,12 +857,11 @@ class SLDistro(RHELDistro):
|
|
|
|
class SuseDistro(Distro):
|
|
name = "SUSE"
|
|
- urldistro = "suse"
|
|
- os_variant = "linux"
|
|
|
|
_boot_iso_paths = ["boot/boot.iso"]
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
+ self.content = None
|
|
Distro.__init__(self, *args, **kwargs)
|
|
if re.match(r'i[4-9]86', self.arch):
|
|
self.arch = 'i386'
|
|
@@ -815,18 +872,32 @@ class SuseDistro(Distro):
|
|
oldkern += "64"
|
|
oldinit += "64"
|
|
|
|
- # Tested with Opensuse >= 10.2, 11, and sles 10
|
|
- self._hvm_kernel_paths = [("boot/%s/loader/linux" % self.arch,
|
|
- "boot/%s/loader/initrd" % self.arch)]
|
|
- # Tested with Opensuse 10.0
|
|
- self._hvm_kernel_paths.append(("boot/loader/%s" % oldkern,
|
|
- "boot/loader/%s" % oldinit))
|
|
-
|
|
- # Matches Opensuse > 10.2 and sles 10
|
|
- self._xen_kernel_paths = [("boot/%s/vmlinuz-xen" % self.arch,
|
|
- "boot/%s/initrd-xen" % self.arch)]
|
|
+ if self.arch == "s390x":
|
|
+ self._hvm_kernel_paths = [ ("boot/%s/vmrdr.ikr" % self.arch,
|
|
+ "boot/%s/initrd" % self.arch) ]
|
|
+ # No Xen on s390x
|
|
+ self._xen_kernel_paths = []
|
|
+ else:
|
|
+ # Tested with Opensuse >= 10.2, 11, and sles 10
|
|
+ self._hvm_kernel_paths = [ ("boot/%s/loader/linux" % self.arch,
|
|
+ "boot/%s/loader/initrd" % self.arch) ]
|
|
+ # Tested with Opensuse 10.0
|
|
+ self._hvm_kernel_paths.append(("boot/loader/%s" % oldkern,
|
|
+ "boot/loader/%s" % oldinit))
|
|
+
|
|
+ # Matches Opensuse > 10.2 and sles 10
|
|
+ self._xen_kernel_paths = [ ("boot/%s/vmlinuz-xen" % self.arch,
|
|
+ "boot/%s/initrd-xen" % self.arch) ]
|
|
|
|
def isValidStore(self):
|
|
+ # self.content is the VERSION line from the contents file
|
|
+ distro_version = self.content[1]
|
|
+ version = distro_version.split('.', 1)[0].strip()
|
|
+ if int(version) >= 10:
|
|
+ self.os_variant += version
|
|
+ else:
|
|
+ self.os_variant += "9"
|
|
+
|
|
if not self.fetcher.hasFile("directory.yast"):
|
|
return False
|
|
|
|
@@ -851,6 +922,27 @@ class SuseDistro(Distro):
|
|
return name
|
|
return self.os_variant
|
|
|
|
+class SLESDistro(SuseDistro):
|
|
+
|
|
+ urldistro = "sles"
|
|
+ os_variant = "sles"
|
|
+
|
|
+class SLEDDistro(SuseDistro):
|
|
+
|
|
+ urldistro = "sled"
|
|
+ os_variant = "sled"
|
|
+
|
|
+# Suse image store is harder - we fetch the kernel RPM and a helper
|
|
+# RPM and then munge bits together to generate a initrd
|
|
+class OpensuseDistro(SuseDistro):
|
|
+
|
|
+ urldistro = "opensuse"
|
|
+ os_variant = "opensuse"
|
|
+
|
|
+class OESDistro(SuseDistro):
|
|
+
|
|
+ urldistro = "oes"
|
|
+ os_variant = "oes"
|
|
|
|
class DebianDistro(Distro):
|
|
# ex. http://ftp.egr.msu.edu/debian/dists/sarge/main/installer-i386/
|