]> git.sur5r.net Git - bacula/bacula/commitdiff
kes Apply patch supplied in bug #656 to pass priority field
authorKern Sibbald <kern@sibbald.com>
Thu, 7 Sep 2006 11:52:20 +0000 (11:52 +0000)
committerKern Sibbald <kern@sibbald.com>
Thu, 7 Sep 2006 11:52:20 +0000 (11:52 +0000)
     in the run dialog to the Director.
kes  Restore DCR after VOL_NAME_ERROR in mount.c.  Hopefully
     this will fix bug #627 where Bacula eventually gets
     confused about what Volume it wants.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3425 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/gnome2-console/callbacks.c
bacula/src/stored/mount.c
bacula/src/version.h
bacula/technotes-1.39

index 136d05c8bd46cf8c8585e75984bcd3afca718f55..e978f7aa6d68b210aae6c50664e2604ccb5115ec 100644 (file)
@@ -1,3 +1,16 @@
+/*
+   Copyright (C) 2000-2006 Kern Sibbald
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License
+   version 2 as amended with additional clauses defined in the
+   file LICENSE in the main source directory.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+   the file LICENSE for additional details.
+ */
 /*
  *    Version $Id$
  */
@@ -383,8 +396,8 @@ static char *get_spin_text(GtkWidget *dialog, const char *spin_name)
 void
 on_run_ok_clicked(GtkButton *button, gpointer user_data)
 {
-   char *job, *fileset, *level, *client, *pool, *when, *where, *storage;
-
+   char *job, *fileset, *level, *client, *pool, *when, *where, *storage, *priority;
+   
    gtk_widget_hide(run_dialog);
    gtk_main_quit();
 
@@ -394,20 +407,20 @@ on_run_ok_clicked(GtkButton *button, gpointer user_data)
    pool    = get_combo_text(run_dialog, "combo_pool");
    storage = get_combo_text(run_dialog, "combo_storage");
    level   = get_combo_text(run_dialog, "combo_level");
-
+   priority = get_spin_text(run_dialog, "spinbutton1");
    when    = get_entry_text(run_dialog, "entry_when");
    where   = get_entry_text(run_dialog, "entry_where");
 
    if (!job || !fileset || !client || !pool || !storage ||
-       !level || !when || !where) {
+       !level || !priority || !when || !where) {
       set_status_ready();
       return;
    }
 
    bsnprintf(cmd, sizeof(cmd),
              "run job=\"%s\" fileset=\"%s\" level=%s client=\"%s\" pool=\"%s\" "
-             "when=\"%s\" where=\"%s\" storage=\"%s\"",
-             job, fileset, level, client, pool, when, where, storage);
+             "when=\"%s\" where=\"%s\" storage=\"%s\" priority=\"%s\"",
+             job, fileset, level, client, pool, when, where, storage, priority);
    write_director(cmd);
    set_text(cmd, strlen(cmd));
    write_director("yes");
index 61443a6e7f8370fbc5926024fca8628b11820f1e..e6b97fa76026728417e313ba9b61a481d0370dea 100644 (file)
@@ -216,7 +216,7 @@ read_volume:
       recycle = strcmp(dev->VolCatInfo.VolCatStatus, "Recycle") == 0;
       break;                    /* got a Volume */
    case VOL_NAME_ERROR:
-      VOLUME_CAT_INFO VolCatInfo, devVolCatInfo;
+      VOLUME_CAT_INFO dcrVolCatInfo, devVolCatInfo;
 
       /* If not removable, Volume is broken */
       if (!dev->is_removable()) {
@@ -239,7 +239,7 @@ read_volume:
        *  this volume is really OK. If not, put back the desired
        *  volume name, mark it not in changer and continue.
        */
-      memcpy(&VolCatInfo, &dcr->VolCatInfo, sizeof(VolCatInfo));
+      memcpy(&dcrVolCatInfo, &dcr->VolCatInfo, sizeof(dcrVolCatInfo));
       memcpy(&devVolCatInfo, &dev->VolCatInfo, sizeof(devVolCatInfo));
       /* Check if this is a valid Volume in the pool */
       bstrncpy(dcr->VolumeName, dev->VolHdr.VolumeName, sizeof(dcr->VolumeName));
@@ -248,6 +248,11 @@ read_volume:
          /* This gets the info regardless of the Pool */
          bstrncpy(dcr->VolumeName, dev->VolHdr.VolumeName, sizeof(dcr->VolumeName));
          if (autochanger && !dir_get_volume_info(dcr, GET_VOL_INFO_FOR_READ)) {
+            /*
+             * If we get here, we know we cannot write on the Volume,
+             *  and we know that we cannot read it either, so it 
+             *  is not in the autochanger.
+             */
             mark_volume_not_inchanger(dcr);
          }
          memcpy(&dev->VolCatInfo, &devVolCatInfo, sizeof(dev->VolCatInfo));
@@ -255,12 +260,15 @@ read_volume:
          Jmsg(jcr, M_WARNING, 0, _("Director wanted Volume \"%s\".\n"
               "    Current Volume \"%s\" not acceptable because:\n"
               "    %s"),
-             VolCatInfo.VolCatName, dev->VolHdr.VolumeName,
+             dcrVolCatInfo.VolCatName, dev->VolHdr.VolumeName,
              jcr->dir_bsock->msg);
          ask = true;
+         /* Restore saved DCR before continuing */
+         memcpy(&dcr->VolCatInfo, &dcrVolCatInfo, sizeof(dcr->VolCatInfo));
          goto mount_next_vol;
       }
-      /* This was not the volume we expected, but it is OK with
+      /*
+       * This was not the volume we expected, but it is OK with
        * the Director, so use it.
        */
       Dmsg1(150, "want new name=%s\n", dcr->VolumeName);
index 5f68f53358384c7a720f1e5a46fa53ab95eebea0..76823605422ee3d962913c7f3442288e88c4b4fb 100644 (file)
@@ -4,8 +4,8 @@
 
 #undef  VERSION
 #define VERSION "1.39.22"
-#define BDATE   "06 Septermber 2006"
-#define LSMDATE "06Sep06"
+#define BDATE   "07 Septermber 2006"
+#define LSMDATE "07Sep06"
 #define BYEAR "2006"       /* year for copyright messages in progs */
 
 /* Debug flags */
index 3abf44e4412909baf3a126c05985a0cc6f919c1b..ce49b3a54fd35bf62597fe71df9dd5d1ff52a5ee 100644 (file)
@@ -2,6 +2,11 @@
 
 General:
 07Sep06
+kes  Apply patch supplied in bug #656 to pass priority field
+     in the run dialog to the Director.
+kes  Restore DCR after VOL_NAME_ERROR in mount.c.  Hopefully
+     this will fix bug #627 where Bacula eventually gets 
+     confused about what Volume it wants.
 kes  Add a new close_part() class in the SD to save the device
      state around open/close_part/open for DVD writing.  This
      should fix the num_dvd_parts getting zeroed as reported by