/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2009 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.
*
* Kern Sibbald, December 2000
*
- * Version $Id$
*/
#include "bacula.h" /* pull in global headers */
"changer_name=%s media_type=%s volume_name=%s\n";
-/* Send update information about a device to Director */
+/** Send update information about a device to Director */
bool dir_update_device(JCR *jcr, DEVICE *dev)
{
BSOCK *dir = jcr->dir_bsock;
#endif
-/*
+/**
* Send current JobStatus to Director
*/
bool dir_send_job_status(JCR *jcr)
return jcr->dir_bsock->fsend(Job_status, jcr->Job, jcr->JobStatus);
}
-/*
+/**
* Common routine for:
* dir_get_volume_info()
* and
int n;
int32_t InChanger;
+ dcr->setVolCatInfo(false);
if (dir->recv() <= 0) {
Dmsg0(200, "getvolname error bnet_recv\n");
Mmsg(jcr->errmsg, _("Network error on bnet_recv in req_vol_info.\n"));
return false;
}
vol.InChanger = InChanger; /* bool in structure */
+ vol.is_valid = true;
unbash_spaces(vol.VolCatName);
bstrncpy(dcr->VolumeName, vol.VolCatName, sizeof(dcr->VolumeName));
dcr->VolCatInfo = vol; /* structure assignment */
}
-/*
+/**
* Get Volume info for a specific volume from the Director's Database
*
* Returns: true on success (Director guarantees that Pool and MediaType
BSOCK *dir = jcr->dir_bsock;
P(vol_info_mutex);
- bstrncpy(dcr->VolCatInfo.VolCatName, dcr->VolumeName, sizeof(dcr->VolCatInfo.VolCatName));
- bash_spaces(dcr->VolCatInfo.VolCatName);
- dir->fsend(Get_Vol_Info, jcr->Job, dcr->VolCatInfo.VolCatName,
+ dcr->setVolCatName(dcr->VolumeName);
+ bash_spaces(dcr->getVolCatName());
+ dir->fsend(Get_Vol_Info, jcr->Job, dcr->getVolCatName(),
writing==GET_VOL_INFO_FOR_WRITE?1:0);
Dmsg1(100, ">dird %s", dir->msg);
- unbash_spaces(dcr->VolCatInfo.VolCatName);
+ unbash_spaces(dcr->getVolCatName());
bool ok = do_get_volume_info(dcr);
V(vol_info_mutex);
return ok;
-/*
+/**
* Get info on the next appendable volume in the Director's database
*
* Returns: true on success dcr->VolumeName is volume
}
-/*
+/**
* After writing a Volume, send the updated statistics
* back to the director. The information comes from the
* dev record.
/* Lock during Volume update */
P(vol_info_mutex);
- Dmsg1(100, "Update cat VolFiles=%d\n", dev->file);
+ Dmsg1(100, "Update cat VolBytes=%lld\n", vol->VolCatBytes);
/* Just labeled or relabeled the tape */
if (label) {
bstrncpy(vol->VolCatStatus, "Append", sizeof(vol->VolCatStatus));
ok = true;
bail_out:
- /* ***FIXME*** remove for production */
- sm_check(__FILE__, __LINE__, true);
V(vol_info_mutex);
return ok;
}
-/*
+/**
* After writing a Volume, create the JobMedia record.
*/
bool dir_create_jobmedia_record(DCR *dcr, bool zero)
}
-/*
+/**
* Update File Attribute data
+ * We do the following:
+ * 1. expand the bsock buffer to be large enough
+ * 2. Write a "header" into the buffer with serialized data
+ * VolSessionId
+ * VolSeesionTime
+ * FileIndex
+ * Stream
+ * data length that follows
+ * start of raw byte data from the Device record.
+ * Note, this is primarily for Attribute data, but can
+ * also handle any device record. The Director must know
+ * the raw byte data format that is defined for each Stream.
+ * Now Restore Objects pass through here STREAM_RESTORE_OBJECT
*/
bool dir_update_file_attributes(DCR *dcr, DEV_RECORD *rec)
{
}
-/*
+/**
* Request the sysop to create an appendable volume
*
* Entered with device blocked.
return true;
}
-/*
+/**
* Request to mount specific Volume
*
* Entered with device blocked and dcr->VolumeName is desired