From: Kern Sibbald Date: Thu, 7 Sep 2006 11:52:20 +0000 (+0000) Subject: kes Apply patch supplied in bug #656 to pass priority field X-Git-Tag: Release-2.0.0~492 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d1531d768c0399511628291a3b2db81721f93d7f;p=bacula%2Fbacula 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. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3425 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/gnome2-console/callbacks.c b/bacula/src/gnome2-console/callbacks.c index 136d05c8bd..e978f7aa6d 100644 --- a/bacula/src/gnome2-console/callbacks.c +++ b/bacula/src/gnome2-console/callbacks.c @@ -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"); diff --git a/bacula/src/stored/mount.c b/bacula/src/stored/mount.c index 61443a6e7f..e6b97fa760 100644 --- a/bacula/src/stored/mount.c +++ b/bacula/src/stored/mount.c @@ -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); diff --git a/bacula/src/version.h b/bacula/src/version.h index 5f68f53358..7682360542 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -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 */ diff --git a/bacula/technotes-1.39 b/bacula/technotes-1.39 index 3abf44e441..ce49b3a54f 100644 --- a/bacula/technotes-1.39 +++ b/bacula/technotes-1.39 @@ -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