/* $Id: FTMInternal.h 31895 2010-08-24 09:00:14Z vboxsync $ */ /** @file * FTM - Internal header file. */ /* * Copyright (C) 2010 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; * you can redistribute it and/or modify it under the terms of the GNU * General Public License (GPL) as published by the Free Software * Foundation, in version 2 as it comes in the "COPYING" file of the * VirtualBox OSE distribution. VirtualBox OSE is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. */ #ifndef ___FTMInternal_h #define ___FTMInternal_h #include #include #include #include #include /** @defgroup grp_ftm_int Internals. * @ingroup grp_ftm * @{ */ typedef enum { /* Sync the changed memory pages. */ FTMSYNCSTATE_DELTA_MEMORY, /* Sync the changed state (memory + vm/device internal state) */ FTMSYNCSTATE_DELTA_VM, /* Sync the entire VM state. */ FTMSYNCSTATE_FULL } FTMSYNCSTATE; /** * FTM VM Instance data. * Changes to this must checked against the padding of the ftm union in VM! */ typedef struct FTM { /** Address of the standby VM. */ R3PTRTYPE(char *) pszAddress; /** Password to access the syncing server of the standby VM. */ R3PTRTYPE(char *) pszPassword; /** Port of the standby VM. */ unsigned uPort; /** Syncing interval in ms. */ unsigned uInterval; /** Set when this VM is the standby FT node. */ bool fIsStandbyNode; /** Set when this master VM is busy with checkpointing. */ bool fCheckpointingActive; bool fAlignment[6]; /** Current active socket. */ RTSOCKET hSocket; #if HC_ARCH_BITS == 32 RTSOCKET hSocketAlignment; /**< Alignment padding. */ #endif /** State sync. */ struct { unsigned uOffStream; unsigned cbReadBlock; bool fStopReading; bool fIOError; bool fEndOfStream; bool fAlignment[5]; } syncstate; struct { R3PTRTYPE(PRTTCPSERVER) hServer; } standby; struct { RTSEMEVENT hShutdownEvent; } master; /** FTM critical section. * This makes sure only the checkpoint or sync is active */ PDMCRITSECT CritSect; STAMCOUNTER StatReceivedMem; STAMCOUNTER StatReceivedState; STAMCOUNTER StatSentMem; STAMCOUNTER StatSentState; } FTM; AssertCompileMemberAlignment(FTM, CritSect, 8); /** @} */ #endif