src/filed/fd_snapshot.c
bool open_snapshot_backup_session(JCR *jcr)
{
   if (!is_snapshot_supported(jcr)) {
      Dmsg0(DT_SNAPSHOT, "Snapshot not supported\n");
      return false;
   }

   jcr->snap_mgr = New(snapshot_manager(jcr));
   /* Get all volumes and subvolumes */
   if (!jcr->snap_mgr->scan_mtab()) {
      berrno be;                /* error probably in errno */
      Dmsg1(DT_SNAPSHOT, "Unable to scan mtab. ERR=%s\n", be.bstrerror());
      Jmsg(jcr, M_ERROR, 0, "Unable to scan mtab to determine devices to snapshot\n");
      return false;
   }
   /* Match the volume list with the fileset */
   if (!jcr->snap_mgr->scan_fileset()) {
      Jmsg(jcr, M_ERROR,0, "Unable to scan fileset to determine devices to snapshot\n");
      return false;
   }
   /* Create fileset needed */
   if (!jcr->snap_mgr->create_snapshots()) {
      /* Error message already displayed if needed */
      return false;
   }
   return true;                 /* We should have some snapshots */
}
/* Initialize the snapshot manager at the begining of the
 * job and create snapshots
 */
Initialize the snapshot manager at the begining of the
job and create snapshots
Initialize the snapshot manager at the begining of the job and create snapshots
bool open_snapshot_backup_session(JCR *jcr)
{
   if (!is_snapshot_supported(jcr)) {
      Dmsg0(DT_SNAPSHOT, "Snapshot not supported\n");
      return false;
   }
   jcr->snap_mgr = New(snapshot_manager(jcr));
   if (!jcr->snap_mgr->scan_mtab()) {
      berrno be;                
      Dmsg1(DT_SNAPSHOT, "Unable to scan mtab. ERR=%s\n", be.bstrerror());
      Jmsg(jcr, M_ERROR, 0, "Unable to scan mtab to determine devices to snapshot\n");
      return false;
   }
   if (!jcr->snap_mgr->scan_fileset()) {
      Jmsg(jcr, M_ERROR,0, "Unable to scan fileset to determine devices to snapshot\n");
      return false;
   }
   if (!jcr->snap_mgr->create_snapshots()) {
      return false;
   }
   return true;                 
}
bool open_snapshot_backup_session ( JCR * jcr ) { if ( ! is_snapshot_supported ( jcr ) ) { Dmsg0 ( DT_SNAPSHOT , " \n " ) ; return false ; } jcr -> snap_mgr = New ( snapshot_manager ( jcr ) ) ; if ( ! jcr -> snap_mgr -> scan_mtab ( ) ) { berrno be ; Dmsg1 ( DT_SNAPSHOT , " \n " , be . bstrerror ( ) ) ; Jmsg ( jcr , M_ERROR , 0 , " \n " ) ; return false ; } if ( ! jcr -> snap_mgr -> scan_fileset ( ) ) { Jmsg ( jcr , M_ERROR , 0 , " \n " ) ; return false ; } if ( ! jcr -> snap_mgr -> create_snapshots ( ) ) { return false ; } return true ; }
Initialize the snapshot manager at the begining of the
 job and create snapshots
Initialize the snapshot manager at the begining of the job and create snapshots
/* Get all volumes and subvolumes */ /* error probably in errno */ /* Match the volume list with the fileset */ /* Create fileset needed */ /* Error message already displayed if needed */ /* We should have some snapshots */