]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/read.c
Allow plugin to skip restore if problem
[bacula/bacula] / bacula / src / stored / read.c
index aa0ae705678794ce70fffa1fd48a80af06c4628c..fc61193b9b35b769b4f8597f54be23f670eaff16 100644 (file)
@@ -1,12 +1,12 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2010 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    This program is Free Software; you can redistribute it and/or
-   modify it under the terms of version two of the GNU General Public
+   modify it under the terms of version three of the GNU Affero General Public
    License as published by the Free Software Foundation and included
    in the file LICENSE.
 
@@ -15,7 +15,7 @@
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
+   You should have received a copy of the GNU Affero General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
@@ -30,7 +30,6 @@
  *
  *     Kern Sibbald, November MM
  *
- *   Version $Id$
  */
 
 #include "bacula.h"
@@ -62,11 +61,8 @@ bool do_read_data(JCR *jcr)
       return false;
    }
 
-
-   create_restore_volume_list(jcr);
    if (jcr->NumReadVolumes == 0) {
       Jmsg(jcr, M_FATAL, 0, _("No Volume names found for restore.\n"));
-      free_restore_volume_list(jcr);
       fd->fsend(FD_error);
       return false;
    }
@@ -76,13 +72,13 @@ bool do_read_data(JCR *jcr)
 
    /* Ready device for reading */
    if (!acquire_device_for_read(dcr)) {
-      free_restore_volume_list(jcr);
       fd->fsend(FD_error);
       return false;
    }
 
    /* Tell File daemon we will send data */
    fd->fsend(OK_data);
+   set_jcr_job_status(jcr, JS_Running);
    ok = read_records(dcr, record_cb, mount_next_read_volume);
 
    /* Send end of data to FD */
@@ -92,7 +88,6 @@ bool do_read_data(JCR *jcr)
       ok = false;
    }
 
-   free_restore_volume_list(jcr);
    Dmsg0(30, "Done reading.\n");
    return ok;
 }