Index: trunk/src/VBox/Main/idl/VirtualBox.xidl
===================================================================
--- trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 42125)
+++ trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 42129)
@@ -1398,5 +1398,5 @@
   <interface
     name="IVirtualBox" extends="$unknown"
-    uuid="867664ba-41ce-4099-a10d-b7a8e34057c7"
+    uuid="53789455-fad2-425a-94c8-eb6dc4ceaa05"
     wsmap="managed"
     >
@@ -1495,4 +1495,13 @@
     </attribute>
 
+    <attribute name="machineGroups" type="wstring" readonly="yes" safearray="yes">
+      <desc>
+        Array of all machine group names which are used by the machines which
+        are accessible. Each group is only listed once, however they are listed
+        in no particular order and there is no guarantee that there are no gaps
+        in the group hierarchy (i.e. "/", "/group/subgroup" is a valid result).
+      </desc>
+    </attribute>
+
     <attribute name="hardDisks" type="IMedium" readonly="yes" safearray="yes">
       <desc>
@@ -1582,7 +1591,8 @@
 
         <ul>
-          <li>It gets called by <link to="#createMachine" /> if NULL is specified
-          for the @a settingsFile argument there, which means that API should use
-          a recommended default file name.</li>
+          <li>It gets called by <link to="#createMachine" /> if @c null or
+            empty string (which is recommended) is specified for the
+            @a settingsFile argument there, which means that API should use
+            a recommended default file name.</li>
 
           <li>It can be called manually by a client software before creating a machine,
@@ -1597,4 +1607,9 @@
         details about the machine name.
 
+        @a groupName defines which additional subdirectory levels should be
+        included. It must be either a valid group name or @c null or empty
+        string which designates that the machine will not be related to a
+        machine group.
+
         If @a baseFolder is a @c null or empty string (which is recommended), the
         default machine settings folder
@@ -1605,8 +1620,12 @@
 
         This method does not access the host disks. In particular, it does not check
-        for whether a machine of this name already exists.
+        for whether a machine with this name already exists.
       </desc>
       <param name="name" type="wstring" dir="in">
         <desc>Suggested machine name.</desc>
+      </param>
+      <param name="group" type="wstring" dir="in">
+        <desc>Machine group name for the new machine or machine group. It is
+        used to determine the right subdirectory.</desc>
       </param>
       <param name="baseFolder" type="wstring" dir="in">
@@ -1627,10 +1646,11 @@
         and machine files can be created at arbitrary locations.
 
-        However, it is is recommended that machines be created in the default
+        However, it is recommended that machines are created in the default
         machine folder (e.g. "/home/user/VirtualBox VMs/name/name.vbox"; see
         <link to="ISystemProperties::defaultMachineFolder" />). If you specify
-        NULL for the @a settingsFile argument, <link to="#composeMachineFilename" />
-        is called automatically to have such a recommended name composed based
-        on the machine name given in the @a name argument.
+        @c null or empty string (which is recommended) for the @a settingsFile
+        argument, <link to="#composeMachineFilename" /> is called automatically
+        to have such a recommended name composed based on the machine name
+        given in the @a name argument and the primary group.
 
         If the resulting settings file already exists, this method will fail,
@@ -1693,9 +1713,15 @@
       <param name="settingsFile" type="wstring" dir="in">
         <desc>Fully qualified path where the settings file should be created,
-        or NULL for a default folder and file based on the @a name argument
+          empty string or @c null for a default folder and file based on the
+          @a name argument and the primary group.
         (see <link to="#composeMachineFilename" />).</desc>
       </param>
       <param name="name" type="wstring" dir="in">
         <desc>Machine name.</desc>
+      </param>
+      <param name="groups" type="wstring" safearray="yes" dir="in">
+        <desc>Array of group names. @c null or an empty array have the same
+          meaning as an array with just the empty string or "/", i.e. create a
+          machine without group association.</desc>
       </param>
       <param name="osTypeId" type="wstring" dir="in">
@@ -3711,5 +3737,5 @@
   <interface
     name="IMachine" extends="$unknown"
-    uuid="019d7a7b-1e2d-4008-b954-4b5d72d103b8"
+    uuid="1d03031a-ce63-4641-9d67-3a16e03778d5"
     wsmap="managed"
     >
@@ -3865,4 +3891,14 @@
     </attribute>
 
+    <attribute name="groups" type="wstring" safearray="yes">
+      <desc>
+        Array of machine group names of which this machine is a member. "" and
+        "/" are synonyms for the toplevel group. Each group is only listed
+        once, however they are listed in no particular order and there is no
+        guarantee that there are no gaps in the group hierarchy
+        (i.e. "/group", "/group/subgroup/subsubgroup" is a valid result).
+      </desc>
+    </attribute>
+
     <attribute name="OSTypeId" type="wstring">
       <desc>
@@ -3888,5 +3924,5 @@
         properties.  For most VMs this is the same as the @a id, but for VMs
         which have been cloned or teleported it may be the same as the source
-        VM.  This latter is because the guest shouldn't notice that it was
+        VM. The latter is because the guest shouldn't notice that it was
         cloned or teleported.
       </desc>
@@ -4354,6 +4390,6 @@
         Enables tracepoints in PDM devices and drivers to use the VMCPU or VM
         structures when firing off trace points.  This is especially useful
-        with DTrace tracepoints, as it allow you to use the VMCPU or VM pointer
-        to obtail useful information such as guest register state.
+        with DTrace tracepoints, as it allows you to use the VMCPU or VM
+        pointer to obtain useful information such as guest register state.
 
         This is disabled by default because devices and drivers normally has no
@@ -4574,7 +4610,7 @@
             <li><tt>"emergencystop"</tt>: reserved value, used for aborting
               the currently running VM or session owner. In this case the
-              @a session parameter may be @c NULL (if it is non-null it isn't
+              @a session parameter may be @c null (if it is non-null it isn't
               used in any way), and the @a progress return value will be always
-              NULL. The operation completes immediately.</li>
+              @c null. The operation completes immediately.</li>
           </ul>
         </desc>
@@ -4745,5 +4781,5 @@
       </param>
       <param name="medium" type="IMedium" dir="in">
-        <desc>Medium to mount or NULL for an empty drive.</desc>
+        <desc>Medium to mount or @c null for an empty drive.</desc>
       </param>
     </method>
@@ -4975,5 +5011,5 @@
       </param>
       <param name="bandwidthGroup" type="IBandwidthGroup" dir="in">
-        <desc>New value for the bandwidth group or NULL for no group.</desc>
+        <desc>New value for the bandwidth group or @c null for no group.</desc>
       </param>
     </method>
@@ -5025,5 +5061,5 @@
       </param>
       <param name="medium" type="IMedium" dir="in">
-        <desc>Medium to mount or NULL for an empty drive.</desc>
+        <desc>Medium to mount or @c null for an empty drive.</desc>
       </param>
       <param name="force" type="boolean" dir="in">
@@ -7063,5 +7099,5 @@
         Paused virtual machine. When the machine is PoweredOff, an
         offline snapshot is created. When the machine is Running a live
-        snapshot is created, and an online snapshot is is created when Paused.
+        snapshot is created, and an online snapshot is created when Paused.
 
         The taken snapshot is always based on the
@@ -11531,5 +11567,5 @@
 
               When deleting the current snapshot, the <link to="IMachine::currentSnapshot" />
-              attribute is set to the current snapshot's parent or NULL if it
+              attribute is set to the current snapshot's parent or @c null if it
               has no parent. Otherwise the attribute is unchanged.
           </li>
@@ -11736,5 +11772,5 @@
     <const name="MultiAttach"       value="5">
       <desc>
-        A medium which is is indirectly attached, so that one base medium can
+        A medium which is indirectly attached, so that one base medium can
         be used for several VMs which have their own differencing medium to
         store their modifications. In some sense a variant of Immutable
Index: trunk/src/VBox/Main/idl/midl.xsl
===================================================================
--- trunk/src/VBox/Main/idl/midl.xsl	(revision 42125)
+++ trunk/src/VBox/Main/idl/midl.xsl	(revision 42129)
@@ -6,5 +6,5 @@
  *  from the generic interface definition expressed in XML.
 
-     Copyright (C) 2006-2010 Oracle Corporation
+     Copyright (C) 2006-2012 Oracle Corporation
 
      This file is part of VirtualBox Open Source Edition (OSE), as
@@ -288,10 +288,5 @@
       <xsl:with-param name="str" select="@name"/>
     </xsl:call-template>
-    <xsl:text> ([in</xsl:text>
-    <xsl:if test="@safearray='yes'">
-      <!-- VB supports only [in, out], [out] and [out, retval] arrays -->
-      <xsl:text>, out</xsl:text>
-    </xsl:if>
-    <xsl:text>] </xsl:text>
+    <xsl:text> ([in] </xsl:text>
     <xsl:if test="@safearray='yes'">
       <xsl:text>SAFEARRAY(</xsl:text>
@@ -299,5 +294,5 @@
     <xsl:apply-templates select="@type"/>
     <xsl:if test="@safearray='yes'">
-      <xsl:text>) *</xsl:text>
+      <xsl:text>)</xsl:text>
     </xsl:if>
     <xsl:text> a</xsl:text>
