/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2010 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
This program is Free Software; you can redistribute it and/or
- modify it under the terms of version two of the GNU General Public
+ modify it under the terms of version three of the GNU Affero General Public
License as published by the Free Software Foundation and included
in the file LICENSE.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*
* Kern Sibbald, MM
*
- *
- * Version $Id$
*/
#include "bacula.h" /* pull in global headers */
if (reserve_volume(dcr, dev->VolHdr.VolumeName) == NULL) {
Mmsg2(jcr->errmsg, _("Could not reserve volume %s on %s\n"),
dev->VolHdr.VolumeName, dev->print_name());
+ Dmsg2(150, "Could not reserve volume %s on %s\n", dev->VolHdr.VolumeName, dev->print_name());
stat = VOL_NAME_ERROR;
goto bail_out;
}
}
/* Set the new filename for open, ... */
- bstrncpy(dev->VolCatInfo.VolCatName, VolName, sizeof(dev->VolCatInfo.VolCatName));
- bstrncpy(dcr->VolCatInfo.VolCatName, VolName, sizeof(dcr->VolCatInfo.VolCatName));
+ dev->setVolCatName(VolName);
+ dcr->setVolCatName(VolName);
Dmsg1(150, "New VolName=%s\n", VolName);
if (dev->open(dcr, OPEN_READ_WRITE) < 0) {
/* If device is not tape, attempt to create it */
create_volume_label_record(dcr, dcr->rec);
dcr->rec->Stream = 0;
+ dcr->rec->maskedStream = 0;
if (!write_record_to_block(dcr->block, dcr->rec)) {
Dmsg2(130, "Bad Label write on %s: ERR=%s\n", dev->print_name(), dev->print_errmsg());
if (reserve_volume(dcr, VolName) == NULL) {
Mmsg2(dcr->jcr->errmsg, _("Could not reserve volume %s on %s\n"),
dev->VolHdr.VolumeName, dev->print_name());
+ Dmsg1(100, "%s", dcr->jcr->errmsg);
goto bail_out;
}
dev = dcr->dev; /* may have changed in reserve_volume */
}
Dmsg1(150, "wrote vol label to block. Vol=%s\n", dcr->VolumeName);
+ dev->setVolCatInfo(false);
dev->VolCatInfo.VolCatBytes = 0; /* reset byte count */
/*
dev->VolCatInfo.VolCatReads = 1;
}
Dmsg1(150, "dir_update_vol_info. Set Append vol=%s\n", dcr->VolumeName);
+ dev->VolCatInfo.VolFirstWritten = time(NULL);
bstrncpy(dev->VolCatInfo.VolCatStatus, "Append", sizeof(dev->VolCatInfo.VolCatStatus));
- bstrncpy(dev->VolCatInfo.VolCatName, dcr->VolumeName, sizeof(dev->VolCatInfo.VolCatName));
+ dev->setVolCatName(dcr->VolumeName);
if (!dir_update_volume_info(dcr, true, true)) { /* indicate doing relabel */
return false;
}
rec->VolSessionId = jcr->VolSessionId;
rec->VolSessionTime = jcr->VolSessionTime;
rec->Stream = jcr->NumWriteVolumes;
+ rec->maskedStream = jcr->NumWriteVolumes;
Dmsg2(150, "Created Vol label rec: FI=%s len=%d\n", FI_to_ascii(buf, rec->FileIndex),
rec->data_len);
}
rec->VolSessionId = jcr->VolSessionId;
rec->VolSessionTime = jcr->VolSessionTime;
rec->Stream = jcr->JobId;
+ rec->maskedStream = jcr->JobId;
rec->data = check_pool_memory_size(rec->data, SER_LENGTH_Session_Label);
ser_begin(rec->data, SER_LENGTH_Session_Label);
/* Added in VerNum 10 */
ser_string(jcr->Job); /* Unique name of this Job */
ser_string(jcr->fileset_name);
- ser_uint32(jcr->get_JobType());
- ser_uint32(jcr->get_JobLevel());
+ ser_uint32(jcr->getJobType());
+ ser_uint32(jcr->getJobLevel());
/* Added in VerNum 11 */
ser_string(jcr->fileset_md5);