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
- License as published by the Free Software Foundation plus additions
- that are listed in the file LICENSE.
+ License as published by the Free Software Foundation and included
+ in the file LICENSE.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
db_make_inchanger_unique(ua->jcr, ua->db, &mr);
db_unlock(ua->db);
if (!vl->VolName) {
- Dmsg1(000, "No VolName for Slot=%d setting InChanger to zero.\n", vl->Slot);
+ Dmsg1(100, "No VolName for Slot=%d setting InChanger to zero.\n", vl->Slot);
ua->info_msg(_("No VolName for Slot=%d InChanger set to zero.\n"), vl->Slot);
continue;
}
i = find_arg_with_value(ua, "slot");
if (i >= 0) {
mr.Slot = atoi(ua->argv[i]);
- mr.InChanger = 1; /* assumed if we are labeling it */
+ if (mr.Slot < 0) {
+ mr.Slot = 0;
+ }
+ mr.InChanger = mr.Slot > 0; /* if slot give assume in changer */
} else if (store.store->autochanger) {
if (!get_pint(ua, _("Enter slot (0 or Enter for none): "))) {
return 1;
}
mr.Slot = ua->pint32_val;
- mr.InChanger = 1; /* assumed if we are labeling it */
+ if (mr.Slot < 0) {
+ mr.Slot = 0;
+ }
+ mr.InChanger = mr.Slot > 0; /* if slot give assume in changer */
}
mr.StorageId = store.store->StorageId;
}
ua->send_msg("%4d %s\n", vl->Slot, vl->VolName);
}
- if (!get_yesno(ua, _("Do you want to continue? (yes|no): ")) ||
+ if (!get_yesno(ua, _("Do you want to label these Volumes? (yes|no): ")) ||
(ua->pint32_val == 0)) {
goto bail_out;
}
ua->warning_msg(_("Media record for Slot %d Volume \"%s\" already exists.\n"),
vl->Slot, mr.VolumeName);
mr.Slot = vl->Slot;
- mr.InChanger = 1;
+ mr.InChanger = mr.Slot > 0; /* if slot give assume in changer */
mr.StorageId = store->StorageId;
if (!db_update_media_record(ua->jcr, ua->db, &mr)) {
ua->error_msg(_("Error setting InChanger: ERR=%s"), db_strerror(ua->db));
}
media_record_exists = true;
}
- mr.InChanger = 1;
+ mr.InChanger = mr.Slot > 0; /* if slot give assume in changer */
mr.StorageId = store->StorageId;
/*
* Deal with creating cleaning tape here. Normal tapes created in
if (ok) {
if (media_record_exists) { /* we update it */
mr->VolBytes = VolBytes;
- mr->InChanger = 1;
+ mr->InChanger = mr->Slot > 0; /* if slot give assume in changer */
mr->StorageId = ua->jcr->wstore->StorageId;
if (!db_update_media_record(ua->jcr, ua->db, mr)) {
ua->error_msg("%s", db_strerror(ua->db));
} else { /* create the media record */
set_pool_dbr_defaults_in_media_dbr(mr, pr);
mr->VolBytes = VolBytes;
- mr->InChanger = 1;
+ mr->InChanger = mr->Slot > 0; /* if slot give assume in changer */
mr->StorageId = ua->jcr->wstore->StorageId;
mr->Enabled = 1;
if (db_create_media_record(ua->jcr, ua->db, mr)) {