Skip to content

Commit

Permalink
Show a % when a volume is loaded in a drive.
Browse files Browse the repository at this point in the history
For a status slots print a % when the volume is loaded into
a drive.

So now we have:

'@' - import export slot
'*' - data in backup catalog doesn't match
'%' - volume is loaded into a drive.
' ' - nothing special with volume just in slot and catalog info matches.

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
  • Loading branch information
Daniel Neuberger authored and Marco van Wieringen committed Feb 17, 2015
1 parent b3d2a7a commit 0cfa2c9
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/dird/ua_status.c
Expand Up @@ -1439,7 +1439,7 @@ static void status_slots(UAContext *ua, STORERES *store_r)
MEDIA_DBR mr;
char *slot_list;
int max_slots;
bool found;
bool is_loaded_in_drive;
/*
* Slot | Volume | Status | MediaType | Pool
*/
Expand Down Expand Up @@ -1506,20 +1506,20 @@ static void status_slots(UAContext *ua, STORERES *store_r)
}

vl2 = NULL;
is_loaded_in_drive = false;
switch (vl1->Content) {
case slot_content_empty:
if (vl1->Type == slot_type_normal) {
/*
* See if this empty slot is empty because the volume is loaded
* in one of the drives.
*/
found = false;
vl2 = (vol_list_t *)vol_list->first();
while (!found && vl2) {
while (!is_loaded_in_drive && vl2) {
switch (vl2->Type) {
case slot_type_drive:
if (vl1->Slot == vl2->Loaded) {
found = true;
is_loaded_in_drive = true;
continue;
}
break;
Expand All @@ -1528,7 +1528,7 @@ static void status_slots(UAContext *ua, STORERES *store_r)
}
vl2 = (vol_list_t *)vol_list->next((void *)vl2);
}
if (!found) {
if (!is_loaded_in_drive) {
ua->send_msg(slot_hformat,
vl1->Slot, '*',
"?", "?", "?", "?");
Expand Down Expand Up @@ -1590,7 +1590,8 @@ static void status_slots(UAContext *ua, STORERES *store_r)
mr.VolumeName, mr.VolStatus, mr.MediaType, pr.Name);
} else {
ua->send_msg(slot_hformat,
vl1->Slot, ((vl1->Slot == mr.Slot) ? ' ' : '*'),
vl1->Slot,
((vl1->Slot == mr.Slot) ? (is_loaded_in_drive ? '%' : ' ') : '*'),
mr.VolumeName, mr.VolStatus, mr.MediaType, pr.Name);
}
} else {
Expand Down

0 comments on commit 0cfa2c9

Please sign in to comment.