]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
virt: detect parallels virtualization 1117/head
authorEvgeny Vereshchagin <evvers@ya.ru>
Wed, 2 Sep 2015 01:43:32 +0000 (01:43 +0000)
committerEvgeny Vereshchagin <evvers@ya.ru>
Wed, 2 Sep 2015 01:49:47 +0000 (01:49 +0000)
inspired by http://people.redhat.com/~rjones/virt-what/

see:
* http://git.annexia.org/?p=virt-what.git;a=blob;f=virt-what.in;h=a5ed33ef3e4bfa3281c9589eccac4d92dff1babe;hb=HEAD#l200
* http://git.annexia.org/?p=virt-what.git;a=blob;f=virt-what.in;h=a5ed33ef3e4bfa3281c9589eccac4d92dff1babe;hb=HEAD#l253

man/systemd-detect-virt.xml
src/basic/virt.c

index 40755a24d0cabd5d38427df66cef1359a8e3b688..9ea9141d4d08855ecb95e1503894c1646fb2daeb 100644 (file)
@@ -88,7 +88,7 @@
         </thead>
         <tbody>
           <row>
-      <entry morerows="8">VM</entry>
+      <entry morerows="9">VM</entry>
       <entry><varname>qemu</varname></entry>
       <entry>QEMU software virtualization</entry>
           </row>
       <entry>User-mode Linux</entry>
           </row>
 
+          <row>
+      <entry><varname>parallels</varname></entry>
+      <entry>Parallels Desktop, Parallels Server</entry>
+          </row>
+
           <row>
       <entry morerows="5">container</entry>
       <entry><varname>openvz</varname></entry>
index a8d26716a1de41e70fc2ed8c6bd26b31ab4542b7..4a4bebd528bc180cf8b43ce049fa40d6ff7ecddd 100644 (file)
@@ -156,7 +156,8 @@ static int detect_vm_dmi(const char **_id) {
                 "VMW\0"                   "vmware\0"
                 "innotek GmbH\0"          "oracle\0"
                 "Xen\0"                   "xen\0"
-                "Bochs\0"                 "bochs\0";
+                "Bochs\0"                 "bochs\0"
+                "Parallels\0"             "parallels\0";
         unsigned i;
 
         for (i = 0; i < ELEMENTSOF(dmi_vendors); i++) {
@@ -244,8 +245,9 @@ int detect_vm(const char **id) {
         r = detect_vm_dmi(&_id);
 
         /* kvm with and without Virtualbox */
+        /* Parallels exports KVMKVMKVM leaf */
         if (streq_ptr(_id_cpuid, "kvm")) {
-                if (r > 0 && streq(_id, "oracle"))
+                if (r > 0 && (streq(_id, "oracle") || streq(_id, "parallels")))
                         goto finish;
 
                 _id = _id_cpuid;