Commit d09d9696 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Add new per-lan table, which currently is just for Mike:

1.269: Add new table to generate a per virt_lan index for use with
       veth vlan tags. This would be so much easier if the virt_lans
       table had been split into virt_lans and virt_lan_members.
       Anyway, this table might someday become the per-lan table, with a
       table of member settings. This would reduce the incredible amount of
       duplicate info in virt_lans!

	CREATE TABLE virt_lan_lans (
	  pid varchar(12) NOT NULL default '',
	  eid varchar(32) NOT NULL default '',
	  idx int(11) NOT NULL auto_increment,
	  vname varchar(32) NOT NULL default '',
	  PRIMARY KEY  (pid,eid,idx),
	  UNIQUE KEY vname (pid,eid,vname)
	) TYPE=MyISAM;

       This arrangement will provide a unique index per virt_lan, within
       each pid,eid. That is, it starts from 1 for each pid,eid. That is
       necessary since the limit is 16 bits, so a global index would
       quickly overflow. The above table is populated with:

	insert into virt_lan_lans (pid, eid, vname)
            select distinct pid,eid,vname from virt_lans;
parent b06b1775
......@@ -2765,6 +2765,7 @@ sub TBGetSiteVar($;$)
#
@virtualTables = ("virt_nodes",
"virt_lans",
"virt_lan_lans",
"virt_lan_settings",
"virt_lan_member_settings",
"virt_trafgens",
......
......@@ -64,6 +64,10 @@ my %virtual_tables =
row => "node",
attrs => [ "vname" ]},
"virt_lans" => { rows => undef,
tag => "lan_members",
row => "lan_member",
attrs => [ "vname" ]},
"virt_lan_lans" => { rows => undef,
tag => "lans",
row => "lan",
attrs => [ "vname" ]},
......
......@@ -1660,6 +1660,19 @@ CREATE TABLE virt_agents (
PRIMARY KEY (pid,eid,vname,vnode)
) TYPE=MyISAM;
--
-- Table structure for table `virt_lan_lans`
--
CREATE TABLE virt_lan_lans (
pid varchar(12) NOT NULL default '',
eid varchar(32) NOT NULL default '',
idx int(11) NOT NULL auto_increment,
vname varchar(32) NOT NULL default '',
PRIMARY KEY (pid,eid,idx),
UNIQUE KEY vname (pid,eid,vname)
) TYPE=MyISAM;
--
-- Table structure for table `virt_lan_member_settings`
--
......@@ -1687,6 +1700,7 @@ CREATE TABLE virt_lan_settings (
PRIMARY KEY (pid,eid,vname,capkey)
) TYPE=MyISAM;
--
-- Table structure for table `virt_lans`
--
......
......@@ -507,6 +507,9 @@ REPLACE INTO table_regex VALUES ('virt_agents','eid','text','redirect','experime
REPLACE INTO table_regex VALUES ('virt_agents','vname','text','redirect','eventlist:vname',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_agents','vnode','text','regex','(^[-\\w]+$)|(^\\*{1}$)',1,32,NULL);
REPLACE INTO table_regex VALUES ('virt_agents','objecttype','int','redirect','default:tinyint',0,0,NULL);
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_lans','pid','text','redirect','projects:pid',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_lans','eid','text','redirect','experiments:eid',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_lans','vname','text','redirect','virt_nodes:vname',0,0,NULL);
......
......@@ -1817,3 +1817,28 @@ last_net_act,last_cpu_act,last_ext_act);
Then run:
./mustdelay.pl
1.269: Add new table to generate a per virt_lan index for use with
veth vlan tags. This would be so much easier if the virt_lans
table had been split into virt_lans and virt_lan_members.
Anyway, this table might someday become the per-lan table, with a
table of member settings. This would reduce the incredible amount of
duplicate info in virt_lans!
CREATE TABLE virt_lan_lans (
pid varchar(12) NOT NULL default '',
eid varchar(32) NOT NULL default '',
idx int(11) NOT NULL auto_increment,
vname varchar(32) NOT NULL default '',
PRIMARY KEY (pid,eid,idx),
UNIQUE KEY vname (pid,eid,vname)
) TYPE=MyISAM;
This arrangement will provide a unique index per virt_lan, within
each pid,eid. That is, it starts from 1 for each pid,eid. That is
necessary since the limit is 16 bits, so a global index would
quickly overflow. The above table is populated with:
insert into virt_lan_lans (pid, eid, vname)
select distinct pid,eid,vname from virt_lans;
......@@ -565,6 +565,8 @@ Link instproc updatedb {DB} {
return
}
$sim spitxml_data "virt_lan_lans" [list "vname"] [list $self]
foreach nodeport $nodelist {
set node [lindex $nodeport 0]
if {$node == $src_node} {
......@@ -680,6 +682,8 @@ Lan instproc updatedb {DB} {
return
}
$sim spitxml_data "virt_lan_lans" [list "vname"] [list $self]
#
# Upload lan settings and them per-member settings
#
......
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