From f84708fe4977b0c9c312dd15659b2ba85b5c08af Mon Sep 17 00:00:00 2001 From: Charles Arnold Date: Fri, 4 Sep 2015 14:36:51 +0000 Subject: [PATCH] Fix windows media detection OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=253 --- virt-manager.spec | 6 ++-- virtinst-detect-windows-media.patch | 46 ++++++++++++++++++++++++++--- 2 files changed, 45 insertions(+), 7 deletions(-) diff --git a/virt-manager.spec b/virt-manager.spec index 4af379a..0c9aec7 100644 --- a/virt-manager.spec +++ b/virt-manager.spec @@ -1,7 +1,7 @@ # # spec file for package virt-manager # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,7 +15,6 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # - %define with_guestfs 0 %define askpass_package "openssh-askpass" %define qemu_user "qemu" @@ -99,6 +98,7 @@ Requires: virt-manager-common = %{verrel} Requires: vm-install >= 0.5.6 # Typelib's +Recommends: typelib(AppIndicator3) Requires: typelib(GVnc) Requires: typelib(GtkVnc) Requires: typelib(LibvirtGLib) @@ -116,7 +116,7 @@ Requires: python-libguestfs %endif BuildRequires: glib2-devel -%if 0%{?suse_version} >= 1315 +%if 0%{?suse_version} > 1315 BuildRequires: gobject-introspection %endif BuildRequires: intltool diff --git a/virtinst-detect-windows-media.patch b/virtinst-detect-windows-media.patch index 363e2f0..9a9af51 100644 --- a/virtinst-detect-windows-media.patch +++ b/virtinst-detect-windows-media.patch @@ -1,10 +1,10 @@ Enhancement to detect windows media. It is based solely upon finding an autorun.inf file in the root of the installation source. It only assumes windows, not the specific version of windows. -Index: virt-manager-1.2.0/virtinst/urlfetcher.py +Index: virt-manager-1.2.1/virtinst/urlfetcher.py =================================================================== ---- virt-manager-1.2.0.orig/virtinst/urlfetcher.py -+++ virt-manager-1.2.0/virtinst/urlfetcher.py +--- virt-manager-1.2.1.orig/virtinst/urlfetcher.py ++++ virt-manager-1.2.1/virtinst/urlfetcher.py @@ -408,6 +408,24 @@ def _distroFromSUSEContent(fetcher, arch return ob @@ -48,10 +48,48 @@ Index: virt-manager-1.2.0/virtinst/urlfetcher.py +class WindowsDistro(Distro): + + urldistro = "windows" -+ os_variant = "win8.1" ++ os_variant = "win2k12r2" + + def isValidStore(self): + return False # Build list of all *Distro classes def _build_distro_list(): +Index: virt-manager-1.2.1/virtinst/distroinstaller.py +=================================================================== +--- virt-manager-1.2.1.orig/virtinst/distroinstaller.py ++++ virt-manager-1.2.1/virtinst/distroinstaller.py +@@ -499,21 +499,25 @@ class DistroInstaller(Installer): + + def detect_distro(self, guest): + distro = None ++ def _get_distro(guest): ++ try: ++ fetcher = self._get_fetcher(guest, None) ++ fetcher.prepareLocation() ++ ++ store = self._get_store(guest, fetcher) ++ return store.get_osdict_info() ++ finally: ++ fetcher.cleanupLocation() + try: + if _is_url(self.conn, self.location): +- try: +- fetcher = self._get_fetcher(guest, None) +- fetcher.prepareLocation() +- +- store = self._get_store(guest, fetcher) +- distro = store.get_osdict_info() +- finally: +- fetcher.cleanupLocation() ++ distro = _get_distro(guest) + elif self.conn.is_remote(): + logging.debug("Can't detect distro for media on " + "remote connection.") + else: + distro = OSDB.lookup_os_by_media(self.location) ++ if distro is None: ++ distro = _get_distro(guest) + except: + logging.debug("Error attempting to detect distro.", exc_info=True) +