VirtualBox

source: vbox/trunk/src/VBox/Devices/VMMDev/VMMDevState.h@ 39882

最後變更 在這個檔案從39882是 39882,由 vboxsync 提交於 13 年 前

Config.kmk,VMMDev,Main,QtGui,VBoxManage: Refactored IGuest::additionsVersion and associated acts, splitting it up into additionsVersion and additionsRevision like IVirtualBox and IExtPack handles versioning. Fixed missing saved state in VMMDev where the VMMDevReq_ReportGuestInfo2 info was not saved and Main+Frontends led to believe we were running guest additions older than 3.2. The changes have be subjected to limited testing. Added TODOs for another missing save in VMMDev.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 10.0 KB
 
1/* $Id: VMMDevState.h 39882 2012-01-26 00:54:50Z vboxsync $ */
2/** @file
3 * VMMDev - Guest <-> VMM/Host communication device, internal header.
4 */
5
6/*
7 * Copyright (C) 2006-2007 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.alldomusa.eu.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef ___VMMDev_VMMDevState_h
19#define ___VMMDev_VMMDevState_h
20
21#include <VBox/VMMDev.h>
22#include <VBox/vmm/pdmdev.h>
23#include <VBox/vmm/pdmifs.h>
24
25#define TIMESYNC_BACKDOOR
26
27typedef struct DISPLAYCHANGEINFO
28{
29 uint32_t xres;
30 uint32_t yres;
31 uint32_t bpp;
32 uint32_t display;
33} DISPLAYCHANGEINFO;
34
35typedef struct DISPLAYCHANGEREQUEST
36{
37 bool fPending;
38 bool afAlignment[3];
39 DISPLAYCHANGEINFO displayChangeRequest;
40 DISPLAYCHANGEINFO lastReadDisplayChangeRequest;
41} DISPLAYCHANGEREQUEST;
42
43typedef struct DISPLAYCHANGEDATA
44{
45 /* Which monitor is being reported to the guest. */
46 int iCurrentMonitor;
47
48 /** true if the guest responded to VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST at least once */
49 bool fGuestSentChangeEventAck;
50 bool afAlignment[3];
51
52 DISPLAYCHANGEREQUEST aRequests[64]; // @todo maxMonitors
53} DISPLAYCHANGEDATA;
54
55
56/**
57 * Credentials for automatic guest logon and host configured logon (?).
58 *
59 * This is not stored in the same block as the instance data in order to make it
60 * harder to access.
61 */
62typedef struct VMMDEVCREDS
63{
64 /** credentials for guest logon purposes */
65 struct
66 {
67 char szUserName[VMMDEV_CREDENTIALS_SZ_SIZE];
68 char szPassword[VMMDEV_CREDENTIALS_SZ_SIZE];
69 char szDomain[VMMDEV_CREDENTIALS_SZ_SIZE];
70 bool fAllowInteractiveLogon;
71 } Logon;
72
73 /** credentials for verification by guest */
74 struct
75 {
76 char szUserName[VMMDEV_CREDENTIALS_SZ_SIZE];
77 char szPassword[VMMDEV_CREDENTIALS_SZ_SIZE];
78 char szDomain[VMMDEV_CREDENTIALS_SZ_SIZE];
79 } Judge;
80} VMMDEVCREDS;
81
82
83/** device structure containing all state information */
84typedef struct VMMDevState
85{
86 /** The PCI device structure. */
87 PCIDevice dev;
88
89 /** The critical section for this device. */
90 PDMCRITSECT CritSect;
91
92 /** hypervisor address space size */
93 uint32_t hypervisorSize;
94
95 /** mouse capabilities of host and guest */
96 uint32_t mouseCapabilities;
97 /** absolute mouse position in pixels */
98 int32_t mouseXAbs;
99 int32_t mouseYAbs;
100 /** Does the guest currently want the host pointer to be shown? */
101 uint32_t fHostCursorRequested;
102
103 /** Alignment padding. */
104 uint32_t u32Alignment0;
105
106 /** Pointer to device instance. */
107 PPDMDEVINSR3 pDevIns;
108 /** LUN\#0 + Status: VMMDev port base interface. */
109 PDMIBASE IBase;
110 /** LUN\#0: VMMDev port interface. */
111 PDMIVMMDEVPORT IPort;
112#ifdef VBOX_WITH_HGCM
113 /** LUN\#0: HGCM port interface. */
114 PDMIHGCMPORT IHGCMPort;
115#endif
116 /** Pointer to base interface of the driver. */
117 R3PTRTYPE(PPDMIBASE) pDrvBase;
118 /** VMMDev connector interface */
119 R3PTRTYPE(PPDMIVMMDEVCONNECTOR) pDrv;
120#ifdef VBOX_WITH_HGCM
121 /** HGCM connector interface */
122 R3PTRTYPE(PPDMIHGCMCONNECTOR) pHGCMDrv;
123#endif
124 /** Alignment padding. */
125 RTR3PTR PtrR3Alignment1;
126 /** message buffer for backdoor logging. */
127 char szMsg[512];
128 /** message buffer index. */
129 uint32_t iMsg;
130 /** Base port in the assigned I/O space. */
131 RTIOPORT PortBase;
132 /** Alignment padding. */
133 RTIOPORT PortAlignment2;
134
135 /** IRQ number assigned to the device */
136 uint32_t irq;
137 /** Current host side event flags */
138 uint32_t u32HostEventFlags;
139 /** Mask of events guest is interested in. Note that the HGCM events
140 * are enabled automatically by the VMMDev device when guest issues
141 * HGCM commands.
142 */
143 uint32_t u32GuestFilterMask;
144 /** Delayed mask of guest events */
145 uint32_t u32NewGuestFilterMask;
146 /** Flag whether u32NewGuestFilterMask is valid */
147 bool fNewGuestFilterMask;
148 /** Alignment padding. */
149 bool afAlignment3[3];
150
151 /** GC physical address of VMMDev RAM area */
152 RTGCPHYS32 GCPhysVMMDevRAM;
153 /** R3 pointer to VMMDev RAM area */
154 R3PTRTYPE(VMMDevMemory *) pVMMDevRAMR3;
155
156 /** R3 pointer to VMMDev Heap RAM area
157 */
158 R3PTRTYPE(VMMDevMemory *) pVMMDevHeapR3;
159 /** GC physical address of VMMDev Heap RAM area */
160 RTGCPHYS32 GCPhysVMMDevHeap;
161
162 /** Information reported by guest via VMMDevReportGuestInfo generic request.
163 * Until this information is reported the VMMDev refuses any other requests.
164 */
165 VBoxGuestInfo guestInfo;
166 /** Information report \#2, chewed a litte. */
167 struct
168 {
169 uint32_t uFullVersion; /**< non-zero if info is present. */
170 uint32_t uRevision;
171 uint32_t fFeatures;
172 uint32_t uPadding;
173 char szName[128];
174 } guestInfo2;
175
176 /** Information reported by guest via VMMDevReportGuestCapabilities. */
177 uint32_t guestCaps;
178
179 /** "Additions are Ok" indicator, set to true after processing VMMDevReportGuestInfo,
180 * if additions version is compatible. This flag is here to avoid repeated comparing
181 * of the version in guestInfo.
182 */
183 uint32_t fu32AdditionsOk;
184
185 /** Video acceleration status set by guest. */
186 uint32_t u32VideoAccelEnabled;
187
188 DISPLAYCHANGEDATA displayChangeData;
189
190 /** Pointer to the credentials. */
191 R3PTRTYPE(VMMDEVCREDS *) pCredentials;
192
193 bool afAlignment4[HC_ARCH_BITS == 32 ? 3 : 7];
194
195 /* memory balloon change request */
196 uint32_t u32MemoryBalloonSize, u32LastMemoryBalloonSize;
197
198 /* guest ram size */
199 uint64_t cbGuestRAM;
200
201 /* unique session id; the id will be different after each start, reset or restore of the VM. */
202 uint64_t idSession;
203
204 /* statistics interval change request */
205 uint32_t u32StatIntervalSize, u32LastStatIntervalSize;
206
207 /* seamless mode change request */
208 bool fLastSeamlessEnabled, fSeamlessEnabled;
209 bool afAlignment5[1];
210
211 bool fVRDPEnabled;
212 uint32_t u32VRDPExperienceLevel;
213
214#ifdef TIMESYNC_BACKDOOR
215 uint64_t hostTime;
216 bool fTimesyncBackdoorLo;
217 bool afAlignment6[3];
218#endif
219 /** Set if GetHostTime should fail.
220 * Loaded from the GetHostTimeDisabled configuration value. */
221 bool fGetHostTimeDisabled;
222
223 /** Set if backdoor logging should be disabled (output will be ignored then) */
224 bool fBackdoorLogDisabled;
225
226 /** Don't clear credentials */
227 bool fKeepCredentials;
228
229 /** Heap enabled. */
230 bool fHeapEnabled;
231
232 /** Guest Core Dumping enabled. */
233 bool fGuestCoreDumpEnabled;
234
235 /** Guest Core Dump location. */
236 char szGuestCoreDumpDir[RTPATH_MAX];
237
238 /** Number of additional cores to keep around. */
239 uint32_t cGuestCoreDumps;
240
241 bool afAlignment7[1];
242
243#ifdef VBOX_WITH_HGCM
244 /** List of pending HGCM requests, used for saving the HGCM state. */
245 R3PTRTYPE(PVBOXHGCMCMD) pHGCMCmdList;
246 /** Critical section to protect the list. */
247 RTCRITSECT critsectHGCMCmdList;
248 /** Whether the HGCM events are already automatically enabled. */
249 uint32_t u32HGCMEnabled;
250 /** Alignment padding. */
251 uint32_t u32Alignment7;
252#endif /* VBOX_WITH_HGCM */
253
254 /** Status LUN: Shared folders LED */
255 struct
256 {
257 /** The LED. */
258 PDMLED Led;
259 /** The LED ports. */
260 PDMILEDPORTS ILeds;
261 /** Partner of ILeds. */
262 R3PTRTYPE(PPDMILEDCONNECTORS) pLedsConnector;
263 } SharedFolders;
264
265 /** FLag whether CPU hotplug events are monitored */
266 bool fCpuHotPlugEventsEnabled;
267 /** Alignment padding. */
268 bool afPadding8[3];
269 /** CPU hotplug event */
270 VMMDevCpuEventType enmCpuHotPlugEvent;
271 /** Core id of the CPU to change */
272 uint32_t idCpuCore;
273 /** Package id of the CPU to change */
274 uint32_t idCpuPackage;
275
276 uint32_t StatMemBalloonChunks;
277
278 /** Set if RC/R0 is enabled. */
279 bool fRZEnabled;
280 /** Set if testing is enabled. */
281 bool fTestingEnabled;
282 /** Alignment padding. */
283 bool afPadding9[HC_ARCH_BITS == 32 ? 2 : 6];
284#ifndef VBOX_WITHOUT_TESTING_FEATURES
285 /** The high timestamp value. */
286 uint32_t u32TestingHighTimestamp;
287 /** The current testing command (VMMDEV_TESTING_CMD_XXX). */
288 uint32_t u32TestingCmd;
289 /** The testing data offset (command specific). */
290 uint32_t offTestingData;
291 /** For buffering the what comes in over the testing data port. */
292 union
293 {
294 char padding[1024];
295
296 /** VMMDEV_TESTING_CMD_INIT, VMMDEV_TESTING_CMD_SUB_NEW,
297 * VMMDEV_TESTING_CMD_FAILED. */
298 struct
299 {
300 char sz[1024];
301 } String, Init, SubNew, Failed;
302
303 /** VMMDEV_TESTING_CMD_TERM, VMMDEV_TESTING_CMD_SUB_DONE. */
304 struct
305 {
306 uint32_t c;
307 } Error, Term, SubDone;
308
309 /** VMMDEV_TESTING_CMD_VALUE. */
310 struct
311 {
312 RTUINT64U u64Value;
313 uint32_t u32Unit;
314 char szName[1024 - 8 - 4];
315 } Value;
316 } TestingData;
317#endif /* !VBOX_WITHOUT_TESTING_FEATURES */
318} VMMDevState;
319AssertCompileMemberAlignment(VMMDevState, CritSect, 8);
320AssertCompileMemberAlignment(VMMDevState, cbGuestRAM, 8);
321AssertCompileMemberAlignment(VMMDevState, enmCpuHotPlugEvent, 4);
322#ifndef VBOX_WITHOUT_TESTING_FEATURES
323AssertCompileMemberAlignment(VMMDevState, TestingData.Value.u64Value, 8);
324#endif
325
326
327void VMMDevNotifyGuest (VMMDevState *pVMMDevState, uint32_t u32EventMask);
328void VMMDevCtlSetGuestFilterMask (VMMDevState *pVMMDevState,
329 uint32_t u32OrMask,
330 uint32_t u32NotMask);
331
332#endif /* !___VMMDev_VMMDevState_h */
333
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette