Commit e47cf26a authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Some Protogeni additions.

* Add external resource identifiers to the reserved table so we can
  figure out the external node that is mapped onto the local (proxy)
  node.

* Change limit on fixed_iface to 128 chars to accomodate urns.
parent 016b8531
......@@ -3046,6 +3046,8 @@ CREATE TABLE `reserved` (
`plab_boot` tinyint(1) default '0',
`mustwipe` tinyint(4) NOT NULL default '0',
`genisliver_idx` int(10) unsigned default NULL,
`external_resource_index` int(10) unsigned default NULL,
`external_resource_id` tinytext,
`tmcd_redirect` tinytext,
`sharing_mode` varchar(32) default NULL,
PRIMARY KEY (`node_id`),
......@@ -3729,7 +3731,7 @@ CREATE TABLE `virt_lans` (
`trace_snaplen` int(11) NOT NULL default '0',
`trace_endnode` tinyint(1) NOT NULL default '0',
`trace_db` tinyint(1) NOT NULL default '0',
`fixed_iface` varchar(16) default '',
`fixed_iface` varchar(128) default '',
PRIMARY KEY (`exptidx`,`vname`,`vnode`,`vport`),
UNIQUE KEY `vport` (`pid`,`eid`,`vname`,`vnode`,`vport`),
KEY `pid` (`pid`,`eid`,`vname`),
......
......@@ -669,7 +669,7 @@ REPLACE INTO table_regex VALUES ('virt_lans','trace_expr','text','redirect','def
REPLACE INTO table_regex VALUES ('virt_lans','trace_snaplen','int','redirect','default:int',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_lans','trace_endnode','int','redirect','default:tinyint',0,1,NULL);
REPLACE INTO table_regex VALUES ('virt_lans','trace_db','int','redirect','default:tinyint',0,1,NULL);
REPLACE INTO table_regex VALUES ('virt_lans','fixed_iface','text','redirect','default:tinytext',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_lans','fixed_iface','text','redirect','default:tinytext',0,128,NULL);
REPLACE INTO table_regex VALUES ('virt_lans','modbase','int','redirect','default:boolean',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_lans','compat','int','redirect','default:boolean',0,0,NULL);
......@@ -691,7 +691,7 @@ REPLACE INTO table_regex VALUES ('virt_nodes','vname','text','regex','^[-\\w]+$'
REPLACE INTO table_regex VALUES ('virt_nodes','type','text','regex','^[-\\w]*$',0,30,NULL);
REPLACE INTO table_regex VALUES ('virt_nodes','failureaction','text','regex','^(fatal|nonfatal|ignore)$',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_nodes','routertype','text','regex','^(none|ospf|static|manual|static-ddijk|static-old)$',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_nodes','fixed','text','regex','^[-\\w]*$',0,32,NULL);
REPLACE INTO table_regex VALUES ('virt_nodes','fixed','text','redirect','default:tinytext',0,128,NULL);
REPLACE INTO table_regex VALUES ('virt_nodes','sharing_mode','text','regex','^[-\\w]+$',1,32,NULL);
REPLACE INTO table_regex VALUES ('virt_programs','pid','text','redirect','projects:pid',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_programs','eid','text','redirect','experiments:eid',0,0,NULL);
......
#
# Add extenal references slots to nodes table, as for geni.
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (!DBSlotExists("reserved", "external_resource_index")) {
DBQueryFatal("alter table reserved add ".
"external_resource_index int(10) unsigned default NULL ".
"after genisliver_idx");
}
if (!DBSlotExists("reserved", "external_resource_id")) {
DBQueryFatal("alter table reserved add ".
"external_resource_id tinytext ".
"after external_resource_index");
}
DBQueryFatal("alter table virt_lans change `fixed_iface` `fixed_iface` ".
"varchar(128) default ''");
DBQueryFatal("REPLACE INTO table_regex VALUES ".
"('virt_nodes','fixed','text','redirect', ".
" 'default:tinytext',0,128,NULL)");
DBQueryFatal("REPLACE INTO table_regex VALUES ".
"('virt_lans','fixed_iface','text','redirect', ".
" 'default:tinytext',0,128,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