1 | /* $Id: FTMInternal.h 32268 2010-09-07 09:40:47Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * FTM - Internal header file.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2010 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.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 ___FTMInternal_h
|
---|
19 | #define ___FTMInternal_h
|
---|
20 |
|
---|
21 | #include <VBox/cdefs.h>
|
---|
22 | #include <VBox/types.h>
|
---|
23 | #include <VBox/ftm.h>
|
---|
24 | #include <VBox/stam.h>
|
---|
25 | #include <VBox/pdmcritsect.h>
|
---|
26 | #include <iprt/avl.h>
|
---|
27 |
|
---|
28 | /** @defgroup grp_ftm_int Internals.
|
---|
29 | * @ingroup grp_ftm
|
---|
30 | * @{
|
---|
31 | */
|
---|
32 |
|
---|
33 | /** Physical page tree node. */
|
---|
34 | typedef struct FTMPHYSPAGETREENODE
|
---|
35 | {
|
---|
36 | AVLOGCPHYSNODECORE Core;
|
---|
37 | void *pPage;
|
---|
38 | } FTMPHYSPAGETREENODE;
|
---|
39 | /** Pointer to FTMPHYSPAGETREENODE */
|
---|
40 | typedef FTMPHYSPAGETREENODE *PFTMPHYSPAGETREENODE;
|
---|
41 |
|
---|
42 | /**
|
---|
43 | * FTM VM Instance data.
|
---|
44 | * Changes to this must checked against the padding of the ftm union in VM!
|
---|
45 | */
|
---|
46 | typedef struct FTM
|
---|
47 | {
|
---|
48 | /** Address of the standby VM. */
|
---|
49 | R3PTRTYPE(char *) pszAddress;
|
---|
50 | /** Password to access the syncing server of the standby VM. */
|
---|
51 | R3PTRTYPE(char *) pszPassword;
|
---|
52 | /** Port of the standby VM. */
|
---|
53 | unsigned uPort;
|
---|
54 | /** Syncing interval in ms. */
|
---|
55 | unsigned uInterval;
|
---|
56 |
|
---|
57 | /** Set when this VM is the standby FT node. */
|
---|
58 | bool fIsStandbyNode;
|
---|
59 | /** Set when this master VM is busy with checkpointing. */
|
---|
60 | bool fCheckpointingActive;
|
---|
61 | /** Set when VM save/restore should only include changed pages. */
|
---|
62 | bool fDeltaLoadSaveActive;
|
---|
63 | bool fAlignment[5];
|
---|
64 |
|
---|
65 | /** Current active socket. */
|
---|
66 | RTSOCKET hSocket;
|
---|
67 | #if HC_ARCH_BITS == 32
|
---|
68 | RTSOCKET hSocketAlignment; /**< Alignment padding. */
|
---|
69 | #endif
|
---|
70 |
|
---|
71 | /** State sync. */
|
---|
72 | struct
|
---|
73 | {
|
---|
74 | unsigned uOffStream;
|
---|
75 | unsigned cbReadBlock;
|
---|
76 | bool fStopReading;
|
---|
77 | bool fIOError;
|
---|
78 | bool fEndOfStream;
|
---|
79 | bool fAlignment[5];
|
---|
80 | } syncstate;
|
---|
81 |
|
---|
82 | struct
|
---|
83 | {
|
---|
84 | R3PTRTYPE(PRTTCPSERVER) hServer;
|
---|
85 | PPAVLOGCPHYSNODECORE ppPhysPageTree;
|
---|
86 | } standby;
|
---|
87 |
|
---|
88 | struct
|
---|
89 | {
|
---|
90 | RTSEMEVENT hShutdownEvent;
|
---|
91 | } master;
|
---|
92 |
|
---|
93 | /** FTM critical section.
|
---|
94 | * This makes sure only the checkpoint or sync is active
|
---|
95 | */
|
---|
96 | PDMCRITSECT CritSect;
|
---|
97 |
|
---|
98 | STAMCOUNTER StatReceivedMem;
|
---|
99 | STAMCOUNTER StatReceivedState;
|
---|
100 | STAMCOUNTER StatSentMem;
|
---|
101 | STAMCOUNTER StatSentState;
|
---|
102 | STAMCOUNTER StatDeltaMem;
|
---|
103 | STAMCOUNTER StatDeltaVM;
|
---|
104 | STAMCOUNTER StatFullSync;
|
---|
105 | STAMCOUNTER StatCheckpointNetwork;
|
---|
106 | STAMCOUNTER StatCheckpointStorage;
|
---|
107 | STAMPROFILE StatCheckpoint;
|
---|
108 | } FTM;
|
---|
109 | AssertCompileMemberAlignment(FTM, CritSect, 8);
|
---|
110 |
|
---|
111 | /** @} */
|
---|
112 |
|
---|
113 | #endif
|
---|