Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
b944167d
Commit
b944167d
authored
Mar 06, 2015
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return frisbee server along with dataset.
parent
fe11f3d0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
7 deletions
+35
-7
tmcd/tmcd.c
tmcd/tmcd.c
+35
-7
No files found.
tmcd/tmcd.c
View file @
b944167d
...
...
@@ -4540,14 +4540,14 @@ static int
sendstoreconf(int sock, int tcp, tmcdreq_t *reqp, char *bscmd, char *vname,
int dopersist)
{
MYSQL_RES *res;
MYSQL_ROW row;
MYSQL_RES *res
, *res2
;
MYSQL_ROW row
, row2
;
char buf[MYBUFSIZE];
char *bufp, *ebufp = &buf[sizeof(buf)];
char iqn[BS_IQN_MAXSIZE];
char *mynodeid;
char *class, *protocol, *placement, *mountpoint, *lease;
char *dataset;
char *dataset
, *server
;
int nrows, nattrs, ro;
/* Remember the nodeid we care about up front. */
...
...
@@ -4592,6 +4592,34 @@ sendstoreconf(int sock, int tcp, tmcdreq_t *reqp, char *bscmd, char *vname,
}
}
/*
* For datasets, we need to tell the client what server to use.
*/
if (dataset) {
res2 = mydb_query("select IP "
" from interfaces as i, subbosses as s "
" where i.node_id=s.subboss_id and "
" i.role='ctrl' and "
" s.node_id='%s' and s.service='frisbee'"
" and s.disabled=0",
1, reqp->isvnode ?
reqp->pnodeid : reqp->nodeid);
if (!res2) {
error("sendstoreconf: "
"%s: DB Error getting subboss info!\n",
reqp->nodeid);
mysql_free_result(res);
return 1;
}
if (mysql_num_rows(res2)) {
row2 = mysql_fetch_row(res2);
server = strdup(row2[0]);
} else {
server = strdup(BOSSNODE_IP);
}
mysql_free_result(res2);
}
/* iSCSI blockstore */
if ((strcmp(class, BS_CLASS_SAN) == 0) &&
(strcmp(protocol, BS_PROTO_ISCSI) == 0)) {
...
...
@@ -4664,16 +4692,16 @@ sendstoreconf(int sock, int tcp, tmcdreq_t *reqp, char *bscmd, char *vname,
/* Add the dataset to the buffer, if requested.*/
if (strlen(dataset)) {
bufp += OUTPUT(bufp, ebufp-bufp, " DATASET=%s",
dataset);
bufp += OUTPUT(bufp, ebufp-bufp,
" DATASET=%s SERVER=%s",
dataset, server);
free(server);
}
bufp += OUTPUT(bufp, ebufp-bufp, "\n");
client_writeback(sock, buf, strlen(buf), tcp);
}
mysql_free_result(res);
return 0;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment