~ubuntu-branches/ubuntu/utopic/xen/utopic

« back to all changes in this revision

Viewing changes to tools/python/xen/lowlevel/checkpoint/checkpoint.h

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Blank
  • Date: 2010-05-06 15:47:38 UTC
  • mto: (1.3.1) (15.1.1 sid) (4.1.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20100506154738-agoz0rlafrh1fnq7
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* API for checkpointing */
 
2
 
 
3
#ifndef _CHECKPOINT_H_
 
4
#define _CHECKPOINT_H_ 1
 
5
 
 
6
#include <pthread.h>
 
7
#include <semaphore.h>
 
8
#include <time.h>
 
9
 
 
10
#include <xenguest.h>
 
11
#include <xs.h>
 
12
 
 
13
typedef enum {
 
14
    dt_unknown,
 
15
    dt_pv,
 
16
    dt_hvm,
 
17
    dt_pvhvm /* HVM with PV drivers */
 
18
} checkpoint_domtype;
 
19
 
 
20
typedef struct {
 
21
    int xch;               /* xc handle */
 
22
    int xce;               /* event channel handle */
 
23
    struct xs_handle* xsh; /* xenstore handle */
 
24
    int watching_shutdown; /* state of watch on @releaseDomain */
 
25
 
 
26
    unsigned int domid;
 
27
    checkpoint_domtype domtype;
 
28
    int fd;
 
29
 
 
30
    int suspend_evtchn;
 
31
 
 
32
    char* errstr;
 
33
 
 
34
    /* suspend deadline thread support */
 
35
    volatile int suspended;
 
36
    volatile int done;
 
37
    pthread_t suspend_thr;
 
38
    sem_t suspended_sem;
 
39
    sem_t resumed_sem;
 
40
    timer_t timer;
 
41
} checkpoint_state;
 
42
 
 
43
char* checkpoint_error(checkpoint_state* s);
 
44
 
 
45
void checkpoint_init(checkpoint_state* s);
 
46
int checkpoint_open(checkpoint_state* s, unsigned int domid);
 
47
void checkpoint_close(checkpoint_state* s);
 
48
int checkpoint_start(checkpoint_state* s, int fd,
 
49
                    struct save_callbacks* callbacks);
 
50
int checkpoint_suspend(checkpoint_state* s);
 
51
int checkpoint_resume(checkpoint_state* s);
 
52
int checkpoint_postflush(checkpoint_state* s);
 
53
 
 
54
int checkpoint_settimer(checkpoint_state* s, int millis);
 
55
int checkpoint_wait(checkpoint_state* s);
 
56
void block_timer(void);
 
57
void unblock_timer(void);
 
58
 
 
59
#endif