- write_bsr(ua, bsr, fd);
- stat = !ferror(fd);
- fclose(fd);
- bsendmsg(ua, _("Bootstrap records written to %s\n"), fname);
- bsendmsg(ua, _("\nThe restore job will require the following Volumes:\n"));
- /* Create Unique list of Volumes using prompt list */
- start_prompt(ua, "");
- for (nbsr=bsr; nbsr; nbsr=nbsr->next) {
- for (int i=0; i < nbsr->VolCount; i++) {
- add_prompt(ua, nbsr->VolParams[i].VolumeName);
- }
- }
- for (int i=0; i < ua->num_prompts; i++) {
- bsendmsg(ua, " %s\n", ua->prompt[i]);
- free(ua->prompt[i]);
- }
- ua->num_prompts = 0;
- bsendmsg(ua, "\n");
- free_pool_memory(fname);
- return stat;
-}
-
-static void write_bsr(UAContext *ua, RBSR *bsr, FILE *fd)
-{
- if (bsr) {
- for (int i=0; i < bsr->VolCount; i++) {
- fprintf(fd, "Volume=\"%s\"\n", bsr->VolParams[i].VolumeName);
- fprintf(fd, "VolSessionId=%u\n", bsr->VolSessionId);
- fprintf(fd, "VolSessionTime=%u\n", bsr->VolSessionTime);
- fprintf(fd, "VolFile=%u-%u\n", bsr->VolParams[i].StartFile,
- bsr->VolParams[i].EndFile);
- fprintf(fd, "VolBlock=%u-%u\n", bsr->VolParams[i].StartBlock,
- bsr->VolParams[i].EndBlock);
- write_findex(ua, bsr->fi, fd);
- }
- write_bsr(ua, bsr->next, fd);
- }
-}
-
-static void print_bsr(UAContext *ua, RBSR *bsr)
-{
- if (bsr) {
- for (int i=0; i < bsr->VolCount; i++) {
- bsendmsg(ua, "Volume=\"%s\"\n", bsr->VolParams[i].VolumeName);
- bsendmsg(ua, "VolSessionId=%u\n", bsr->VolSessionId);
- bsendmsg(ua, "VolSessionTime=%u\n", bsr->VolSessionTime);
- bsendmsg(ua, "VolFile=%u-%u\n", bsr->VolParams[i].StartFile,
- bsr->VolParams[i].EndFile);
- bsendmsg(ua, "VolBlock=%u-%u\n", bsr->VolParams[i].StartBlock,
- bsr->VolParams[i].EndBlock);
- print_findex(ua, bsr->fi);
- }
- print_bsr(ua, bsr->next);
- }
-}
-
-
-/*
- * Add a FileIndex to the list of BootStrap records.
- * Here we are only dealing with JobId's and the FileIndexes
- * associated with those JobIds.
- */
-static void add_findex(RBSR *bsr, uint32_t JobId, int32_t findex)
-{
- RBSR *nbsr;
- RBSR_FINDEX *fi, *lfi;
-
- if (findex == 0) {
- return; /* probably a dummy directory */