~ubuntu-branches/ubuntu/raring/virtualbox-ose/raring

« back to all changes in this revision

Viewing changes to src/VBox/Main/GuestImpl.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2009-12-18 16:44:29 UTC
  • mfrom: (0.3.3 upstream) (0.4.6 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091218164429-jd34ccexpv5na11a
Tags: 3.1.2-dfsg-1ubuntu1
* Merge from Debian unstable (LP: #498219), remaining changes:
  - Disable update action
    - debian/patches/u01-disable-update-action.dpatch
  - VirtualBox should go in Accessories, not in System tools (LP: #288590)
    - debian/virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add Apport hook
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Add Launchpad integration
    - debian/control
    - debian/lpi-bug.xpm
    - debian/patches/u02-lp-integration.dpatch
* Fixes the following bugs:
  - Kernel module fails to build with Linux >= 2.6.32 (LP: #474625)
  - X.Org drivers need to be rebuilt against X-Server 1.7 (LP: #495935)
  - The *-source packages try to build the kernel modules even though the
    kernel headers aren't available (LP: #473334)
* Replace *-source packages with transitional packages for *-dkms.
* Adapt u01-disable-update-action.dpatch and u02-lp-integration.dpatch for
  new upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
#include "Logging.h"
31
31
 
32
 
#include <VBox/VBoxDev.h>
 
32
#include <VBox/VMMDev.h>
33
33
#include <iprt/cpputils.h>
34
34
 
35
35
// defines
58
58
 */
59
59
HRESULT Guest::init (Console *aParent)
60
60
{
61
 
    LogFlowThisFunc (("aParent=%p\n", aParent));
 
61
    LogFlowThisFunc(("aParent=%p\n", aParent));
62
62
 
63
63
    ComAssertRet (aParent, E_INVALIDARG);
64
64
 
65
65
    /* Enclose the state transition NotReady->InInit->Ready */
66
 
    AutoInitSpan autoInitSpan (this);
67
 
    AssertReturn (autoInitSpan.isOk(), E_FAIL);
 
66
    AutoInitSpan autoInitSpan(this);
 
67
    AssertReturn(autoInitSpan.isOk(), E_FAIL);
68
68
 
69
 
    unconst (mParent) = aParent;
 
69
    unconst(mParent) = aParent;
70
70
 
71
71
    /* mData.mAdditionsActive is FALSE */
72
72
 
102
102
 */
103
103
void Guest::uninit()
104
104
{
105
 
    LogFlowThisFunc (("\n"));
 
105
    LogFlowThisFunc(("\n"));
106
106
 
107
107
    /* Enclose the state transition Ready->InUninit->NotReady */
108
 
    AutoUninitSpan autoUninitSpan (this);
 
108
    AutoUninitSpan autoUninitSpan(this);
109
109
    if (autoUninitSpan.uninitDone())
110
110
        return;
111
111
 
112
 
    unconst (mParent).setNull();
 
112
    unconst(mParent).setNull();
113
113
}
114
114
 
115
115
// IGuest properties
119
119
{
120
120
    CheckComArgOutPointerValid(aOSTypeId);
121
121
 
122
 
    AutoCaller autoCaller (this);
123
 
    CheckComRCReturnRC (autoCaller.rc());
 
122
    AutoCaller autoCaller(this);
 
123
    CheckComRCReturnRC(autoCaller.rc());
124
124
 
125
 
    AutoReadLock alock (this);
 
125
    AutoReadLock alock(this);
126
126
 
127
127
    // redirect the call to IMachine if no additions are installed
128
128
    if (mData.mAdditionsVersion.isNull())
129
129
        return mParent->machine()->COMGETTER(OSTypeId) (aOSTypeId);
130
130
 
131
 
    mData.mOSTypeId.cloneTo (aOSTypeId);
 
131
    mData.mOSTypeId.cloneTo(aOSTypeId);
132
132
 
133
133
    return S_OK;
134
134
}
137
137
{
138
138
    CheckComArgOutPointerValid(aAdditionsActive);
139
139
 
140
 
    AutoCaller autoCaller (this);
141
 
    CheckComRCReturnRC (autoCaller.rc());
 
140
    AutoCaller autoCaller(this);
 
141
    CheckComRCReturnRC(autoCaller.rc());
142
142
 
143
 
    AutoReadLock alock (this);
 
143
    AutoReadLock alock(this);
144
144
 
145
145
    *aAdditionsActive = mData.mAdditionsActive;
146
146
 
151
151
{
152
152
    CheckComArgOutPointerValid(aAdditionsVersion);
153
153
 
154
 
    AutoCaller autoCaller (this);
155
 
    CheckComRCReturnRC (autoCaller.rc());
156
 
 
157
 
    AutoReadLock alock (this);
158
 
 
159
 
    mData.mAdditionsVersion.cloneTo (aAdditionsVersion);
 
154
    AutoCaller autoCaller(this);
 
155
    CheckComRCReturnRC(autoCaller.rc());
 
156
 
 
157
    AutoReadLock alock(this);
 
158
 
 
159
    mData.mAdditionsVersion.cloneTo(aAdditionsVersion);
160
160
 
161
161
    return S_OK;
162
162
}
165
165
{
166
166
    CheckComArgOutPointerValid(aSupportsSeamless);
167
167
 
168
 
    AutoCaller autoCaller (this);
169
 
    CheckComRCReturnRC (autoCaller.rc());
 
168
    AutoCaller autoCaller(this);
 
169
    CheckComRCReturnRC(autoCaller.rc());
170
170
 
171
 
    AutoReadLock alock (this);
 
171
    AutoReadLock alock(this);
172
172
 
173
173
    *aSupportsSeamless = mData.mSupportsSeamless;
174
174
 
179
179
{
180
180
    CheckComArgOutPointerValid(aSupportsGraphics);
181
181
 
182
 
    AutoCaller autoCaller (this);
183
 
    CheckComRCReturnRC (autoCaller.rc());
 
182
    AutoCaller autoCaller(this);
 
183
    CheckComRCReturnRC(autoCaller.rc());
184
184
 
185
 
    AutoReadLock alock (this);
 
185
    AutoReadLock alock(this);
186
186
 
187
187
    *aSupportsGraphics = mData.mSupportsGraphics;
188
188
 
193
193
{
194
194
    CheckComArgOutPointerValid(aMemoryBalloonSize);
195
195
 
196
 
    AutoCaller autoCaller (this);
197
 
    CheckComRCReturnRC (autoCaller.rc());
 
196
    AutoCaller autoCaller(this);
 
197
    CheckComRCReturnRC(autoCaller.rc());
198
198
 
199
 
    AutoReadLock alock (this);
 
199
    AutoReadLock alock(this);
200
200
 
201
201
    *aMemoryBalloonSize = mMemoryBalloonSize;
202
202
 
205
205
 
206
206
STDMETHODIMP Guest::COMSETTER(MemoryBalloonSize) (ULONG aMemoryBalloonSize)
207
207
{
208
 
    AutoCaller autoCaller (this);
209
 
    CheckComRCReturnRC (autoCaller.rc());
 
208
    AutoCaller autoCaller(this);
 
209
    CheckComRCReturnRC(autoCaller.rc());
210
210
 
211
 
    AutoWriteLock alock (this);
 
211
    AutoWriteLock alock(this);
212
212
 
213
213
    HRESULT ret = mParent->machine()->COMSETTER(MemoryBalloonSize)(aMemoryBalloonSize);
214
214
    if (ret == S_OK)
227
227
{
228
228
    CheckComArgOutPointerValid(aUpdateInterval);
229
229
 
230
 
    AutoCaller autoCaller (this);
231
 
    CheckComRCReturnRC (autoCaller.rc());
 
230
    AutoCaller autoCaller(this);
 
231
    CheckComRCReturnRC(autoCaller.rc());
232
232
 
233
 
    AutoReadLock alock (this);
 
233
    AutoReadLock alock(this);
234
234
 
235
235
    *aUpdateInterval = mStatUpdateInterval;
236
236
 
239
239
 
240
240
STDMETHODIMP Guest::COMSETTER(StatisticsUpdateInterval) (ULONG aUpdateInterval)
241
241
{
242
 
    AutoCaller autoCaller (this);
243
 
    CheckComRCReturnRC (autoCaller.rc());
 
242
    AutoCaller autoCaller(this);
 
243
    CheckComRCReturnRC(autoCaller.rc());
244
244
 
245
 
    AutoWriteLock alock (this);
 
245
    AutoWriteLock alock(this);
246
246
 
247
247
    HRESULT ret = mParent->machine()->COMSETTER(StatisticsUpdateInterval)(aUpdateInterval);
248
248
    if (ret == S_OK)
264
264
    CheckComArgNotNull(aPassword);
265
265
    CheckComArgNotNull(aDomain);
266
266
 
267
 
    AutoCaller autoCaller (this);
268
 
    CheckComRCReturnRC (autoCaller.rc());
 
267
    AutoCaller autoCaller(this);
 
268
    CheckComRCReturnRC(autoCaller.rc());
269
269
 
270
270
    /* forward the information to the VMM device */
271
271
    VMMDev *vmmDev = mParent->getVMMDev();
317
317
{
318
318
    Assert(aVersion.isNull() || !aVersion.isEmpty());
319
319
 
320
 
    AutoCaller autoCaller (this);
 
320
    AutoCaller autoCaller(this);
321
321
    AssertComRCReturnVoid (autoCaller.rc());
322
322
 
323
 
    AutoWriteLock alock (this);
 
323
    AutoWriteLock alock(this);
324
324
 
325
325
    mData.mAdditionsVersion = aVersion;
326
326
    mData.mAdditionsActive = !aVersion.isNull();
330
330
 
331
331
void Guest::setSupportsSeamless (BOOL aSupportsSeamless)
332
332
{
333
 
    AutoCaller autoCaller (this);
 
333
    AutoCaller autoCaller(this);
334
334
    AssertComRCReturnVoid (autoCaller.rc());
335
335
 
336
 
    AutoWriteLock alock (this);
 
336
    AutoWriteLock alock(this);
337
337
 
338
338
    mData.mSupportsSeamless = aSupportsSeamless;
339
339
}
340
340
 
341
341
void Guest::setSupportsGraphics (BOOL aSupportsGraphics)
342
342
{
343
 
    AutoCaller autoCaller (this);
 
343
    AutoCaller autoCaller(this);
344
344
    AssertComRCReturnVoid (autoCaller.rc());
345
345
 
346
 
    AutoWriteLock alock (this);
 
346
    AutoWriteLock alock(this);
347
347
 
348
348
    mData.mSupportsGraphics = aSupportsGraphics;
349
349
}