Commit 3c08dd00 authored by Leigh Stoller's avatar Leigh Stoller

Add mustclean stuff to osid pages. An admin only bit that Mike can set

to indicate that the kernel is does not touch the disk. Defaults to 1
for all osids so that a disk reload is forced (via the last_reservations
table).
parent c5c7cce2
......@@ -121,6 +121,20 @@ else {
$os_shared = 0;
}
#
# Only admin types can muck with the mustclean bit.
#
if (isset($os_clean) &&
strcmp($os_clean, "Yep") == 0) {
if (!$isadmin) {
USERERROR("Only Emulab Administrators can set the clean flag!", 1);
}
$os_mustclean = 0;
}
else {
$os_mustclean = 1;
}
#
# Form the os features set.
#
......@@ -169,11 +183,11 @@ if (TBValidOSID($osid)) {
$query_result =
DBQueryFatal("INSERT INTO os_info ".
"(osname, osid, description, OS, version, path, magic, ".
" osfeatures, pid, shared, creator, created) ".
" osfeatures, pid, shared, creator, mustclean, created) ".
"VALUES ('$osname', '$osid', '$description', '$OS', ".
" '$os_version', $os_path, '$os_magic', ".
" '$os_features', '$pid', $os_shared, ".
" '$uid', now())");
" '$uid', $os_mustclean, now())");
DBQueryFatal("unlock tables");
......
......@@ -136,6 +136,15 @@ if ($isadmin) {
(available to all projects)</td>
<td><input type=checkbox name=os_shared value=Yep> Yes</td>
</tr>\n";
#
# Mustclean?
#
echo "<tr>
<td>Clean?:<br>
(no disk reload required)</td>
<td><input type=checkbox name=os_clean value=Yep> Yes</td>
</tr>\n";
}
echo "<tr>
......
......@@ -685,6 +685,7 @@ function SHOWOSINFO($osid) {
$os_osname = $osrow[osname];
$creator = $osrow[creator];
$created = $osrow[created];
$mustclean = $osrow[mustclean];
if (!$os_description)
$os_description = "&nbsp";
......@@ -766,6 +767,18 @@ function SHOWOSINFO($osid) {
echo " </td>
</tr>\n";
echo "<tr>
<td>Must Clean?: </td>
<td class=left>\n";
if ($mustclean)
echo "Yes";
else
echo "No";
echo " </td>
</tr>\n";
echo "<tr>
<td>Internal ID: </td>
<td class=\"left\">$osid</td>
......
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