Dmsg2(200, "dir_create_jobmedia. Release vol=%s dev=%s\n",
dev->VolCatInfo.VolCatName, dev->print_name());
if (!dev->at_weot() && !dir_create_jobmedia_record(dcr)) {
- Jmsg(jcr, M_FATAL, 0, _("Could not create JobMedia record for Volume=\"%s\" Job=%s\n"),
+ Jmsg2(jcr, M_FATAL, 0, _("Could not create JobMedia record for Volume=\"%s\" Job=%s\n"),
dcr->VolCatInfo.VolCatName, jcr->Job);
}
/* If no more writers, and no errors, and wrote something, write an EOF */
/*
* After writing a Volume, create the JobMedia record.
*/
-bool dir_create_jobmedia_record(DCR *dcr)
+bool dir_create_jobmedia_record(DCR *dcr, bool zero)
{
JCR *jcr = dcr->jcr;
BSOCK *dir = jcr->dir_bsock;
return true;
}
+ /* Throw out records where FI is zero -- i.e. nothing done */
+ if (!zero && dcr->VolFirstIndex == 0 &&
+ (dcr->StartBlock != 0 || dcr->EndBlock != 0)) {
+ Dmsg0(000, "JobMedia problem FI=0 StartBlock!=0\n");
+ return true;
+ }
+
if (!dcr->WroteVol) {
return true; /* nothing written to tape */
}
dcr->WroteVol = false;
- dir->fsend(Create_job_media, jcr->Job,
- dcr->VolFirstIndex, dcr->VolLastIndex,
- dcr->StartFile, dcr->EndFile,
- dcr->StartBlock, dcr->EndBlock,
- dcr->Copy, dcr->Stripe,
- edit_uint64(dcr->VolMediaId, ed1));
+ if (zero) {
+ /* Send dummy place holder to avoid purging */
+ dir->fsend(Create_job_media, jcr->Job,
+ 0 , 0, 0, 0, 0, 0, 0, 0, edit_uint64(dcr->VolMediaId, ed1));
+ } else {
+ dir->fsend(Create_job_media, jcr->Job,
+ dcr->VolFirstIndex, dcr->VolLastIndex,
+ dcr->StartFile, dcr->EndFile,
+ dcr->StartBlock, dcr->EndBlock,
+ dcr->Copy, dcr->Stripe,
+ edit_uint64(dcr->VolMediaId, ed1));
+ }
Dmsg1(100, ">dird %s", dir->msg);
if (dir->recv() <= 0) {
Dmsg0(190, "create_jobmedia error bnet_recv\n");
/* Dummies to replace askdir.c */
bool dir_find_next_appendable_volume(DCR *dcr) { return 1;}
bool dir_update_volume_info(DCR *dcr, bool relabel, bool update_LastWritten) { return 1; }
-bool dir_create_jobmedia_record(DCR *dcr) { return 1; }
+bool dir_create_jobmedia_record(DCR *dcr, bool zero) { return 1; }
bool dir_ask_sysop_to_create_appendable_volume(DCR *dcr) { return 1; }
bool dir_update_file_attributes(DCR *dcr, DEV_RECORD *rec) { return 1;}
bool dir_send_job_status(JCR *jcr) {return 1;}
/* Dummies to replace askdir.c */
bool dir_find_next_appendable_volume(DCR *dcr) { return 1;}
bool dir_update_volume_info(DCR *dcr, bool relabel, bool update_LastWritten) { return 1; }
-bool dir_create_jobmedia_record(DCR *dcr) { return 1; }
+bool dir_create_jobmedia_record(DCR *dcr, bool zero) { return 1; }
bool dir_ask_sysop_to_create_appendable_volume(DCR *dcr) { return 1; }
bool dir_update_file_attributes(DCR *dcr, DEV_RECORD *rec) { return 1;}
bool dir_send_job_status(JCR *jcr) {return 1;}
/* Create a jobmedia record for this job */
if (!dir_create_jobmedia_record(dcr)) {
dev->dev_errno = EIO;
- Jmsg(jcr, M_FATAL, 0, _("Could not create JobMedia record for Volume=\"%s\" Job=%s\n"),
+ Jmsg2(jcr, M_FATAL, 0, _("Could not create JobMedia record for Volume=\"%s\" Job=%s\n"),
dcr->VolCatInfo.VolCatName, jcr->Job);
set_new_volume_parameters(dcr);
stat = false;
if (!dir_create_jobmedia_record(dcr)) {
Dmsg0(190, "Error from create JobMedia\n");
dev->dev_errno = EIO;
- Jmsg(dcr->jcr, M_FATAL, 0, _("Could not create JobMedia record for Volume=\"%s\" Job=%s\n"),
+ Jmsg2(dcr->jcr, M_FATAL, 0, _("Could not create JobMedia record for Volume=\"%s\" Job=%s\n"),
dcr->VolCatInfo.VolCatName, dcr->jcr->Job);
ok = false;
}
if (!dir_create_jobmedia_record(dcr)) {
Dmsg0(190, "Error from create_job_media.\n");
dev->dev_errno = EIO;
- Jmsg(jcr, M_FATAL, 0, _("Could not create JobMedia record for Volume=\"%s\" Job=%s\n"),
+ Jmsg2(jcr, M_FATAL, 0, _("Could not create JobMedia record for Volume=\"%s\" Job=%s\n"),
dcr->VolCatInfo.VolCatName, jcr->Job);
terminate_writing_volume(dcr);
dev->dev_errno = EIO;
/* Dummies to replace askdir.c */
bool dir_find_next_appendable_volume(DCR *dcr) { return 1;}
bool dir_update_volume_info(DCR *dcr, bool relabel, bool update_LastWritten) { return 1; }
-bool dir_create_jobmedia_record(DCR *dcr) { return 1; }
+bool dir_create_jobmedia_record(DCR *dcr, bool zero) { return 1; }
bool dir_ask_sysop_to_create_appendable_volume(DCR *dcr) { return 1; }
bool dir_update_file_attributes(DCR *dcr, DEV_RECORD *rec) { return 1;}
bool dir_send_job_status(JCR *jcr) {return 1;}
/* Dummies to replace askdir.c */
bool dir_find_next_appendable_volume(DCR *dcr) { return 1;}
bool dir_update_volume_info(DCR *dcr, bool relabel, bool update_LastWritten) { return 1; }
-bool dir_create_jobmedia_record(DCR *dcr) { return 1; }
+bool dir_create_jobmedia_record(DCR *dcr, bool zero) { return 1; }
bool dir_ask_sysop_to_create_appendable_volume(DCR *dcr) { return 1; }
bool dir_update_file_attributes(DCR *dcr, DEV_RECORD *rec) { return 1;}
bool dir_send_job_status(JCR *jcr) {return 1;}
return 1;
}
-bool dir_create_jobmedia_record(DCR *dcr)
+bool dir_create_jobmedia_record(DCR *dcr, bool zero)
{
dcr->WroteVol = false;
return 1;
/*
* Write a volume label. This is ONLY called if we have a valid Bacula
- * label of type PRE_LABEL;
+ * label of type PRE_LABEL or we are recyling an existing Volume.
+ *
* Returns: true if OK
* false if unable to write it
*/
if (recycle) {
dev->VolCatInfo.VolCatMounts++;
dev->VolCatInfo.VolCatRecycles++;
+ dir_create_jobmedia_record(dcr, true);
} else {
dev->VolCatInfo.VolCatMounts = 1;
dev->VolCatInfo.VolCatRecycles = 0;
bool dir_ask_sysop_to_mount_volume(DCR *dcr, int mode);
bool dir_update_file_attributes(DCR *dcr, DEV_RECORD *rec);
bool dir_send_job_status(JCR *jcr);
-bool dir_create_jobmedia_record(DCR *dcr);
+bool dir_create_jobmedia_record(DCR *dcr, bool zero=false);
bool dir_update_device(JCR *jcr, DEVICE *dev);
bool dir_update_changer(JCR *jcr, AUTOCHANGER *changer);
}
if (!dir_create_jobmedia_record(dcr)) {
- Jmsg(jcr, M_FATAL, 0, _("Could not create JobMedia record for Volume=\"%s\" Job=%s\n"),
+ Jmsg2(jcr, M_FATAL, 0, _("Could not create JobMedia record for Volume=\"%s\" Job=%s\n"),
dcr->VolCatInfo.VolCatName, jcr->Job);
}
/* Set new file/block parameters for current dcr */
#undef VERSION
#define VERSION "2.5.26"
-#define BDATE "21 December 2008"
-#define LSMDATE "21Dec08"
+#define BDATE "23 December 2008"
+#define LSMDATE "23Dec08"
#define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n"
#define BYEAR "2008" /* year for copyright messages in progs */
mixed priorities
General:
+23Dec08
+kes Fix bug #1208
20Dec08
ebl Work on copy jobs
- Add "list copies" command