Commit e2d292dc authored by Mike Hibler's avatar Mike Hibler

Grab bootdisk_unit out of DB (rather than assuming '0') for loadinfo command.

Needed for new PCs with SATA disks which start as "ad4".
parent 139b89c7
......@@ -3215,10 +3215,10 @@ COMMAND_PROTOTYPE(doloadinfo)
*/
disktype = DISKTYPE;
disknum = DISKNUM;
res = mydb_query("select disktype from nodes as n "
res = mydb_query("select disktype,bootdisk_unit from nodes as n "
"left join node_types as nt on n.type = nt.type "
"where n.node_id='%s'",
1, reqp->nodeid);
2, reqp->nodeid);
if (!res) {
error("doloadinfo: %s: DB Error getting disktype!\n",
reqp->nodeid);
......@@ -3229,6 +3229,8 @@ COMMAND_PROTOTYPE(doloadinfo)
row = mysql_fetch_row(res);
if (row[0] && row[0][0])
disktype = row[0];
if (row[1] && row[1][0])
disknum = atoi(row[1]);
}
OUTPUT(bufp, ebufp - bufp, " DISK=%s%d\n", disktype, disknum);
mysql_free_result(res);
......
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