src/stored/vol_mgr.c
void list_volumes(void sendit(const char *msg, int len, void *sarg), void *arg)
{
   VOLRES *vol;
   POOL_MEM msg(PM_MESSAGE);
   int len;

   foreach_vol(vol) {
      DEVICE *dev = vol->dev;
      if (dev) {
         len = Mmsg(msg, "Reserved volume: %s on %s device %s\n", vol->vol_name,
                  dev->print_type(), dev->print_name());
         sendit(msg.c_str(), len, arg);
         len = Mmsg(msg, "    Reader=%d writers=%d reserves=%d volinuse=%d worm=%d\n",
            dev->can_read()?1:0, dev->num_writers, dev->num_reserved(),
            vol->is_in_use(), dev->is_worm());
         sendit(msg.c_str(), len, arg);
      } else {
         len = Mmsg(msg, "Volume %s no device. volinuse=%d\n", vol->vol_name,
            vol->is_in_use());
         sendit(msg.c_str(), len, arg);
      }
   }
   endeach_vol(vol);

   lock_read_volumes();
   foreach_dlist(vol, read_vol_list) {
      DEVICE *dev = vol->dev;
      if (dev) {
         len = Mmsg(msg, "Read volume: %s on %s device %s\n", vol->vol_name,
                  dev->print_type(), dev->print_name());
         sendit(msg.c_str(), len, arg);
         len = Mmsg(msg, "    Reader=%d writers=%d reserves=%d volinuse=%d JobId=%d\n",
            dev->can_read()?1:0, dev->num_writers, dev->num_reserved(),
            vol->is_in_use(), vol->get_jobid());
         sendit(msg.c_str(), len, arg);
      } else {
         len = Mmsg(msg, "Volume: %s no device. volinuse=%d\n", vol->vol_name,
            vol->is_in_use());
         sendit(msg.c_str(), len, arg);
      }
   }
   unlock_read_volumes();
}
/*
 * List Volumes -- this should be moved to status.c
 */
List Volumes -- this should be moved to status.c
List Volumes -- this should be moved to status . c
void list_volumes(void sendit(const char *msg, int len, void *sarg), void *arg)
{
   VOLRES *vol;
   POOL_MEM msg(PM_MESSAGE);
   int len;
   foreach_vol(vol) {
      DEVICE *dev = vol->dev;
      if (dev) {
         len = Mmsg(msg, "Reserved volume: %s on %s device %s\n", vol->vol_name,
                  dev->print_type(), dev->print_name());
         sendit(msg.c_str(), len, arg);
         len = Mmsg(msg, "    Reader=%d writers=%d reserves=%d volinuse=%d worm=%d\n",
            dev->can_read()?1:0, dev->num_writers, dev->num_reserved(),
            vol->is_in_use(), dev->is_worm());
         sendit(msg.c_str(), len, arg);
      } else {
         len = Mmsg(msg, "Volume %s no device. volinuse=%d\n", vol->vol_name,
            vol->is_in_use());
         sendit(msg.c_str(), len, arg);
      }
   }
   endeach_vol(vol);
   lock_read_volumes();
   foreach_dlist(vol, read_vol_list) {
      DEVICE *dev = vol->dev;
      if (dev) {
         len = Mmsg(msg, "Read volume: %s on %s device %s\n", vol->vol_name,
                  dev->print_type(), dev->print_name());
         sendit(msg.c_str(), len, arg);
         len = Mmsg(msg, "    Reader=%d writers=%d reserves=%d volinuse=%d JobId=%d\n",
            dev->can_read()?1:0, dev->num_writers, dev->num_reserved(),
            vol->is_in_use(), vol->get_jobid());
         sendit(msg.c_str(), len, arg);
      } else {
         len = Mmsg(msg, "Volume: %s no device. volinuse=%d\n", vol->vol_name,
            vol->is_in_use());
         sendit(msg.c_str(), len, arg);
      }
   }
   unlock_read_volumes();
}
void list_volumes ( void sendit ( const char * msg , int len , void * sarg ) , void * arg ) { VOLRES * vol ; POOL_MEM msg ( PM_MESSAGE ) ; int len ; foreach_vol ( vol ) { DEVICE * dev = vol -> dev ; if ( dev ) { len = Mmsg ( msg , " \n " , vol -> vol_name , dev -> print_type ( ) , dev -> print_name ( ) ) ; sendit ( msg . c_str ( ) , len , arg ) ; len = Mmsg ( msg , " \n " , dev -> can_read ( ) ? 1 : 0 , dev -> num_writers , dev -> num_reserved ( ) , vol -> is_in_use ( ) , dev -> is_worm ( ) ) ; sendit ( msg . c_str ( ) , len , arg ) ; } else { len = Mmsg ( msg , " \n " , vol -> vol_name , vol -> is_in_use ( ) ) ; sendit ( msg . c_str ( ) , len , arg ) ; } } endeach_vol ( vol ) ; lock_read_volumes ( ) ; foreach_dlist ( vol , read_vol_list ) { DEVICE * dev = vol -> dev ; if ( dev ) { len = Mmsg ( msg , " \n " , vol -> vol_name , dev -> print_type ( ) , dev -> print_name ( ) ) ; sendit ( msg . c_str ( ) , len , arg ) ; len = Mmsg ( msg , " \n " , dev -> can_read ( ) ? 1 : 0 , dev -> num_writers , dev -> num_reserved ( ) , vol -> is_in_use ( ) , vol -> get_jobid ( ) ) ; sendit ( msg . c_str ( ) , len , arg ) ; } else { len = Mmsg ( msg , " \n " , vol -> vol_name , vol -> is_in_use ( ) ) ; sendit ( msg . c_str ( ) , len , arg ) ; } } unlock_read_volumes ( ) ; }
List Volumes -- this should be moved to status.c
List Volumes -- this should be moved to status . c