Commit f6d81289 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Changes from Pat Gunn at CMU: allow "at swapout" as a valid time for

an event and to actually fire those events during experiment swapout.
parent e6b2931d
...@@ -89,11 +89,13 @@ static pid_t emcd_pid = -1; ...@@ -89,11 +89,13 @@ static pid_t emcd_pid = -1;
static pid_t vmcd_pid = -1; static pid_t vmcd_pid = -1;
static pid_t rmcd_pid = -1; static pid_t rmcd_pid = -1;
static struct agent ns_sequence_agent; static struct agent ns_sequence_agent; /* Used for list of things to do right after swapin */
static timeline_agent_t ns_sequence; static timeline_agent_t ns_sequence;
static struct agent ns_teardown_agent; static struct agent ns_teardown_agent; /* Used during experiment teardown */
static timeline_agent_t ns_teardown; static timeline_agent_t ns_teardown;
static struct agent ns_timeline_agent; static struct agent ns_swapout_agent; /* Used during experiment swapout */
static timeline_agent_t ns_swapout;
static struct agent ns_timeline_agent; /* Used for timeline in the experiment */
static timeline_agent_t ns_timeline; static timeline_agent_t ns_timeline;
static void sigpass(int sig) static void sigpass(int sig)
...@@ -363,6 +365,7 @@ main(int argc, char *argv[]) ...@@ -363,6 +365,7 @@ main(int argc, char *argv[])
fatal("could not register with event system"); fatal("could not register with event system");
} }
/* Make a (not yet populated) list of things to do after initial swapin */
ns_sequence = create_timeline_agent(TA_SEQUENCE); ns_sequence = create_timeline_agent(TA_SEQUENCE);
ns_sequence->ta_local_agent.la_link.ln_Name = ns_sequence_agent.name; ns_sequence->ta_local_agent.la_link.ln_Name = ns_sequence_agent.name;
ns_sequence->ta_local_agent.la_handle = handle; ns_sequence->ta_local_agent.la_handle = handle;
...@@ -376,7 +379,8 @@ main(int argc, char *argv[]) ...@@ -376,7 +379,8 @@ main(int argc, char *argv[])
ns_sequence_agent.handler = &ns_sequence->ta_local_agent; ns_sequence_agent.handler = &ns_sequence->ta_local_agent;
lnAddTail(&sequences, &ns_sequence->ta_local_agent.la_link); lnAddTail(&sequences, &ns_sequence->ta_local_agent.la_link);
lnAddTail(&agents, &ns_sequence_agent.link); lnAddTail(&agents, &ns_sequence_agent.link);
/* Make a (not yet populated) list of things to do during teardown */
ns_teardown = create_timeline_agent(TA_SEQUENCE); ns_teardown = create_timeline_agent(TA_SEQUENCE);
ns_teardown->ta_local_agent.la_link.ln_Name = ns_teardown_agent.name; ns_teardown->ta_local_agent.la_link.ln_Name = ns_teardown_agent.name;
ns_teardown->ta_local_agent.la_handle = handle; ns_teardown->ta_local_agent.la_handle = handle;
...@@ -390,7 +394,23 @@ main(int argc, char *argv[]) ...@@ -390,7 +394,23 @@ main(int argc, char *argv[])
ns_teardown_agent.handler = &ns_teardown->ta_local_agent; ns_teardown_agent.handler = &ns_teardown->ta_local_agent;
lnAddTail(&sequences, &ns_teardown->ta_local_agent.la_link); lnAddTail(&sequences, &ns_teardown->ta_local_agent.la_link);
lnAddTail(&agents, &ns_teardown_agent.link); lnAddTail(&agents, &ns_teardown_agent.link);
/* Make a (not yet populated) list of things to do during swapout, "at swapout" events go into here */
ns_swapout = create_timeline_agent(TA_SEQUENCE);
ns_swapout->ta_local_agent.la_link.ln_Name = ns_swapout_agent.name;
ns_swapout->ta_local_agent.la_handle = handle;
ns_swapout->ta_local_agent.la_agent = &ns_swapout_agent;
ns_swapout_agent.link.ln_Name = ns_swapout_agent.name;
strcpy(ns_swapout_agent.name, "__ns_swapout");
strcpy(ns_swapout_agent.nodeid, "*");
strcpy(ns_swapout_agent.vnode, "*");
strcpy(ns_swapout_agent.objtype, TBDB_OBJECTTYPE_SEQUENCE);
strcpy(ns_swapout_agent.ipaddr, "*");
ns_swapout_agent.handler = &ns_swapout->ta_local_agent;
lnAddTail(&sequences, &ns_swapout->ta_local_agent.la_link);
lnAddTail(&agents, &ns_swapout_agent.link);
/* Make a (not yet populated) timeline for the experiment. "at" events go into here */
ns_timeline = create_timeline_agent(TA_TIMELINE); ns_timeline = create_timeline_agent(TA_TIMELINE);
ns_timeline->ta_local_agent.la_link.ln_Name = ns_timeline_agent.name; ns_timeline->ta_local_agent.la_link.ln_Name = ns_timeline_agent.name;
ns_timeline->ta_local_agent.la_handle = handle; ns_timeline->ta_local_agent.la_handle = handle;
...@@ -904,9 +924,14 @@ dequeue(event_handle_t handle) ...@@ -904,9 +924,14 @@ dequeue(event_handle_t handle)
struct timeval now; struct timeval now;
char time_buf_1[24], time_buf_2[24]; char time_buf_1[24], time_buf_2[24];
// XXX
// info("event-sched.c: in dequeue(), about to enter event loop\n");
// XXX
while (1) { while (1) {
// info("event-sched.c: Event loop loops\n");
if (sched_event_dequeue(&next_event, 1) < 0) if (sched_event_dequeue(&next_event, 1) < 0)
break; break;
// info("event-sched.c: Dequeued another event\n");
/* Fire event. */ /* Fire event. */
if (debug) if (debug)
...@@ -951,6 +976,9 @@ dequeue(event_handle_t handle) ...@@ -951,6 +976,9 @@ dequeue(event_handle_t handle)
sched_event_free(handle, &next_event); sched_event_free(handle, &next_event);
} }
// XXX
// info("event-sched.c: in dequeue(), just left event loop\n");
// XXX
} }
int int
...@@ -1017,7 +1045,8 @@ AddAgent(event_handle_t handle, ...@@ -1017,7 +1045,8 @@ AddAgent(event_handle_t handle,
char *vname, char *vnode, char *nodeid, char *ipaddr, char *type) char *vname, char *vnode, char *nodeid, char *ipaddr, char *type)
{ {
struct agent *agentp; struct agent *agentp;
info("D:\t\tAddAgent asked to add agent %s\n", vname);
if ((agentp = calloc(sizeof(struct agent), 1)) == NULL) { if ((agentp = calloc(sizeof(struct agent), 1)) == NULL) {
error("AddAgent: Out of memory\n"); error("AddAgent: Out of memory\n");
return -1; return -1;
...@@ -1210,7 +1239,7 @@ AddGroup(event_handle_t handle, char *groupname, char *agentname) ...@@ -1210,7 +1239,7 @@ AddGroup(event_handle_t handle, char *groupname, char *agentname)
int int
AddEvent(event_handle_t handle, address_tuple_t tuple, AddEvent(event_handle_t handle, address_tuple_t tuple,
char *exidx, char *ftime, char *objname, char *exargs, char *exidx, char *ftime, char *objname, char *exargs,
char *objtype, char *evttype, char *parent) char *objtype, char *evttype, char *parent, char *triggertype)
{ {
timeline_agent_t ta = NULL; timeline_agent_t ta = NULL;
sched_event_t event; sched_event_t event;
...@@ -1218,6 +1247,7 @@ AddEvent(event_handle_t handle, address_tuple_t tuple, ...@@ -1218,6 +1247,7 @@ AddEvent(event_handle_t handle, address_tuple_t tuple,
struct agent *agentp = NULL; struct agent *agentp = NULL;
struct timeval time; struct timeval time;
info("D: AddEvent asked to add event %s\n", objname);
if (strcmp(objtype, TBDB_OBJECTTYPE_TIME) == 0) { if (strcmp(objtype, TBDB_OBJECTTYPE_TIME) == 0) {
return 0; return 0;
} }
...@@ -1226,8 +1256,16 @@ AddEvent(event_handle_t handle, address_tuple_t tuple, ...@@ -1226,8 +1256,16 @@ AddEvent(event_handle_t handle, address_tuple_t tuple,
error("AddEvent: Could not map event index %s\n", exidx); error("AddEvent: Could not map event index %s\n", exidx);
return -1; return -1;
} }
info("AddEvent called with event of triggertype %s\n", triggertype);
if (parent && strlen(parent) > 0) { if (strcmp(triggertype, "SWAPOUT")==0) { /* If it is of triggertype SWAPOUT,
Divert to the ns_swapout sequence
XXX I am not certain anything else in this function
apart from timeline_agent_append() is needed, but
let's assume it is.
*/
ta = ns_swapout;
}
else if (parent && strlen(parent) > 0) { /* If the event has a parent, we inherit its timeline-agent */
if (((ta = (timeline_agent_t)lnFindName(&timelines, if (((ta = (timeline_agent_t)lnFindName(&timelines,
parent)) == NULL) && parent)) == NULL) &&
((ta = (timeline_agent_t)lnFindName(&sequences, ((ta = (timeline_agent_t)lnFindName(&sequences,
...@@ -1237,7 +1275,7 @@ AddEvent(event_handle_t handle, address_tuple_t tuple, ...@@ -1237,7 +1275,7 @@ AddEvent(event_handle_t handle, address_tuple_t tuple,
} }
} }
else { else {
ta = ns_timeline; ta = ns_timeline; /* It's on the main timeline? */
} }
tuple->host = agentp->ipaddr; tuple->host = agentp->ipaddr;
...@@ -1263,6 +1301,7 @@ AddEvent(event_handle_t handle, address_tuple_t tuple, ...@@ -1263,6 +1301,7 @@ AddEvent(event_handle_t handle, address_tuple_t tuple,
event_notification_insert_hmac(handle, event.notification); event_notification_insert_hmac(handle, event.notification);
/* convert the event into a timeval */
time.tv_sec = (int)firetime; time.tv_sec = (int)firetime;
time.tv_usec = (int)((firetime - (floor(firetime))) * 1000000); time.tv_usec = (int)((firetime - (floor(firetime))) * 1000000);
if (time.tv_usec >= 1000000) { if (time.tv_usec >= 1000000) {
...@@ -1380,6 +1419,9 @@ get_static_events(event_handle_t handle) ...@@ -1380,6 +1419,9 @@ get_static_events(event_handle_t handle)
} }
event.agent.s = primary_simulator_agent->sa_local_agent.la_agent; event.agent.s = primary_simulator_agent->sa_local_agent.la_agent;
// XXX
info("Automatically scheduling the beginning and end of time\n");
// XXX
if (event.agent.s != NULL) { if (event.agent.s != NULL) {
// XXX emulab-ops experiments might not have a simulator agent // XXX emulab-ops experiments might not have a simulator agent
...@@ -1426,6 +1468,28 @@ get_static_events(event_handle_t handle) ...@@ -1426,6 +1468,28 @@ get_static_events(event_handle_t handle)
sched_event_prepare(handle, &event); sched_event_prepare(handle, &event);
timeline_agent_append(ns_teardown, &event); timeline_agent_append(ns_teardown, &event);
/* Log when swapout events have officially started. */
event.notification = event_notification_create(
handle,
EA_Experiment, pideid,
EA_Type, TBDB_OBJECTTYPE_SIMULATOR,
EA_Event, TBDB_EVENTTYPE_LOG,
EA_Name, event.agent.s->name,
EA_Arguments, "Swapout started",
EA_TAG_DONE);
event.time.tv_sec = 0;
event.time.tv_usec = 0;
event.length = 1;
event.flags = SEF_SINGLE_HANDLER;
event_notification_put_int32(handle,
event.notification,
"TOKEN",
next_token);
next_token += 1;
sched_event_prepare(handle, &event);
timeline_agent_append(ns_swapout, &event);
} }
/* /*
...@@ -1485,7 +1549,9 @@ get_static_events(event_handle_t handle) ...@@ -1485,7 +1549,9 @@ get_static_events(event_handle_t handle)
EA_Name, ns_sequence_agent.name, EA_Name, ns_sequence_agent.name,
EA_TAG_DONE); EA_TAG_DONE);
} }
// XXX
// info("Returning from get_static_events()\n");
// XXX
return 0; return 0;
} }
......
...@@ -146,6 +146,9 @@ sched_event_dequeue(sched_event_t *event, int wait) ...@@ -146,6 +146,9 @@ sched_event_dequeue(sched_event_t *event, int wait)
assert(initialized); assert(initialized);
// XXX
// info("queue.c: sched_event_dequeue() called\n");
// XXX
if (event == NULL) { if (event == NULL) {
error("invalid event pointer\n"); error("invalid event pointer\n");
return 0; return 0;
...@@ -173,6 +176,7 @@ sched_event_dequeue(sched_event_t *event, int wait) ...@@ -173,6 +176,7 @@ sched_event_dequeue(sched_event_t *event, int wait)
* woken up early if a new event comes in, so must recheck each * woken up early if a new event comes in, so must recheck each
* time. This allows newer events to sneak in, obviously. * time. This allows newer events to sneak in, obviously.
*/ */
// info("queue.c: sched_event_dequeue(): Waiting for an event\n");
while (1) { while (1) {
struct timespec fireme; struct timespec fireme;
int err; int err;
......
...@@ -181,6 +181,7 @@ RPC_invoke(char *method, ...@@ -181,6 +181,7 @@ RPC_invoke(char *method,
int retval = 0; int retval = 0;
va_list args; va_list args;
ULXR_COUT << "Beginning call to " << method << "\n";
RPC_connect(&rcp); RPC_connect(&rcp);
va_start(args, tag); va_start(args, tag);
...@@ -214,6 +215,7 @@ RPC_invoke(char *method, ...@@ -214,6 +215,7 @@ RPC_invoke(char *method,
RPC_disconnect(&rcp); RPC_disconnect(&rcp);
ULXR_COUT << "Finished with call to " << method << "\n";
return retval; return retval;
} }
...@@ -228,6 +230,7 @@ RPC_invoke(char *pid, char *eid, char *method, emulab::EmulabResponse *er) ...@@ -228,6 +230,7 @@ RPC_invoke(char *pid, char *eid, char *method, emulab::EmulabResponse *er)
assert(method != NULL); assert(method != NULL);
assert(er != NULL); assert(er != NULL);
ULXR_COUT << "Beginning call to " << method << "\n";
RPC_connect(&rcp); RPC_connect(&rcp);
try try
...@@ -261,6 +264,7 @@ RPC_invoke(char *pid, char *eid, char *method, emulab::EmulabResponse *er) ...@@ -261,6 +264,7 @@ RPC_invoke(char *pid, char *eid, char *method, emulab::EmulabResponse *er)
} }
RPC_disconnect(&rcp); RPC_disconnect(&rcp);
ULXR_COUT << "Finished with call to " << method << "\n";
return retval; return retval;
} }
...@@ -591,7 +595,7 @@ RPC_agentlist(event_handle_t handle, char *pid, char *eid) ...@@ -591,7 +595,7 @@ RPC_agentlist(event_handle_t handle, char *pid, char *eid)
ipaddr = (char *) tmp.getString().c_str(); ipaddr = (char *) tmp.getString().c_str();
tmp = agent.getItem(4); tmp = agent.getItem(4);
type = (char *) tmp.getString().c_str(); type = (char *) tmp.getString().c_str();
info("D: adding agent %s\n", vname);
if (AddAgent(handle, vname, vnode, nodeid, ipaddr, type) < 0) { if (AddAgent(handle, vname, vnode, nodeid, ipaddr, type) < 0) {
return -1; return -1;
} }
...@@ -618,8 +622,10 @@ RPC_grouplist(event_handle_t handle, char *pid, char *eid) ...@@ -618,8 +622,10 @@ RPC_grouplist(event_handle_t handle, char *pid, char *eid)
tmp = group.getItem(0); tmp = group.getItem(0);
groupname = (char *) tmp.getString().c_str(); groupname = (char *) tmp.getString().c_str();
info("D: \tIn GroupList() parsed name %s\n", groupname);
tmp = group.getItem(1); tmp = group.getItem(1);
agentname = (char *) tmp.getString().c_str(); agentname = (char *) tmp.getString().c_str();
info("D: \tIn GroupList() parsed agent %s\n", agentname);
if (AddGroup(handle, groupname, agentname) != 0) { if (AddGroup(handle, groupname, agentname) != 0) {
return -1; return -1;
...@@ -631,18 +637,28 @@ RPC_grouplist(event_handle_t handle, char *pid, char *eid) ...@@ -631,18 +637,28 @@ RPC_grouplist(event_handle_t handle, char *pid, char *eid)
int int
RPC_eventlist(char *pid, char *eid, RPC_eventlist(char *pid, char *eid,
event_handle_t handle, address_tuple_t tuple) event_handle_t handle, address_tuple_t tuple)
{ { /* This function requests all the static events from boss using an RPC call, packing them into its
* own data structures. */
emulab::EmulabResponse er; emulab::EmulabResponse er;
int i, foo = RPC_invoke(pid, eid, "experiment.event_eventlist", &er); int i, foo = RPC_invoke(pid, eid, "experiment.event_eventlist", &er);
// XXX
// info("rpc.cc:RPC_eventlist(): Just called RPC_invoke()\n");
// XXX
if (foo) if (foo)
return foo; return foo;
// XXX
// info("rpc.cc:RPC_eventlist(): calling getValue()\n");
// XXX
ulxr::Array events = (ulxr::Array)er.getValue(); ulxr::Array events = (ulxr::Array)er.getValue();
// XXX
// info("rpc.cc:RPC_eventlist(): Interating over invoke results\n");
// XXX
for (i = 0; i < events.size(); i++) { for (i = 0; i < events.size(); i++) {
char *exidx, *extime, *objname, *objtype, *evttype, *exargs; char *exidx, *extime, *objname, *objtype, *evttype, *exargs;
char *parent; char *parent, *triggertype;
ulxr::RpcString tmp; ulxr::RpcString tmp;
ulxr::Array event = (ulxr::Array)events.getItem(i); ulxr::Array event = (ulxr::Array)events.getItem(i);
...@@ -660,10 +676,14 @@ RPC_eventlist(char *pid, char *eid, ...@@ -660,10 +676,14 @@ RPC_eventlist(char *pid, char *eid,
exargs = (char *) tmp.getString().c_str(); exargs = (char *) tmp.getString().c_str();
tmp = event.getItem(6); tmp = event.getItem(6);
parent = (char *) tmp.getString().c_str(); parent = (char *) tmp.getString().c_str();
tmp = event.getItem(7);
triggertype = (char *) tmp.getString().c_str();
// XXX
// info("rpc.cc:RPC_eventlist(): Adding an event\n");
// XXX
if (AddEvent(handle, tuple, exidx, if (AddEvent(handle, tuple, exidx,
extime, objname, exargs, objtype, evttype, extime, objname, exargs, objtype, evttype,
parent) < 0) { parent, triggertype) < 0) {
return -1; return -1;
} }
} }
......
...@@ -86,7 +86,7 @@ extern int AddGroup(event_handle_t handle, char *groupname, char *agentname); ...@@ -86,7 +86,7 @@ extern int AddGroup(event_handle_t handle, char *groupname, char *agentname);
extern int AddEvent(event_handle_t handle, address_tuple_t tuple, extern int AddEvent(event_handle_t handle, address_tuple_t tuple,
char *exidx, char *ftime, char *objname, char *exargs, char *exidx, char *ftime, char *objname, char *exargs,
char *objtype, char *evttype, char *parent); char *objtype, char *evttype, char *parent, char *triggertype);
extern int AddRobot(event_handle_t handle, extern int AddRobot(event_handle_t handle,
struct agent *agent, struct agent *agent,
......
...@@ -233,10 +233,12 @@ int sequence_agent_handle_complete(event_handle_t handle, ...@@ -233,10 +233,12 @@ int sequence_agent_handle_complete(event_handle_t handle,
ag = seq_se->agent.m[0]; ag = seq_se->agent.m[0];
else else
ag = seq_se->agent.s; ag = seq_se->agent.s;
//info("Am I failing here?\n");
event_notification_get_int32(handle, event_notification_get_int32(handle,
seq_se->notification, seq_se->notification,
"TOKEN", "TOKEN",
&token); &token);
//info("End question\n");
} }
if ((ag == NULL) || (ag != agent) || (ctoken != token)) { if ((ag == NULL) || (ag != agent) || (ctoken != token)) {
......
...@@ -576,6 +576,17 @@ CREATE TABLE `event_objecttypes` ( ...@@ -576,6 +576,17 @@ CREATE TABLE `event_objecttypes` (
PRIMARY KEY (`idx`) PRIMARY KEY (`idx`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `event_triggertypes`
--
DROP TABLE IF EXISTS `event_triggertypes`;
CREATE TABLE `event_triggertypes` (
`idx` smallint(5) unsigned NOT NULL,
`type` tinytext NOT NULL,
PRIMARY KEY (`idx`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --
-- Table structure for table `eventlist` -- Table structure for table `eventlist`
-- --
...@@ -591,6 +602,7 @@ CREATE TABLE `eventlist` ( ...@@ -591,6 +602,7 @@ CREATE TABLE `eventlist` (
`vname` varchar(64) NOT NULL default '', `vname` varchar(64) NOT NULL default '',
`objecttype` smallint(5) unsigned NOT NULL default '0', `objecttype` smallint(5) unsigned NOT NULL default '0',
`eventtype` smallint(5) unsigned NOT NULL default '0', `eventtype` smallint(5) unsigned NOT NULL default '0',
`triggertype` smallint(5) unsigned NOT NULL default '0',
`isgroup` tinyint(1) unsigned default '0', `isgroup` tinyint(1) unsigned default '0',
`arguments` text, `arguments` text,
`atstring` text, `atstring` text,
......
...@@ -567,6 +567,8 @@ REPLACE INTO table_regex VALUES ('eventlist','objecttype','int','redirect','defa ...@@ -567,6 +567,8 @@ REPLACE INTO table_regex VALUES ('eventlist','objecttype','int','redirect','defa
REPLACE INTO table_regex VALUES ('eventlist','eventtype','int','redirect','default:tinyint',0,0,NULL); REPLACE INTO table_regex VALUES ('eventlist','eventtype','int','redirect','default:tinyint',0,0,NULL);
REPLACE INTO table_regex VALUES ('eventlist','arguments','text','redirect','default:text',0,1024,NULL); REPLACE INTO table_regex VALUES ('eventlist','arguments','text','redirect','default:text',0,1024,NULL);
REPLACE INTO table_regex VALUES ('eventlist','atstring','text','redirect','default:text',0,1024,NULL); REPLACE INTO table_regex VALUES ('eventlist','atstring','text','redirect','default:text',0,1024,NULL);
REPLACE INTO table_regex VALUES ('eventlist','triggertype','int','redirect','default:tinyint',0,0,NULL);
REPLACE INTO table_regex VALUES ('experiments','eid','text','regex','^[a-zA-Z0-9][-a-zA-Z0-9]+$',2,19,'Must ensure not too long for the database. PID is 12, and the max is 32, so the user is not allowed to specify an EID more than 19, since other parts of the system may concatenate them together with a hyphen'); REPLACE INTO table_regex VALUES ('experiments','eid','text','regex','^[a-zA-Z0-9][-a-zA-Z0-9]+$',2,19,'Must ensure not too long for the database. PID is 12, and the max is 32, so the user is not allowed to specify an EID more than 19, since other parts of the system may concatenate them together with a hyphen');
REPLACE INTO table_regex VALUES ('experiments','eid_idx','text','regex','^[\\d]+$',1,12,NULL); REPLACE INTO table_regex VALUES ('experiments','eid_idx','text','regex','^[\\d]+$',1,12,NULL);
REPLACE INTO table_regex VALUES ('experiments','multiplex_factor','int','redirect','default:tinyint',0,0,NULL); REPLACE INTO table_regex VALUES ('experiments','multiplex_factor','int','redirect','default:tinyint',0,0,NULL);
...@@ -976,6 +978,7 @@ REPLACE INTO table_regex VALUES ('default','tinytext_utf8','text','regex','^(?:[ ...@@ -976,6 +978,7 @@ REPLACE INTO table_regex VALUES ('default','tinytext_utf8','text','regex','^(?:[
REPLACE INTO table_regex VALUES ('default','text_utf8','text','regex','^(?:[\\x20-\\x7E]|[\\xC2-\\xDF][\\x80-\\xBF]|\\xE0[\\xA0-\\xBF][\\x80-\\xBF]|[\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2}|\\xED[\\x80-\\x9F][\\x80-\\xBF])*$',0,65535,'adopted from http://www.w3.org/International/questions/qa-forms-utf-8.en.php'); REPLACE INTO table_regex VALUES ('default','text_utf8','text','regex','^(?:[\\x20-\\x7E]|[\\xC2-\\xDF][\\x80-\\xBF]|\\xE0[\\xA0-\\xBF][\\x80-\\xBF]|[\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2}|\\xED[\\x80-\\x9F][\\x80-\\xBF])*$',0,65535,'adopted from http://www.w3.org/International/questions/qa-forms-utf-8.en.php');
REPLACE INTO table_regex VALUES ('default','fulltext_utf8','text','regex','^(?:[\\x09\\x0A\\x0D\\x20-\\x7E]|[\\xC2-\\xDF][\\x80-\\xBF]|\\xE0[\\xA0-\\xBF][\\x80-\\xBF]|[\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2}|\\xED[\\x80-\\x9F][\\x80-\\xBF])*$',0,65535,'adopted from http://www.w3.org/International/questions/qa-forms-utf-8.en.php'); REPLACE INTO table_regex VALUES ('default','fulltext_utf8','text','regex','^(?:[\\x09\\x0A\\x0D\\x20-\\x7E]|[\\xC2-\\xDF][\\x80-\\xBF]|\\xE0[\\xA0-\\xBF][\\x80-\\xBF]|[\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2}|\\xED[\\x80-\\x9F][\\x80-\\xBF])*$',0,65535,'adopted from http://www.w3.org/International/questions/qa-forms-utf-8.en.php');
-- --
-- Dumping data for table `testsuite_preentables` -- Dumping data for table `testsuite_preentables`
-- --
...@@ -1065,3 +1068,5 @@ REPLACE INTO `emulab_pubs_month_map` VALUES (23,10.5,'Oct-Nov'); ...@@ -1065,3 +1068,5 @@ REPLACE INTO `emulab_pubs_month_map` VALUES (23,10.5,'Oct-Nov');
REPLACE INTO `emulab_pubs_month_map` VALUES (24,11.5,'Nov-Dec'); REPLACE INTO `emulab_pubs_month_map` VALUES (24,11.5,'Nov-Dec');
REPLACE INTO `emulab_pubs_month_map` VALUES (25,12.5,'Dec-Jan'); REPLACE INTO `emulab_pubs_month_map` VALUES (25,12.5,'Dec-Jan');
REPLACE INTO event_triggertypes VALUES(0,'TIMER');
REPLACE INTO event_triggertypes VALUES(2,'SWAPOUT');
#
# CMULab Patches
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (!DBSlotExists("eventlist", "triggertype")) {
DBQueryFatal("ALTER TABLE eventlist ADD COLUMN ".
" `triggertype` smallint(5) unsigned NOT NULL ".
" default '0' after eventtype");
}
DBQueryFatal("REPLACE INTO table_regex VALUES" .
" ('eventlist', 'triggertype', 'int', 'redirect',
'default:tinyint', 0,0,NULL)");
if (!DBTableExists("event_triggertypes")) {
DBQueryFatal("CREATE TABLE `event_triggertypes` (" .
" `idx` smallint(5) unsigned NOT NULL," .
" `type` tinytext NOT NULL," .
" PRIMARY KEY (`idx`)" .
") ENGINE=MyISAM DEFAULT CHARSET=latin1;");
}
DBQueryFatal("REPLACE INTO event_triggertypes VALUES" .
"(0,'TIMER')");
DBQueryFatal("REPLACE INTO event_triggertypes VALUES" .
"(2,'SWAPOUT')");
return 0;
}
1;
...@@ -127,7 +127,11 @@ $EXPDIR = PROJROOT() . "/$pid/exp/$eid"; ...@@ -127,7 +127,11 @@ $EXPDIR = PROJROOT() . "/$pid/exp/$eid";
# Deal with stop and replay. # Deal with stop and replay.
# #
if ($action eq "stop" || $action eq "replay") { if ($action eq "stop" || $action eq "replay") {
if (-e $PIDFILE) { if (-e $PIDFILE) {
# Send any swapout events and wait, at most three seconds, for them to
# complete.
system("$TB/bin/tevc -w -t 3 -e ${pid}/${eid} now __ns_swapout run");
# Send any teardown events and wait, at most five seconds, for them to # Send any teardown events and wait, at most five seconds, for them to
# complete. # complete.
system("$TB/bin/tevc -w -t 5 -e ${pid}/${eid} now __ns_teardown run"); system("$TB/bin/tevc -w -t 5 -e ${pid}/${eid} now __ns_teardown run");
......