Changeset 13227 in vbox for trunk/src/VBox/Main/idl/VirtualBox.xidl
- Timestamp:
- Oct 13, 2008 4:51:18 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 37799
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r13221 r13227 1896 1896 Opens a new direct session with the given virtual machine. 1897 1897 1898 Within the direct session context, it is possible to change 1899 all VM settings, as well as to execute the VM in the process 1900 space of the session object. There can be only one direct 1901 session open at a time for every virtual machine. In VirtualBox 1902 terminology, the machine becomes "mutable" after a session has 1903 been opened. 1898 A direct session acts as a local lock on the given VM. 1899 There can be only one direct session open at a time for every 1900 virtual machine, protecting the VM from being manipulated by 1901 conflicting actions from different processes. Only after a 1902 direct session has been opened, one can change all VM settings 1903 and execute the VM in the process space of the session object. 1904 1905 Sessions therefore can be compared to mutex semaphores that 1906 lock a given VM for modification and execution. 1907 See <link to="ISession">ISession</link> for details. 1908 1909 <note>Unless you are writing a new VM frontend, you will not 1910 want to execute a VM in the current process. To spawn a new 1911 process that executes a VM, use 1912 <link to="IVirtualBox::openRemoteSession" /> 1913 instead.</note> 1904 1914 1905 1915 Upon successful return, the session object can be used to 1906 1916 get access to the machine and to the VM console. 1907 1917 1908 Note that the "mutable" machine object, on which you may want 1909 to invoke IMachine methods to change its settings, will be a 1910 different object from the immutable IMachine objects returned 1911 by various IVirtualBox methods. To obtain a mutable 1912 IMachine object, upon which you can invoke settings methods, 1913 use the "machine" attribute of the ISession object which represents 1914 your open session. 1918 In VirtualBox terminology, the machine becomes "mutable" after 1919 a session has been opened. Note that the "mutable" machine 1920 object, on which you may invoke IMachine methods to change its 1921 settings, will be a different object from the immutable IMachine 1922 objects returned by various IVirtualBox methods. To obtain a 1923 mutable IMachine object (upon which you can invoke settings methods), 1924 use the <link to="ISession::machine" /> attribute. 1925 1926 One must always call <link to="ISession::close" /> to release the 1927 lock on the machine, or the machine's state will eventually be 1928 set to "Aborted". 1915 1929 1916 1930 In other words, to change settings on a machine, the following … … 1921 1935 the current session.</li> 1922 1936 1923 <li>Obtain a mutable IMachine object from ISession::machine.</li>1937 <li>Obtain a mutable IMachine object from <link to="ISession::machine" />.</li> 1924 1938 1925 1939 <li>Change the settings of the machine.</li> 1926 1940 1927 <li>Call IMachine::saveSettings.</li>1928 1929 <li>Close the session by calling <link to=" #close" />.</li>1941 <li>Call <link to="IMachine::saveSettings" />.</li> 1942 1943 <li>Close the session by calling <link to="ISession::close" />.</li> 1930 1944 </ol> 1931 1945 </desc> … … 1948 1962 <method name="openRemoteSession"> 1949 1963 <desc> 1950 Opens a new remote session with the given virtual machine. 1964 Spawns a new process that executes a virtual machine (called a 1965 "remote session"). 1951 1966 1952 1967 Opening a remote session causes the VirtualBox server to start a new 1953 process that opens a direct session with the given VM. The remote 1954 session provides some level of control over the VM execution to the 1955 caller (using the IConsole interface); however, within the remote 1956 session context, not all VM settings are available for modification. 1968 process that opens a direct session with the given VM. As a result, the 1969 VM is locked by that direct session in the new process, preventing 1970 conflicting changes from other processes. Since sessions act as locks 1971 that such prevent conflicting changes, one cannot open a remote session 1972 for a VM that already has another open session (direct or remote), or 1973 is currently in the process of opening one (see <link to="IMachine::sessionState"/>). 1974 1975 While the remote session still provides some level of control over the 1976 VM execution to the caller (using the <link to="IConsole" /> interface), 1977 not all VM settings are available for modification within the remote 1978 session context. 1957 1979 1958 1980 This operation can take some time (a new VM is started in a new process, 1959 for which memory and other resources need to be set up , which can take1960 a few seconds). Because of this, a progress object is returned to allow the1961 caller to wait for this asynchronous operation to be completed. Until then,1962 the remote session object remains in the closed state and accessing the1963 machine or itsconsole through it is invalid. It is recommended to use1981 for which memory and other resources need to be set up). Because of this, 1982 an <link to="IProgress" /> is returned to allow the caller to wait for this 1983 asynchronous operation to be completed. Until then, the remote session 1984 object remains in the closed state, and accessing the machine or its 1985 console through it is invalid. It is recommended to use 1964 1986 <link to="IProgress::waitForCompletion" /> or similar calls to wait for 1965 1987 completion. 1988 1989 As with all <link to="ISession" /> objects, it is recommended to call 1990 <link to="ISession::close" /> on the local session object once openRemoteSession() 1991 has been called. However, the session's state (see <link to="ISession::state" />) 1992 will not return to "Closed" until the remote session has also closed (i.e. 1993 until the VM is no longer running). In that case, however, the state of 1994 the session will automatically change back to "Closed". 1966 1995 1967 1996 Currently supported session types (values of the @a type … … 1987 2016 If the environment string is @c null, the server environment is 1988 2017 inherited by the started process as is. 1989 1990 <note>1991 It is an error to open a remote session with the machine1992 that already has an open direct session or waits until the1993 previous request to open the remote session is completed1994 (see <link to="IMachine::sessionState"/>).1995 </note>1996 1997 <note>1998 The opened @a session will be automatically closed when1999 the corresponding direct session dies or gets closed.2000 </note>2001 2018 2002 2019 <see>openExistingSession</see> … … 10143 10160 machines. 10144 10161 10145 Within VirtualBox, every time one wishes to manipulate a virtual machine 10146 (for example, change its settings or start execution), an instance of 10147 the ISession interface is required. One first creates a local session 10148 object that implements the ISession interface and then passes the 10149 created object with the method call that opens the given session and 10150 thus initiates the machine manipulation. The session serves several 10151 purposes: it identifies to the inter-process VirtualBox code which 10152 process is currently working with the virtual machine, and it ensures 10162 With VirtualBox, every time one wishes to manipulate a virtual machine 10163 (e.g. change its settings or start execution), a session object is 10164 required. Such an object must be passed to one of the session methods 10165 that open the given session, which then initiates the machine manipulation. 10166 10167 A session serves several purposes: it identifies to the inter-process VirtualBox 10168 code which process is currently working with the virtual machine, and it ensures 10153 10169 that there are no incompatible requests from several processes for the 10154 same virtual machine. 10170 same virtual machine. Session objects can therefore be thought of as mutex 10171 semaphores that lock virtual machines to prevent conflicting accesses from 10172 several processes. 10155 10173 10156 10174 How sessions objects are used depends on whether you use the Main API 10157 via COM or via the web 10175 via COM or via the webservice: 10158 10176 10159 10177 <ul> … … 10234 10252 <method name="close"> 10235 10253 <desc> 10236 Closes this session. 10237 <note> 10238 If a direct session for a machine opened with 10239 <link to="IVirtualBox::openSession()"/> is not explicitly 10240 closed when the application terminates, the state of the 10241 machine will be set to <link to="MachineState::Aborted"/> 10242 on the server. Generally, it is recommended to close all 10243 open sessions explicitly before terminating the application 10244 (no matter what is the reason of the termination). 10254 Closes a session that was previously opened. 10255 10256 It is recommended that every time an "open session" method (such as 10257 <link to="IVirtualBox::openRemoteSession" /> or 10258 <link to="IVirtualBox::openSession" />) has been called to 10259 manipulate a virtual machine, the caller invoke 10260 ISession::close() when it's done doing so. Since sessions are 10261 serialization primitives much like ordinary mutexes, they are 10262 best used the same way: for each "open" call, there should be 10263 a matching "close" call, even when errors occur. 10264 10265 Otherwise, if a direct session for a machine opened with 10266 <link to="IVirtualBox::openSession()"/> is not explicitly closed 10267 when the application terminates, the state of the machine will 10268 be set to <link to="MachineState::Aborted" /> on the server. 10269 10270 Generally, it is recommended to close all open sessions explicitly 10271 before terminating the application (no matter what is the reason of 10272 the termination). 10273 10274 <note> 10275 Do not expect the session state (<link to="ISession::state" /> 10276 to return to "Closed" immediately after you invoke 10277 ISession::close(), particularly if you have started a remote 10278 session to execute the VM in a new process. The session state will 10279 automatically return to "Closed" once the VM is no longer executing, 10280 which can of course take a very long time. 10245 10281 </note> 10246 10282 </desc> … … 10495 10531 sub-metrics are collected when their base metric is collected. 10496 10532 Collected values for any set of sub-metrics can be queried with 10497 <link to="IPerformanceCollector::queryMetricsData" />. When setting up 10498 metric parameters, querying metric data, enabling or disabling metrics 10499 wildcards can be used in metric names to specify a subset of metrics. For 10500 example, to select all CPU-related metrics use <tt>CPU/*</tt>, all 10501 averages can be queried using <tt>*:avg</tt> and so on. To query metric 10533 <link to="IPerformanceCollector::queryMetricsData" />. When setting up 10534 metric parameters, querying metric data, enabling or disabling metrics 10535 wildcards can be used in metric names to specify a subset of metrics. For 10536 example, to select all CPU-related metrics use <tt>CPU/*</tt>, all 10537 averages can be queried using <tt>*:avg</tt> and so on. To query metric 10502 10538 values without aggregates <tt>*:</tt> can be used. 10503 10539 … … 10597 10633 <method name="setupMetrics"> 10598 10634 <desc> 10599 Sets parameters of specified base metrics for a set of objects. Returns 10600 an array of <link to="IPerformanceMetric" /> describing the metrics have 10635 Sets parameters of specified base metrics for a set of objects. Returns 10636 an array of <link to="IPerformanceMetric" /> describing the metrics have 10601 10637 been affected. 10602 10638 <note> 10603 10639 @c Null or empty metric name array means all metrics. @c Null or empty 10604 object array means all existing objects. If metric name array contains 10605 a single element and object array contains many, the single metric 10606 name array element is applied to each object array element to form 10640 object array means all existing objects. If metric name array contains 10641 a single element and object array contains many, the single metric 10642 name array element is applied to each object array element to form 10607 10643 metric/object pairs. 10608 10644 </note> … … 10610 10646 <param name="metricNames" type="wstring" dir="in" safearray="yes"> 10611 10647 <desc> 10612 Metric name filter. Comma-separated list of metrics with wildcard 10648 Metric name filter. Comma-separated list of metrics with wildcard 10613 10649 support. 10614 10650 </desc> … … 10645 10681 <note> 10646 10682 @c Null or empty metric name array means all metrics. @c Null or empty 10647 object array means all existing objects. If metric name array contains 10648 a single element and object array contains many, the single metric 10649 name array element is applied to each object array element to form 10683 object array means all existing objects. If metric name array contains 10684 a single element and object array contains many, the single metric 10685 name array element is applied to each object array element to form 10650 10686 metric/object pairs. 10651 10687 </note> … … 10653 10689 <param name="metricNames" type="wstring" dir="in" safearray="yes"> 10654 10690 <desc> 10655 Metric name filter. Comma-separated list of metrics with wildcard 10691 Metric name filter. Comma-separated list of metrics with wildcard 10656 10692 support. 10657 10693 </desc> … … 10676 10712 <note> 10677 10713 @c Null or empty metric name array means all metrics. @c Null or empty 10678 object array means all existing objects. If metric name array contains 10679 a single element and object array contains many, the single metric 10680 name array element is applied to each object array element to form 10714 object array means all existing objects. If metric name array contains 10715 a single element and object array contains many, the single metric 10716 name array element is applied to each object array element to form 10681 10717 metric/object pairs. 10682 10718 </note> … … 10684 10720 <param name="metricNames" type="wstring" dir="in" safearray="yes"> 10685 10721 <desc> 10686 Metric name filter. Comma-separated list of metrics with wildcard 10722 Metric name filter. Comma-separated list of metrics with wildcard 10687 10723 support. 10688 10724 </desc> … … 10705 10741 10706 10742 The data itself and related metric information are returned in seven 10707 parallel and one flattened array of arrays. Elements of 10743 parallel and one flattened array of arrays. Elements of 10708 10744 <tt>returnMetricNames, returnObjects, returnUnits, returnScales, 10709 returnSequenceNumbers, returnDataIndices and returnDataLengths</tt> with 10710 the same index describe one set of values corresponding to a single 10745 returnSequenceNumbers, returnDataIndices and returnDataLengths</tt> with 10746 the same index describe one set of values corresponding to a single 10711 10747 metric. 10712 10748 10713 The <tt>returnData</tt> parameter is a flattened array of arrays. Each 10714 start and length of a sub-array is indicated by 10715 <tt>returnDataIndices</tt> and <tt>returnDataLengths</tt>. The first 10716 value for metric <tt>metricNames[i]</tt> is at 10749 The <tt>returnData</tt> parameter is a flattened array of arrays. Each 10750 start and length of a sub-array is indicated by 10751 <tt>returnDataIndices</tt> and <tt>returnDataLengths</tt>. The first 10752 value for metric <tt>metricNames[i]</tt> is at 10717 10753 <tt>returnData[returnIndices[i]]</tt>. 10718 10754 10719 10755 <note> 10720 10756 @c Null or empty metric name array means all metrics. @c Null or empty 10721 object array means all existing objects. If metric name array contains 10722 a single element and object array contains many, the single metric 10723 name array element is applied to each object array element to form 10757 object array means all existing objects. If metric name array contains 10758 a single element and object array contains many, the single metric 10759 name array element is applied to each object array element to form 10724 10760 metric/object pairs. 10725 10761 </note> … … 10738 10774 <param name="metricNames" type="wstring" dir="in" safearray="yes"> 10739 10775 <desc> 10740 Metric name filter. Comma-separated list of metrics with wildcard 10776 Metric name filter. Comma-separated list of metrics with wildcard 10741 10777 support. 10742 10778 </desc>
Note:
See TracChangeset
for help on using the changeset viewer.