if (strcmp(vol->vol_name, VolumeName) == 0) {
Dmsg2(dbglvl, "=== set reserved vol=%s dev=%s\n", VolumeName,
vol->dev->print_name());
- vol->set_in_use(); /* retake vol if released previously */
- dcr->reserved_volume = true; /* reserved volume */
goto get_out; /* Volume already on this device */
} else {
/* Don't release a volume if it was reserved by someone other than us */
}
if (dev->vol->is_swapping()) {
Dmsg1(dbglvl, "vol_unused: vol being swapped on %s\n", dev->print_name());
- debug_list_volumes("swapping vol cannot unreserve_volume");
+ Dmsg1(dbglvl, "=== clear in_use vol=%s\n", dev->vol->vol_name);
+ dev->vol->clear_in_use();
+ debug_list_volumes("swapping vol cannot free_volume");
return false;
}
-#ifdef xxx
- if (dev->is_busy()) {
- Dmsg1(dbglvl, "vol_unused: busy on %s\n", dev->print_name());
- debug_list_volumes("dev busy cannot unreserve_volume");
- return false;
- }
-#endif
-#ifdef xxx
- if (dev->num_writers > 0 || dev->num_reserved() > 0) {
- ASSERT(0);
- }
-#endif
-
/*
* If this is a tape, we do not free the volume, rather we wait
* until the autoloader unloads it, or until another tape is
*/
Dmsg4(dbglvl, "=== set not reserved vol=%s num_writers=%d dev_reserved=%d dev=%s\n",
dev->vol->vol_name, dev->num_writers, dev->num_reserved(), dev->print_name());
+ Dmsg1(dbglvl, "=== clear in_use vol=%s\n", dev->vol->vol_name);
dev->vol->clear_in_use();
if (dev->is_tape() || dev->is_autochanger()) {
return true;
vol = dev->vol;
/* Don't free a volume while it is being swapped */
if (!vol->is_swapping()) {
+ Dmsg1(dbglvl, "=== clear in_use vol=%s\n", dev->vol->vol_name);
dev->vol = NULL;
vol_list->remove(vol);
Dmsg2(dbglvl, "=== remove volume %s dev=%s\n", vol->vol_name, dev->print_name());