General:
+Changes to 1.37.42:
+22Oct05
+- Insure that all the SD tools init the Autochanger
+ resources.
+
Changes to 1.37.41:
22Oct05
- Print error message if no Changer Command found.
static void unlock_changer(DCR *dcr);
static bool unload_other_drive(DCR *dcr, int slot);
+/* Init all the autochanger resources found */
+bool init_autochangers()
+{
+ bool OK = true;
+ AUTOCHANGER *changer;
+ /* Ensure that the media_type for each device is the same */
+ foreach_res(changer, R_AUTOCHANGER) {
+ DEVRES *device;
+ char *media_type = NULL;
+ foreach_alist(device, changer->device) {
+ /*
+ * If the device does not have a changer name or changer command
+ * defined, used the one from the Autochanger resource
+ */
+ if (!device->changer_name && changer->changer_name) {
+ device->changer_name = bstrdup(changer->changer_name);
+ }
+ if (!device->changer_command && changer->changer_command) {
+ device->changer_command = bstrdup(changer->changer_command);
+ }
+ if (!device->changer_name) {
+ Jmsg(NULL, M_ERROR, 0,
+ _("No Changer Name given for device %s. Cannot continue.\n"),
+ device->hdr.name);
+ OK = false;
+ }
+ if (!device->changer_command) {
+ Jmsg(NULL, M_ERROR, 0,
+ _("No Changer Command given for device %s. Cannot continue.\n"),
+ device->hdr.name);
+ OK = false;
+ }
+
+ if (media_type == NULL) {
+ media_type = device->media_type; /* get Media Type of first device */
+ continue;
+ }
+ /* Ensure that other devices Media Types are the same */
+ if (strcmp(media_type, device->media_type) != 0) {
+ Jmsg(NULL, M_ERROR, 0,
+ _("Media Type not the same for all devices in changer %s. Cannot continue.\n"),
+ changer->hdr.name);
+ OK = false;
+ continue;
+ }
+ }
+ }
+ return OK;
+}
+
+
/*
* Called here to do an autoload using the autochanger, if
* configured, and if a Slot has been defined for this Volume.
jcr->fileset_md5 = get_pool_memory(PM_FNAME);
pm_strcpy(jcr->fileset_md5, "Dummy.fileset.md5");
+ init_autochangers();
+
dcr = setup_to_access_device(jcr, dev_name, VolumeName, mode);
if (!dcr) {
return NULL;
int authenticate_filed(JCR *jcr);
/* From autochanger.c */
+bool init_autochangers();
int autoload_device(DCR *dcr, int writing, BSOCK *dir);
bool autochanger_cmd(DCR *dcr, BSOCK *dir, const char *cmd);
bool unload_autochanger(DCR *dcr, int loaded);
static int check_resources()
{
bool OK = true;
- AUTOCHANGER *changer;
me = (STORES *)GetNextRes(R_STORAGE, NULL);
}
}
- /* Ensure that the media_type for each device is the same */
- foreach_res(changer, R_AUTOCHANGER) {
- DEVRES *device;
- char *media_type = NULL;
- foreach_alist(device, changer->device) {
- /*
- * If the device does not have a changer name or changer command
- * defined, used the one from the Autochanger resource
- */
- if (!device->changer_name && changer->changer_name) {
- device->changer_name = bstrdup(changer->changer_name);
- }
- if (!device->changer_command && changer->changer_command) {
- device->changer_command = bstrdup(changer->changer_command);
- }
- if (!device->changer_name) {
- Jmsg(NULL, M_ERROR, 0,
- _("No Changer Name given for device %s. Cannot continue.\n"),
- device->hdr.name);
- OK = false;
- }
- if (!device->changer_command) {
- Jmsg(NULL, M_ERROR, 0,
- _("No Changer Command given for device %s. Cannot continue.\n"),
- device->hdr.name);
- OK = false;
- }
+ OK = init_autochangers();
- if (media_type == NULL) {
- media_type = device->media_type; /* get Media Type of first device */
- continue;
- }
- /* Ensure that other devices Media Types are the same */
- if (strcmp(media_type, device->media_type) != 0) {
- Jmsg(NULL, M_ERROR, 0,
- _("Media Type not the same for all devices in changer %s. Cannot continue.\n"),
- changer->hdr.name);
- OK = false;
- continue;
- }
- }
- }
if (OK) {
close_msg(NULL); /* close temp message handler */
*/
#undef VERSION
-#define VERSION "1.37.41"
+#define VERSION "1.37.42"
#define BDATE "22 October 2005"
#define LSMDATE "22Oct05"