Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
359118f0
Commit
359118f0
authored
May 25, 2006
by
Leigh B. Stoller
Browse files
A couple of little tweaks to allow template run to fire off a snapshot
of the logs to the archive.
parent
5e8863b9
Changes
2
Hide whitespace changes
Inline
Side-by-side
event/sched/event-sched.c
View file @
359118f0
...
...
@@ -546,6 +546,7 @@ int sends_complete(struct agent *agent, const char *evtype)
static
char
*
simulator_completes
[]
=
{
TBDB_EVENTTYPE_REPORT
,
TBDB_EVENTTYPE_MODIFY
,
TBDB_EVENTTYPE_SNAPSHOT
,
NULL
};
...
...
event/sched/simulator-agent.cc
View file @
359118f0
...
...
@@ -381,6 +381,26 @@ static int do_reset(simulator_agent_t sa, char *args)
return
retval
;
}
static
int
do_snapshot
(
simulator_agent_t
sa
,
char
*
args
)
{
char
*
loghole_args
;
int
retval
=
0
;
assert
(
sa
!=
NULL
);
assert
(
args
!=
NULL
);
if
(
event_arg_get
(
args
,
"LOGHOLE_ARGS"
,
&
loghole_args
)
<=
0
)
{
loghole_args
=
""
;
}
if
(
systemf
(
"loghole --port=%d sync %s"
,
DEFAULT_RPC_PORT
,
loghole_args
)
!=
0
)
{
error
(
"failed to sync log holes
\n
"
);
}
return
retval
;
}
static
int
strreltime
(
char
*
buf
,
size_t
buflen
,
time_t
secs
)
{
int
hours
,
mins
,
retval
=
0
;
...
...
@@ -503,12 +523,16 @@ static void *simulator_agent_looper(void *arg)
else
if
(
strcmp
(
evtype
,
TBDB_EVENTTYPE_RESET
)
==
0
)
{
do_reset
(
sa
,
argsbuf
);
}
else
if
(
strcmp
(
evtype
,
TBDB_EVENTTYPE_SNAPSHOT
)
==
0
){
do_snapshot
(
sa
,
argsbuf
);
}
else
{
error
(
"cannot handle SIMULATOR event %s."
,
evtype
);
}
if
(
strcmp
(
evtype
,
TBDB_EVENTTYPE_RESET
)
==
0
||
strcmp
(
evtype
,
TBDB_EVENTTYPE_REPORT
)
==
0
||
strcmp
(
evtype
,
TBDB_EVENTTYPE_SNAPSHOT
)
==
0
||
strcmp
(
evtype
,
TBDB_EVENTTYPE_MODIFY
)
==
0
)
{
event_do
(
handle
,
EA_Experiment
,
pideid
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment