- Drop virtinst-detect-windows-media.patch as this is not needed
now that we use libosinfo OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=255
This commit is contained in:
parent
3f42ed6e48
commit
88ae24de3a
@ -5,6 +5,8 @@ Thu Sep 3 10:43:15 MDT 2015 - carnold@suse.com
|
||||
virt-manager.spec
|
||||
- Add upstream bug fix
|
||||
5e68b0fc-dont-try-to-set-vmport-on-non-x86.patch
|
||||
- Drop virtinst-detect-windows-media.patch as this is not needed
|
||||
now that we use libosinfo
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Aug 31 16:41:28 MDT 2015 - carnold@suse.com
|
||||
|
@ -72,10 +72,9 @@ Patch121: virtinst-default-xen-to-qcow2-format.patch
|
||||
Patch123: virtinst-detect-oes-distros.patch
|
||||
Patch124: virtinst-modify-gui-defaults.patch
|
||||
Patch125: virtinst-vol-default-nocow.patch
|
||||
Patch126: virtinst-detect-windows-media.patch
|
||||
Patch127: virtinst-set-cache-mode-unsafe-for-install.patch
|
||||
Patch128: virtinst-add-default-rng-device.patch
|
||||
Patch129: virtinst-set-qemu-emulator.patch
|
||||
Patch126: virtinst-set-cache-mode-unsafe-for-install.patch
|
||||
Patch127: virtinst-add-default-rng-device.patch
|
||||
Patch128: virtinst-set-qemu-emulator.patch
|
||||
# Bug Fixes
|
||||
Patch150: virtman-supported-disk-formats.patch
|
||||
Patch151: virtman-prevent-double-click-starting-vm-twice.patch
|
||||
@ -210,7 +209,6 @@ machine).
|
||||
%patch126 -p1
|
||||
%patch127 -p1
|
||||
%patch128 -p1
|
||||
%patch129 -p1
|
||||
# Bug Fixes
|
||||
%patch150 -p1
|
||||
%patch151 -p1
|
||||
|
@ -1,95 +0,0 @@
|
||||
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.1/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
|
||||
|
||||
|
||||
+def _distroFromAutorun(fetcher, arch, vmtype=None):
|
||||
+ # Just look for autorun.inf (also in uppercase)
|
||||
+ # If present media is likely from a windows iso.
|
||||
+ distro_version = None
|
||||
+ if not fetcher.hasFile("autorun.inf"):
|
||||
+ return None
|
||||
+
|
||||
+ dclass = WindowsDistro
|
||||
+
|
||||
+ 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 = []
|
||||
logging.debug("Finding distro store for location=%s", fetcher.location)
|
||||
@@ -427,6 +445,10 @@ def getDistroStore(guest, fetcher):
|
||||
if dist:
|
||||
return dist
|
||||
|
||||
+ dist = _distroFromAutorun(fetcher, arch, _type)
|
||||
+ if dist:
|
||||
+ return dist
|
||||
+
|
||||
stores = _allstores[:]
|
||||
|
||||
# If user manually specified an os_distro, bump it's URL class
|
||||
@@ -1175,6 +1197,13 @@ class ALTLinuxDistro(Distro):
|
||||
logging.debug("Regex didn't match, not a %s distro", self.name)
|
||||
return False
|
||||
|
||||
+class WindowsDistro(Distro):
|
||||
+
|
||||
+ urldistro = "windows"
|
||||
+ 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)
|
||||
|
Loading…
Reference in New Issue
Block a user