slot_list[i] = 0;
}
i = find_arg_with_value(ua, "slots");
+ if (i == -1) { /* not found */
+ i = find_arg_with_value(ua, "slot");
+ }
if (i > 0) {
/* scan slot list in ua->argv[i] */
char *p, *e, *h;
vl->next = vol_list;
vol_list = vl;
} else {
- /* Add new entry to end of list */
+ vol_list_t *prev=vol_list;
+ /* Add new entry to the right place in the list */
for (vol_list_t *tvl=vol_list; tvl; tvl=tvl->next) {
+ if (tvl->Slot > vl->Slot) {
+ /* no previous item, update vol_list directly */
+ if (prev == vol_list) {
+ vl->next = vol_list;
+ vol_list = vl;
+
+ } else { /* replace the previous pointer */
+ prev->next = vl;
+ vl->next = tvl;
+ }
+ break;
+ }
+ /* we are at the end */
if (!tvl->next) {
tvl->next = vl;
vl->next = NULL;
break;
}
+ prev = tvl;
}
}
}
* S:2:E or S:Slot num:E
* S:3:F:vol4
*
+ * Import/Export tray slots:
+ * I:10:F:vol10 I:Slot num:F:Volume Name
+ * I:11:E or I:Slot num:E
+ * I:12:F:vol40
+ *
* If a drive is loaded, the slot *should* be empty
*
* Output:
* S|2||||||||
* S|3|3|vol4|15869952|Append|LTO1-ANSI|Inc|1250858907|1282394907
*
- * Type can be S or I (Slot or Import/Export)
- *
* TODO: need to merge with status_slots()
*/
void status_content(UAContext *ua, STORE *store)
}
ua->send_msg(_(" Slot | Volume Name | Status | Media Type | Pool |\n"));
ua->send_msg(_("------+------------------+-----------+----------------------+--------------------|\n"));
-
/* Walk through the list getting the media records */
for (vl=vol_list; vl; vl=vl->next) {