Commit f456c91f authored by Robert Ricci's avatar Robert Ricci
Browse files

Revert my last set of checkins.

This is ridiculously hard to do with CVS.
parent f0d489e8
...@@ -2465,9 +2465,8 @@ foreach my $vnode (keys(%v2pmap)) { ...@@ -2465,9 +2465,8 @@ foreach my $vnode (keys(%v2pmap)) {
printdb("sshdport: $vnode $pnode $vvnode $sshdport\n"); printdb("sshdport: $vnode $pnode $vvnode $sshdport\n");
DBQueryFatal("replace into port_registration set pid='$pid', " . DBQueryFatal("update nodes set sshdport=$sshdport ".
"eid='$eid', exptidx='$experiment_idx', service='sshd', ". "where node_id='$vvnode'");
"node_id='$vvnode', port=$sshdport");
} }
} }
......
...@@ -856,19 +856,13 @@ class Plab: ...@@ -856,19 +856,13 @@ class Plab:
" (node_id, type, phys_nodeid, role, priority," " (node_id, type, phys_nodeid, role, priority,"
" op_mode, def_boot_osid, update_accounts," " op_mode, def_boot_osid, update_accounts,"
" allocstate, allocstate_timestamp," " allocstate, allocstate_timestamp,"
" eventstate, state_timestamp)" " eventstate, state_timestamp, sshdport)"
" values (%s, %s, %s, %s, %s," " values (%s, %s, %s, %s, %s,"
" %s, %s, %s, %s, now(), %s, now(), %s)", " %s, %s, %s, %s, now(), %s, now(), %s)",
(vnodeid, vnodetype, nodeid, 'virtnode', vprio, (vnodeid, vnodetype, nodeid, 'virtnode', vprio,
'PCVM', defosid, 1, 'PCVM', defosid, 1,
'FREE_CLEAN', 'FREE_CLEAN',
'SHUTDOWN')) 'SHUTDOWN', sshdport))
DBQueryFatal("insert into port_registration"
" (pid, eid, exptidx, service, node_id, port)"
" values (%s, %s, %s, %s, %s, %s)",
(MONITOR_PID, MONITOR_EID, mon_exptidx,
'sshd', vnodeid, sshdport ))
DBQueryFatal("insert into node_hostkeys" DBQueryFatal("insert into node_hostkeys"
" (node_id)" " (node_id)"
......
...@@ -162,14 +162,12 @@ print "\n"; ...@@ -162,14 +162,12 @@ print "\n";
if ($state eq EXPTSTATE_ACTIVE) { if ($state eq EXPTSTATE_ACTIVE) {
my $query_result = my $query_result =
DBQueryFatal("select r.vname,r.node_id,n.type,n.phys_nodeid,o.osname,". DBQueryFatal("select r.vname,r.node_id,n.type,n.phys_nodeid,o.osname,".
" p.port,n.jailflag,nt.isremotenode,". " n.sshdport,n.jailflag,nt.isremotenode,".
" nt.isplabdslice ". " nt.isplabdslice ".
" from reserved as r ". " from reserved as r ".
"left join nodes as n on r.node_id=n.node_id ". "left join nodes as n on r.node_id=n.node_id ".
"left join os_info as o on o.osid=n.def_boot_osid ". "left join os_info as o on o.osid=n.def_boot_osid ".
"left join node_types as nt on nt.type=n.type ". "left join node_types as nt on nt.type=n.type ".
"left join port_registration as p on ".
" (n.node_id = p.node_id and p.service='sshd')".
"where r.pid='$pid' and r.eid='$eid' order by vname"); "where r.pid='$pid' and r.eid='$eid' order by vname");
while (($v,$p,$t,$m,$o,$s,$j,$r,$d) = $query_result->fetchrow_array()) { while (($v,$p,$t,$m,$o,$s,$j,$r,$d) = $query_result->fetchrow_array()) {
......
...@@ -4915,10 +4915,8 @@ COMMAND_PROTOTYPE(dojailconfig) ...@@ -4915,10 +4915,8 @@ COMMAND_PROTOTYPE(dojailconfig)
/* /*
* Now need the sshdport and jailip for this node. * Now need the sshdport and jailip for this node.
*/ */
res = mydb_query("select port, jailip from nodes as n " res = mydb_query("select sshdport,jailip from nodes "
"left join port_registration as p on " "where node_id='%s'",
" (n.node_id = p.node_id and p.service='sshd') "
"where node_id='%s'",
2, reqp->nodeid); 2, reqp->nodeid);
if (!res) { if (!res) {
...@@ -5033,7 +5031,7 @@ COMMAND_PROTOTYPE(doplabconfig) ...@@ -5033,7 +5031,7 @@ COMMAND_PROTOTYPE(doplabconfig)
/* /*
* Now need the sshdport for this node. * Now need the sshdport for this node.
*/ */
res = mydb_query("select p.port, ps.admin, i.IP " res = mydb_query("select n.sshdport, ps.admin, i.IP "
" from reserved as r " " from reserved as r "
" left join nodes as n " " left join nodes as n "
" on n.node_id=r.node_id " " on n.node_id=r.node_id "
...@@ -5041,8 +5039,6 @@ COMMAND_PROTOTYPE(doplabconfig) ...@@ -5041,8 +5039,6 @@ COMMAND_PROTOTYPE(doplabconfig)
" on n.phys_nodeid=i.node_id " " on n.phys_nodeid=i.node_id "
" left join plab_slices as ps " " left join plab_slices as ps "
" on r.pid=ps.pid and r.eid=ps.eid " " on r.pid=ps.pid and r.eid=ps.eid "
" left join port_registration as p on "
" (n.node_id = p.node_id and p.service='sshd') "
" where i.role='ctrl' and r.node_id='%s'", " where i.role='ctrl' and r.node_id='%s'",
3, reqp->nodeid); 3, reqp->nodeid);
...@@ -7200,7 +7196,7 @@ COMMAND_PROTOTYPE(domotelog) ...@@ -7200,7 +7196,7 @@ COMMAND_PROTOTYPE(domotelog)
} }
/* /*
* Lookup or record the port number that is being used for a particular service * Return motelog info for this node.
*/ */
COMMAND_PROTOTYPE(doportregister) COMMAND_PROTOTYPE(doportregister)
{ {
......
...@@ -403,7 +403,7 @@ class Node ...@@ -403,7 +403,7 @@ class Node
"last_ext_act) as last_act, ". "last_ext_act) as last_act, ".
" t.isvirtnode,t.isremotenode,t.isplabdslice, ". " t.isvirtnode,t.isremotenode,t.isplabdslice, ".
" r.erole as rsrvrole, pi.IP as phys_IP, loc.*, ". " r.erole as rsrvrole, pi.IP as phys_IP, loc.*, ".
" util.*, p.port ". " util.* ".
" from nodes as n ". " from nodes as n ".
"left join reserved as r on n.node_id=r.node_id ". "left join reserved as r on n.node_id=r.node_id ".
"left join node_activity as na on ". "left join node_activity as na on ".
...@@ -419,8 +419,6 @@ class Node ...@@ -419,8 +419,6 @@ class Node
" loc.node_id=n.node_id ". " loc.node_id=n.node_id ".
"left join node_utilization as util on ". "left join node_utilization as util on ".
" util.node_id=n.node_id ". " util.node_id=n.node_id ".
"left join port_registration as p on ".
" (n.node_id = p.node_id and p.service='sshd') ".
"where n.node_id='$node_id'"); "where n.node_id='$node_id'");
if (mysql_num_rows($query_result) == 0) { if (mysql_num_rows($query_result) == 0) {
...@@ -456,7 +454,7 @@ class Node ...@@ -456,7 +454,7 @@ class Node
$ipport_low = $row["ipport_low"]; $ipport_low = $row["ipport_low"];
$ipport_next = $row["ipport_next"]; $ipport_next = $row["ipport_next"];
$ipport_high = $row["ipport_high"]; $ipport_high = $row["ipport_high"];
$sshdport = $row["port"]; $sshdport = $row["sshdport"];
$last_act = $row["last_act"]; $last_act = $row["last_act"];
$last_tty_act = $row["last_tty_act"]; $last_tty_act = $row["last_tty_act"];
$last_net_act = $row["last_net_act"]; $last_net_act = $row["last_net_act"];
......
...@@ -43,14 +43,12 @@ else { ...@@ -43,14 +43,12 @@ else {
} }
$query_result = $query_result =
DBQueryFatal("select n.jailflag,n.jailip,p.port, ". DBQueryFatal("select n.jailflag,n.jailip,n.sshdport, ".
" r.vname,r.pid,r.eid, ". " r.vname,r.pid,r.eid, ".
" t.isvirtnode,t.isremotenode,t.isplabdslice ". " t.isvirtnode,t.isremotenode,t.isplabdslice ".
" from nodes as n ". " from nodes as n ".
"left join reserved as r on n.node_id=r.node_id ". "left join reserved as r on n.node_id=r.node_id ".
"left join node_types as t on t.type=n.type ". "left join node_types as t on t.type=n.type ".
"left join port_registration as p on ".
" (n.node_id = p.node_id and p.service='sshd') ".
"where n.node_id='$node_id'"); "where n.node_id='$node_id'");
if (mysql_num_rows($query_result) == 0) { if (mysql_num_rows($query_result) == 0) {
...@@ -60,7 +58,7 @@ if (mysql_num_rows($query_result) == 0) { ...@@ -60,7 +58,7 @@ if (mysql_num_rows($query_result) == 0) {
$row = mysql_fetch_array($query_result); $row = mysql_fetch_array($query_result);
$jailflag = $row["jailflag"]; $jailflag = $row["jailflag"];
$jailip = $row["jailip"]; $jailip = $row["jailip"];
$sshdport = $row["port"]; $sshdport = $row["sshdport"];
$vname = $row["vname"]; $vname = $row["vname"];
$pid = $row["pid"]; $pid = $row["pid"];
$eid = $row["eid"]; $eid = $row["eid"];
......
...@@ -28,7 +28,7 @@ $reqargs = RequiredPageArguments("node", PAGEARG_NODE); ...@@ -28,7 +28,7 @@ $reqargs = RequiredPageArguments("node", PAGEARG_NODE);
$node_id = $node->node_id(); $node_id = $node->node_id();
$query_result = $query_result =
DBQueryFatal("select n.jailflag,n.jailip,p.port, ". DBQueryFatal("select n.jailflag,n.jailip,n.sshdport, ".
" r.vname,r.pid,r.eid, ". " r.vname,r.pid,r.eid, ".
" t.isvirtnode,t.isremotenode,t.isplabdslice, ". " t.isvirtnode,t.isremotenode,t.isplabdslice, ".
" t.issubnode,t.class ". " t.issubnode,t.class ".
...@@ -36,8 +36,6 @@ $query_result = ...@@ -36,8 +36,6 @@ $query_result =
"left join reserved as r on n.node_id=r.node_id ". "left join reserved as r on n.node_id=r.node_id ".
"left join node_types as t on t.type=n.type ". "left join node_types as t on t.type=n.type ".
"left join os_info as oi on n.def_boot_osid=oi.osid ". "left join os_info as oi on n.def_boot_osid=oi.osid ".
"left join port_registration as p on ".
" (n.node_id = p.node_id and p.service='sshd')".
"where n.node_id='$node_id'"); "where n.node_id='$node_id'");
if (mysql_num_rows($query_result) == 0) { if (mysql_num_rows($query_result) == 0) {
...@@ -47,7 +45,7 @@ if (mysql_num_rows($query_result) == 0) { ...@@ -47,7 +45,7 @@ if (mysql_num_rows($query_result) == 0) {
$row = mysql_fetch_array($query_result); $row = mysql_fetch_array($query_result);
$jailflag = $row["jailflag"]; $jailflag = $row["jailflag"];
$jailip = $row["jailip"]; $jailip = $row["jailip"];
$sshdport = $row["port"]; $sshdport = $row["sshdport"];
$vname = $row["vname"]; $vname = $row["vname"];
$pid = $row["pid"]; $pid = $row["pid"];
$eid = $row["eid"]; $eid = $row["eid"];
......
...@@ -3555,14 +3555,12 @@ class node: ...@@ -3555,14 +3555,12 @@ class node:
output=("You do not have permission to access: " output=("You do not have permission to access: "
+ argdict["node"])) + argdict["node"]))
res = DBQueryFatal("select n.node_id,n.jailflag,p.port, " res = DBQueryFatal("select n.node_id,n.jailflag,n.sshdport, "
" r.vname,r.pid,r.eid, " " r.vname,r.pid,r.eid, "
" t.isvirtnode,t.isremotenode,t.isplabdslice " " t.isvirtnode,t.isremotenode,t.isplabdslice "
" from nodes as n " " from nodes as n "
"left join reserved as r on n.node_id=r.node_id " "left join reserved as r on n.node_id=r.node_id "
"left join node_types as t on t.type=n.type " "left join node_types as t on t.type=n.type "
"left join port_registration as p on "
" (n.node_id = p.node_id and p.service='sshd')"
"where " + clause, "where " + clause,
clause_args) clause_args)
......
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