[virt-tools-list] [virt-manager PATCH v2 4/4] osdict: add "macos" type

Pino Toscano ptoscano at redhat.com
Mon Apr 24 14:20:43 UTC 2017


Give macOS OSes an own type, so they have their own entry in the list of
OS types.
---
 virtManager/create.py | 1 +
 virtinst/osdict.py    | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/virtManager/create.py b/virtManager/create.py
index e855cf6..6398d89 100644
--- a/virtManager/create.py
+++ b/virtManager/create.py
@@ -978,6 +978,7 @@ class vmmCreate(vmmGObjectUI):
             "bsd": _("BSD"),
             "generic": _("Generic"),
             "linux": _("Linux"),
+            "macos": _("macOS"),
             "other": _("Others"),
             "solaris": _("Solaris"),
             "windows": _("Windows"),
diff --git a/virtinst/osdict.py b/virtinst/osdict.py
index d602611..854f59c 100644
--- a/virtinst/osdict.py
+++ b/virtinst/osdict.py
@@ -244,7 +244,7 @@ class _OSDB(object):
         return osname
 
     def list_types(self):
-        approved_types = ["linux", "windows", "bsd",
+        approved_types = ["linux", "windows", "bsd", "macos",
             "solaris", "other", "generic"]
         return approved_types
 
@@ -423,6 +423,9 @@ class _OsVariant(object):
         if self._family in ['openbsd', 'freebsd', 'netbsd']:
             return "bsd"
 
+        if self._family in ['darwin']:
+            return "macos"
+
         return "other"
 
     def is_windows(self):
-- 
2.9.3




More information about the virt-tools-list mailing list