ok = db_find_next_volume(jcr, jcr->db, index, InChanger, mr);
if (!ok) {
ok = db_find_next_volume(jcr, jcr->db, index, InChanger, mr);
if (!ok) {
ok, index, InChanger, mr->VolStatus);
/*
* 2. Try finding a recycled volume
ok, index, InChanger, mr->VolStatus);
/*
* 2. Try finding a recycled volume
ok, index, InChanger, mr->VolStatus);
/*
* 5. Try pulling a volume from the Scratch pool
*/
ok = get_scratch_volume(jcr, InChanger, mr);
ok, index, InChanger, mr->VolStatus);
/*
* 5. Try pulling a volume from the Scratch pool
*/
ok = get_scratch_volume(jcr, InChanger, mr);
+ Dmsg4(150, "after get scratch volume ok=%d index=%d InChanger=%d Vstat=%s\n",
+ ok, index, InChanger, mr->VolStatus);
}
/*
* If we are using an Autochanger and have not found
* a volume, retry looking for any volume.
*/
}
/*
* If we are using an Autochanger and have not found
* a volume, retry looking for any volume.
*/
jcr->pool->purge_oldest_volume, jcr->pool->recycle_oldest_volume);
/* Find oldest volume to recycle */
ok = db_find_next_volume(jcr, jcr->db, -1, InChanger, mr);
jcr->pool->purge_oldest_volume, jcr->pool->recycle_oldest_volume);
/* Find oldest volume to recycle */
ok = db_find_next_volume(jcr, jcr->db, -1, InChanger, mr);
if (!db_update_media_record(jcr, jcr->db, mr)) {
Jmsg(jcr, M_ERROR, 0, _("Catalog error updating volume \"%s\". ERR=%s"),
mr->VolumeName, db_strerror(jcr->db));
}
}
if (!db_update_media_record(jcr, jcr->db, mr)) {
Jmsg(jcr, M_ERROR, 0, _("Catalog error updating volume \"%s\". ERR=%s"),
mr->VolumeName, db_strerror(jcr->db));
}
}
/* Check if a duration or limit has expired */
if (has_volume_expired(jcr, mr)) {
*reason = _("volume has expired");
/* Check if a duration or limit has expired */
if (has_volume_expired(jcr, mr)) {
*reason = _("volume has expired");
*/
memset(&spr, 0, sizeof(spr));
bstrncpy(spr.Name, "Scratch", sizeof(spr.Name));
*/
memset(&spr, 0, sizeof(spr));
bstrncpy(spr.Name, "Scratch", sizeof(spr.Name));
if (db_get_pool_record(jcr, jcr->db, &spr)) {
memset(&smr, 0, sizeof(smr));
smr.PoolId = spr.PoolId;
if (db_get_pool_record(jcr, jcr->db, &spr)) {
memset(&smr, 0, sizeof(smr));
smr.PoolId = spr.PoolId;