virt-manager/virtinst-detect-windows-media.patch
Charles Arnold 850019f018 - Upstream bug fixes
53ac1f8d-fix_show_err_typo.patch
  53ac1f8d-createnet-validate-last-page-before-creating-network.patch
- KVM: Don't check for /dev/kvm. It is now built into the kernel
  virtman-kvm.patch

- Upstream bug fix
  53a995cb-fix-usb-storage-removable-syntax.patch

- Upstream bug fixes
  5397b647-createnet-enable-specifying-29-subnet.patch
  539e8cca-createpool-fix-creation-of-gluster-pools.patch
  53a05e73-fix-edit-maxvcpus.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=184
2014-07-01 03:41:52 +00:00

74 lines
3.1 KiB
Diff

Index: virt-manager-1.0.1/virtinst/urlfetcher.py
===================================================================
--- virt-manager-1.0.1.orig/virtinst/urlfetcher.py
+++ virt-manager-1.0.1/virtinst/urlfetcher.py
@@ -386,6 +386,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)
@@ -405,6 +423,10 @@ def getDistroStore(guest, fetcher):
if dist:
return dist
+ dist = _distroFromAutorun(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
@@ -1151,6 +1173,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.0.1/virtinst/osdict.py
===================================================================
--- virt-manager-1.0.1.orig/virtinst/osdict.py
+++ virt-manager-1.0.1/virtinst/osdict.py
@@ -316,9 +316,12 @@ _add_var("win2k", "Microsoft Windows 200
_add_var("winxp", "Microsoft Windows XP", sortby="mswin5", supported=True, xen_disable_acpi=True, parent="windows")
_add_var("winxp64", "Microsoft Windows XP (x86_64)", supported=True, sortby="mswin564", parent="windows")
_add_var("win2k3", "Microsoft Windows Server 2003", supported=True, sortby="mswinserv2003", parent="windows")
-_add_var("win2k8", "Microsoft Windows Server 2008 (or later)", supported=True, sortby="mswinserv2008", parent="windows")
+_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("vista", "Microsoft Windows Vista", supported=True, sortby="mswin6", parent="windows")
-_add_var("win7", "Microsoft Windows 7 (or later)", supported=True, sortby="mswin7", 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")
_add_type("solaris", "Solaris", clock="localtime")