~ubuntu-branches/ubuntu/trusty/virtualbox-lts-xenial/trusty-updates

« back to all changes in this revision

Viewing changes to src/VBox/VMM/VMMAll/FTMAll.cpp

  • Committer: Package Import Robot
  • Author(s): Gianfranco Costamagna
  • Date: 2016-02-23 14:28:26 UTC
  • Revision ID: package-import@ubuntu.com-20160223142826-bdu69el2z6wa2a44
Tags: upstream-4.3.36-dfsg
ImportĀ upstreamĀ versionĀ 4.3.36-dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: FTMAll.cpp $ */
 
2
/** @file
 
3
 * FTM - Fault Tolerance Manager - All contexts
 
4
 */
 
5
 
 
6
/*
 
7
 * Copyright (C) 2010-2013 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
 
 
19
/*******************************************************************************
 
20
*   Header Files                                                               *
 
21
*******************************************************************************/
 
22
#define LOG_GROUP LOG_GROUP_FTM
 
23
#include "FTMInternal.h"
 
24
#include <VBox/vmm/vm.h>
 
25
#include <VBox/vmm/vmm.h>
 
26
#include <VBox/err.h>
 
27
#include <VBox/param.h>
 
28
#include <VBox/log.h>
 
29
 
 
30
#include <iprt/assert.h>
 
31
 
 
32
 
 
33
/**
 
34
 * Sets a checkpoint for syncing the state with the standby node
 
35
 *
 
36
 * @returns VBox status code.
 
37
 *
 
38
 * @param   pVM         Pointer to the VM.
 
39
 * @param   enmType     Checkpoint type
 
40
 */
 
41
VMM_INT_DECL(int) FTMSetCheckpoint(PVM pVM, FTMCHECKPOINTTYPE enmType)
 
42
{
 
43
    if (!pVM->fFaultTolerantMaster)
 
44
        return VINF_SUCCESS;
 
45
 
 
46
#ifdef IN_RING3
 
47
    return FTMR3SetCheckpoint(pVM, enmType);
 
48
#else
 
49
    return VMMRZCallRing3(pVM, VMMGetCpu(pVM), VMMCALLRING3_FTM_SET_CHECKPOINT, enmType);
 
50
#endif
 
51
}
 
52
 
 
53
 
 
54
/**
 
55
 * Checks if the delta save/load is enabled
 
56
 *
 
57
 * @returns true/false
 
58
 *
 
59
 * @param   pVM         Pointer to the VM.
 
60
 */
 
61
VMM_INT_DECL(bool) FTMIsDeltaLoadSaveActive(PVM pVM)
 
62
{
 
63
    return pVM->ftm.s.fDeltaLoadSaveActive;
 
64
}
 
65