1 | /* $Id: FTMInternal.h 31833 2010-08-21 00:12:28Z 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.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 ___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 |
|
---|
27 | /** @defgroup grp_ftm_int Internals.
|
---|
28 | * @ingroup grp_ftm
|
---|
29 | * @{
|
---|
30 | */
|
---|
31 |
|
---|
32 |
|
---|
33 | /**
|
---|
34 | * FTM VM Instance data.
|
---|
35 | * Changes to this must checked against the padding of the ftm union in VM!
|
---|
36 | */
|
---|
37 | typedef struct FTM
|
---|
38 | {
|
---|
39 | /** Address of the standby VM. */
|
---|
40 | R3PTRTYPE(char *) pszAddress;
|
---|
41 | /** Password to access the syncing server of the standby VM. */
|
---|
42 | R3PTRTYPE(char *) pszPassword;
|
---|
43 | /** Port of the standby VM. */
|
---|
44 | unsigned uPort;
|
---|
45 | /** Syncing interval in ms. */
|
---|
46 | unsigned uInterval;
|
---|
47 |
|
---|
48 | /** Set when this VM is the standby FT node. */
|
---|
49 | bool fIsStandbyNode;
|
---|
50 | /** Set when this master VM is busy with checkpointing. */
|
---|
51 | bool fCheckpointingActive;
|
---|
52 | bool fAlignment[6];
|
---|
53 |
|
---|
54 | /** Current active socket. */
|
---|
55 | RTSOCKET hSocket;
|
---|
56 | #if HC_ARCH_BITS == 32
|
---|
57 | RTSOCKET hSocketAlignment; /**< Alignment padding. */
|
---|
58 | #endif
|
---|
59 |
|
---|
60 | /** State sync. */
|
---|
61 | struct
|
---|
62 | {
|
---|
63 | unsigned uOffStream;
|
---|
64 | unsigned cbReadBlock;
|
---|
65 | bool fStopReading;
|
---|
66 | bool fIOError;
|
---|
67 | bool fEndOfStream;
|
---|
68 | bool fAlignment[5];
|
---|
69 | } syncstate;
|
---|
70 |
|
---|
71 | struct
|
---|
72 | {
|
---|
73 | R3PTRTYPE(PRTTCPSERVER) hServer;
|
---|
74 | } standby;
|
---|
75 |
|
---|
76 | struct
|
---|
77 | {
|
---|
78 | RTSEMEVENT hShutdownEvent;
|
---|
79 | } master;
|
---|
80 |
|
---|
81 | /** FTM critical section.
|
---|
82 | * This makes sure only the checkpoint or sync is active
|
---|
83 | */
|
---|
84 | PDMCRITSECT CritSect;
|
---|
85 |
|
---|
86 | STAMCOUNTER StatReceivedMem;
|
---|
87 | STAMCOUNTER StatReceivedState;
|
---|
88 | STAMCOUNTER StatSentMem;
|
---|
89 | STAMCOUNTER StatSentState;
|
---|
90 | } FTM;
|
---|
91 | AssertCompileMemberAlignment(FTM, CritSect, 8);
|
---|
92 |
|
---|
93 | /** @} */
|
---|
94 |
|
---|
95 | #endif
|
---|