Commit 217e878d authored by Leigh Stoller's avatar Leigh Stoller

Add new DB slot (nfsmounts) to experiments,nodes,virt_nodes for expressing

a (slightly) larger selection of NFS mount options, then just yes/no.
parent 933ecb5c
......@@ -1766,6 +1766,7 @@ CREATE TABLE `experiments` (
`nonlocal_user_id` varchar(128) default NULL,
`nonlocal_type` tinytext,
`nonfsmounts` tinyint(1) NOT NULL default '0',
`nfsmounts` enum('emulabdefault','genidefault','all','none') NOT NULL default 'emulabdefault',
PRIMARY KEY (`idx`),
UNIQUE KEY `pideid` (`pid`,`eid`),
UNIQUE KEY `pididxeid` (`pid_idx`,`eid`),
......@@ -3336,6 +3337,7 @@ CREATE TABLE `nodes` (
`uuid` varchar(40) NOT NULL default '',
`reserved_memory` int(10) unsigned default '0',
`nonfsmounts` tinyint(1) NOT NULL default '0',
`nfsmounts` enum('emulabdefault','genidefault','all','none') default NULL,
`taint_states` set('useronly','blackbox','dangerous') default NULL,
PRIMARY KEY (`node_id`),
KEY `phys_nodeid` (`phys_nodeid`),
......@@ -5478,6 +5480,7 @@ CREATE TABLE `virt_nodes` (
`role` enum('node','bridge') NOT NULL default 'node',
`firewall_style` tinytext,
`firewall_log` tinytext,
`nfsmounts` enum('emulabdefault','genidefault','all','none') default NULL,
PRIMARY KEY (`exptidx`,`vname`),
UNIQUE KEY `pideid` (`pid`,`eid`,`vname`),
KEY `pid` (`pid`,`eid`,`vname`)
......
......@@ -936,6 +936,7 @@ REPLACE INTO table_regex VALUES ('virt_nodes','fixed','text','redirect','default
REPLACE INTO table_regex VALUES ('virt_nodes','sharing_mode','text','regex','^[-\\w]+$',1,32,NULL);
REPLACE INTO table_regex VALUES ('virt_nodes','osname','text','regex','^((([-\\w]+\\/{0,1})[-\\w\\.+]+(:\\d+){0,1})|((http|https|ftp)\\:\\/\\/[-\\w\\.\\/\\@\\:\\~\\?\\=\\&]*))$',2,128,NULL);
REPLACE INTO table_regex VALUES ('virt_nodes','parent_osname','text','redirect','virt_nodes:osname',2,128,NULL);
REPLACE INTO table_regex VALUES ('virt_nodes','nfsmounts','text','redirect','experiments:nfsmounts',0,0,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);
REPLACE INTO table_regex VALUES ('virt_programs','vnode','text','redirect','virt_nodes:vname',0,0,NULL);
......@@ -983,6 +984,7 @@ REPLACE INTO table_regex VALUES ('experiments','ipassign_args','text','regex','^
REPLACE INTO table_regex VALUES ('experiments','expt_name','text','redirect','default:fulltext',1,255,NULL);
REPLACE INTO table_regex VALUES ('experiments','dpdb','int','redirect','default:tinyint',0,1,NULL);
REPLACE INTO table_regex VALUES ('experiments','nonfsmounts','int','redirect','default:tinyint',0,1,NULL);
REPLACE INTO table_regex VALUES ('experiments','nfsmounts','text','regex','^(emulabdefault|genidefault|all|none)$',0,0,NULL);
REPLACE INTO table_regex VALUES ('experiments','packing_strategy','text','regex','^(pack|balance)$',0,0,NULL);
REPLACE INTO table_regex VALUES ('experiments','description','text','redirect','default:fulltext',1,256,NULL);
......
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (!DBSlotExists("experiments", "nfsmounts")) {
DBQueryFatal("alter table experiments add ".
" `nfsmounts` enum('emulabdefault','genidefault', ".
" 'all','none') NOT NULL default 'emulabdefault' ".
" after nonfsmounts");
}
if (!DBSlotExists("nodes", "nfsmounts")) {
DBQueryFatal("alter table nodes add ".
" `nfsmounts` enum('emulabdefault','genidefault', ".
" 'all','none') default NULL ".
" after nonfsmounts");
}
if (!DBSlotExists("virt_nodes", "nfsmounts")) {
DBQueryFatal("alter table virt_nodes add ".
" `nfsmounts` enum('emulabdefault','genidefault', ".
" 'all','none') default NULL ");
}
DBQueryFatal("update experiments set nfsmounts='genidefault' ".
"where geniflags!=0");
DBQueryFatal("update experiments set nfsmounts='none' ".
"where nonfsmounts=1");
DBQueryFatal("update nodes set nfsmounts='none' ".
"where nonfsmounts=1");
DBQueryFatal("replace into table_regex VALUES ".
" ('experiments','nfsmounts','text','regex', ".
" '^(emulabdefault|genidefault|all|none)\$',0,0,NULL)");
DBQueryFatal("replace into table_regex VALUES ".
" ('virt_nodes','nfsmounts','text','redirect', ".
" 'experiments:nfsmounts',0,0,NULL)");
return 0;
}
# Local Variables:
# mode:perl
# End:
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