Commit f0027075 authored by Leigh B Stoller's avatar Leigh B Stoller

Add "bridges" table.

Add failureaction to virt_lan_lans so that we can allow lans to fail
during setup and still continue to swapin.
parent ac5e1755
......@@ -108,6 +108,25 @@ CREATE TABLE `archives` (
PRIMARY KEY (`idx`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `bridges`
--
DROP TABLE IF EXISTS `bridges`;
CREATE TABLE `bridges` (
`pid` varchar(32) default NULL,
`eid` varchar(32) default NULL,
`exptidx` int(11) NOT NULL default '0',
`node_id` varchar(32) NOT NULL default '',
`bridx` mediumint(8) unsigned NOT NULL default '0',
`iface` varchar(8) NOT NULL default '',
`vname` varchar(32) NOT NULL default '',
`vnode` varchar(32) default NULL,
PRIMARY KEY (`node_id`,`bridx`,`iface`),
KEY `pid` (`pid`,`eid`),
KEY `exptidx` (`exptidx`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `buildings`
--
......@@ -3761,6 +3780,7 @@ CREATE TABLE `virt_lan_lans` (
`exptidx` int(11) NOT NULL default '0',
`idx` int(11) NOT NULL auto_increment,
`vname` varchar(32) NOT NULL default '',
`failureaction` enum('fatal','nonfatal') NOT NULL default 'fatal',
PRIMARY KEY (`exptidx`,`idx`),
UNIQUE KEY `vname` (`pid`,`eid`,`vname`),
UNIQUE KEY `idx` (`pid`,`eid`,`idx`)
......
......@@ -816,6 +816,7 @@ REPLACE INTO table_regex VALUES ('event_groups','agent_name','text','redirect','
REPLACE INTO table_regex VALUES ('virt_lan_lans','pid','text','redirect','projects:pid',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_lan_lans','eid','text','redirect','experiments:eid',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_lan_lans','vname','text','redirect','virt_nodes:vname',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_lan_lans','failureaction','text','regex','^(fatal|nonfatal)$',0,0,NULL);
REPLACE INTO table_regex VALUES ('firewall_rules','pid','text','redirect','projects:pid',0,0,NULL);
REPLACE INTO table_regex VALUES ('firewall_rules','eid','text','redirect','experimenets:eid',0,0,NULL);
REPLACE INTO table_regex VALUES ('firewall_rules','fwname','text','redirect','virt_nodes:vname',0,0,NULL);
......
#
# Add bridges table and failureaction to virt_lans.
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (!DBTableExists("bridges")) {
DBQueryFatal("CREATE TABLE `bridges` ( ".
" `pid` varchar(32) default NULL, ".
" `eid` varchar(32) default NULL, ".
" `exptidx` int(11) NOT NULL default '0', ".
" `node_id` varchar(32) NOT NULL default '', ".
" `bridx` mediumint(8) unsigned NOT NULL default '0', ".
" `iface` varchar(8) NOT NULL default '', ".
" `vname` varchar(32) NOT NULL default '', ".
" `vnode` varchar(32) default NULL, ".
" PRIMARY KEY (`node_id`,`bridx`,`iface`), ".
" KEY `pid` (`pid`,`eid`), ".
" KEY `exptidx` (`exptidx`) ".
") ENGINE=MyISAM DEFAULT CHARSET=latin1");
}
if (!DBSlotExists("virt_lan_lans", "failureaction")) {
DBQueryFatal("alter table virt_lan_lans add `failureaction` ".
" enum('fatal','nonfatal') NOT NULL default 'fatal'");
}
DBQueryFatal("replace into table_regex values ".
"('virt_lan_lans','failureaction','text','regex', ".
" '^(fatal|nonfatal)\$',0,0,NULL)");
return 0;
}
1;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment