*/
/*
- Copyright (C) 2002-2005 Kern Sibbald
+ Copyright (C) 2002-2006 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
static BSR *store_vol(LEX *lc, BSR *bsr);
static BSR *store_mediatype(LEX *lc, BSR *bsr);
+static BSR *store_device(LEX *lc, BSR *bsr);
static BSR *store_client(LEX *lc, BSR *bsr);
static BSR *store_job(LEX *lc, BSR *bsr);
static BSR *store_jobid(LEX *lc, BSR *bsr);
{"exclude", store_exclude},
{"volfile", store_volfile},
{"volblock", store_volblock},
- {"stream", store_stream},
- {"slot", store_slot},
+ {"stream", store_stream},
+ {"slot", store_slot},
+ {"device", store_device},
{NULL, NULL}
};
return bsr;
}
+/* Shove the Device name in each Volume in the current bsr */
+static BSR *store_device(LEX *lc, BSR *bsr)
+{
+ int token;
+
+ token = lex_get_token(lc, T_STRING);
+ if (token == T_ERROR) {
+ return NULL;
+ }
+ if (!bsr->volume) {
+ Emsg1(M_ERROR,0, _("Device \"%s\" in bsr at inappropriate place.\n"),
+ lc->str);
+ return bsr;
+ }
+ BSR_VOLUME *bv;
+ for (bv=bsr->volume; bv; bv=bv->next) {
+ bstrncpy(bv->device, lc->str, sizeof(bv->device));
+ }
+ return bsr;
+}
+
+
static BSR *store_client(LEX *lc, BSR *bsr)
{
if (token == T_ERROR) {
return NULL;
}
- bsr->Slot = lc->pint32_val;
+ if (!bsr->volume) {
+ Emsg1(M_ERROR,0, _("Slot %d in bsr at inappropriate place.\n"),
+ lc->pint32_val);
+ return bsr;
+ }
+ bsr->volume->Slot = lc->pint32_val;
scan_to_eol(lc);
return bsr;
}
{
if (volume) {
Pmsg1(-1, _("VolumeName : %s\n"), volume->VolumeName);
+ Pmsg1(-1, _(" MediaType : %s\n"), volume->MediaType);
+ Pmsg1(-1, _(" Device : %s\n"), volume->device);
+ Pmsg1(-1, _(" Slot : %d\n"), volume->Slot);
dump_volume(volume->next);
}
}
dump_jobid(bsr->JobId);
dump_job(bsr->job);
dump_findex(bsr->FileIndex);
- if (bsr->Slot) {
- Pmsg1(-1, _("Slot : %u\n"), bsr->Slot);
- }
if (bsr->count) {
Pmsg1(-1, _("count : %u\n"), bsr->count);
Pmsg1(-1, _("found : %u\n"), bsr->found);
vol = new_restore_volume();
bstrncpy(vol->VolumeName, bsrvol->VolumeName, sizeof(vol->VolumeName));
bstrncpy(vol->MediaType, bsrvol->MediaType, sizeof(vol->MediaType));
+ bstrncpy(vol->device, bsrvol->device, sizeof(vol->device));
+ vol->Slot = bsrvol->Slot;
vol->start_file = sfile;
if (add_restore_volume(jcr, vol)) {
jcr->NumVolumes++;