virt-manager/virtinst-detect-windows-media.patch
Charles Arnold b78bd34b50 - bnc#909225 - pygrub Unable to find partition containing kernel
Update virtinst-pvgrub2-bootloader.patch

- Reorder virt-manager patches according to type
- Drop virtman-cdrom.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=216
2015-01-05 18:16:33 +00:00

72 lines
2.6 KiB
Diff

Index: virt-manager-1.1.0/virtinst/urlfetcher.py
===================================================================
--- virt-manager-1.1.0.orig/virtinst/urlfetcher.py
+++ virt-manager-1.1.0/virtinst/urlfetcher.py
@@ -407,6 +407,24 @@ def _distroFromContent(fetcher, arch, vm
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)
@@ -426,6 +444,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
@@ -1161,6 +1183,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 = "win-unknown"
+
+ def isValidStore(self):
+ return False
# Build list of all *Distro classes
def _build_distro_list():
Index: virt-manager-1.1.0/virtinst/osdict.py
===================================================================
--- virt-manager-1.1.0.orig/virtinst/osdict.py
+++ virt-manager-1.1.0/virtinst/osdict.py
@@ -543,6 +543,12 @@ _add_var("oes11", "Novell Open Enterpris
_add_var("rear", "Relax and Recover", supported=True, virtiodisk=True, virtionet=True, parent="sles11")
_add_var("netware6", "Novell Netware 6 (or later)", supported=True, parent="other")
+_add_var("win2k8", "Microsoft Windows Server 2008", supported=True, sortby="mswinserv2008", parent="windows")
+_add_var("win2k12", "Microsoft Windows Server 2012 (or later)", supported=True, sortby="mswinserv2012", parent="windows")
+_add_var("win7", "Microsoft Windows 7", supported=True, sortby="mswin7", parent="windows")
+_add_var("win8", "Microsoft Windows 8 (or later)", supported=True, sortby="mswin8", parent="windows")
+_add_var("win-unknown", "Microsoft Windows Unknown Version", supported=True, sortby="mswin", parent="windows")
+
_os_data_loaded = False
_os_loader = None