if (!store) {
return;
}
- set_storage(ua->jcr, store);
+ set_wstorage(ua->jcr, store);
drive = get_storage_drive(ua, store);
scan = find_arg(ua, NT_("scan")) >= 0;
if (!store) {
return 1;
}
- set_storage(ua->jcr, store);
+ set_wstorage(ua->jcr, store);
drive = get_storage_drive(ua, store);
if (label_barcodes) {
*/
static void label_from_barcodes(UAContext *ua, int drive)
{
- STORE *store = ua->jcr->store;
+ STORE *store = ua->jcr->wstore;
POOL_DBR pr;
MEDIA_DBR mr, omr;
vol_list_t *vl, *vol_list = NULL;
}
bsendmsg(ua, "%4d %s\n", vl->Slot, vl->VolName);
}
- if (!get_cmd(ua, _("Do you want to continue? (y/n): ")) ||
- (ua->cmd[0] != 'y' && ua->cmd[0] != 'Y')) {
+ if (!get_yesno(ua, _("Do you want to continue? (yes|no): ")) ||
+ (ua->pint32_val == 0)) {
goto bail_out;
}
/* Select a pool */
if (!(sd=open_sd_bsock(ua))) {
return false;
}
- bstrncpy(dev_name, ua->jcr->store->dev_name(), sizeof(dev_name));
+ bstrncpy(dev_name, ua->jcr->wstore->dev_name(), sizeof(dev_name));
bash_spaces(dev_name);
bash_spaces(mr->VolumeName);
bash_spaces(mr->MediaType);
if (media_record_exists) { /* we update it */
mr->VolBytes = 1;
mr->InChanger = 1;
- mr->StorageId = ua->jcr->store->StorageId;
+ mr->StorageId = ua->jcr->wstore->StorageId;
if (!db_update_media_record(ua->jcr, ua->db, mr)) {
bsendmsg(ua, "%s", db_strerror(ua->db));
ok = false;
set_pool_dbr_defaults_in_media_dbr(mr, pr);
mr->VolBytes = 1; /* flag indicating Volume labeled */
mr->InChanger = 1;
- mr->StorageId = ua->jcr->store->StorageId;
+ mr->StorageId = ua->jcr->wstore->StorageId;
+ mr->Enabled = 1;
if (db_create_media_record(ua->jcr, ua->db, mr)) {
bsendmsg(ua, _("Catalog record for Volume \"%s\", Slot %d successfully created.\n"),
mr->VolumeName, mr->Slot);
static BSOCK *open_sd_bsock(UAContext *ua)
{
- STORE *store = ua->jcr->store;
+ STORE *store = ua->jcr->wstore;
if (!ua->jcr->store_bsock) {
bsendmsg(ua, _("Connecting to Storage daemon %s at %s:%d ...\n"),
- store->hdr.name, store->address, store->SDport);
+ store->name(), store->address, store->SDport);
if (!connect_to_storage_daemon(ua->jcr, 10, SDConnectTimeout, 1)) {
bsendmsg(ua, _("Failed to connect to Storage daemon.\n"));
return NULL;
static char *get_volume_name_from_SD(UAContext *ua, int Slot, int drive)
{
- STORE *store = ua->jcr->store;
+ STORE *store = ua->jcr->wstore;
BSOCK *sd;
char dev_name[MAX_NAME_LENGTH];
char *VolName = NULL;
*/
static vol_list_t *get_vol_list_from_SD(UAContext *ua, bool scan)
{
- STORE *store = ua->jcr->store;
+ STORE *store = ua->jcr->wstore;
char dev_name[MAX_NAME_LENGTH];
BSOCK *sd;
vol_list_t *vl;
*/
static int get_num_slots_from_SD(UAContext *ua)
{
- STORE *store = ua->jcr->store;
+ STORE *store = ua->jcr->wstore;
char dev_name[MAX_NAME_LENGTH];
BSOCK *sd;
int slots = 0;
*/
int get_num_drives_from_SD(UAContext *ua)
{
- STORE *store = ua->jcr->store;
+ STORE *store = ua->jcr->wstore;
char dev_name[MAX_NAME_LENGTH];
BSOCK *sd;
int drives = 0;
/* Find Pool resource */
ua->jcr->pool = (POOL *)GetResWithName(R_POOL, pr->Name);
if (!ua->jcr->pool) {
- bsendmsg(ua, _("Pool \"%s\" resource not found!\n"), pr->Name);
- return true;
+ bsendmsg(ua, _("Pool \"%s\" resource not found for volume \"%s\"!\n"),
+ pr->Name, mr->VolumeName);
+ return false;
}
if (ua->jcr->pool->cleaning_prefix == NULL) {
return false;