- Release Notes for Bacula 1.34.0
+ Release Notes for Bacula 1.34.1
Bacula code: Total files = 306 Total lines = 91,131 (*.h *.c *.in)
+Changes for 1.34.1:
+- Autochanger users, please note you must add %d to the end of the
+ changer command line in your Device resource in your bacula-sd.conf
+ file.
+- Fixed a crash in the query command.
+- Removed the schedule from the default restore job.
+
+Release 1.34.0
Major Features:
- Data spooling which reduces tape shoe-shine during Inc backups,
and permits multiple simultaneous backups without interleaved blocks.
*
*/
/*
- Copyright (C) 2000, 2001 Kern Sibbald and John Walker
+ Copyright (C) 2001-2004 Kern Sibbald and John Walker
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
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
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ You should have received a copy of the GNU General Public
+ License along with this program; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ MA 02111-1307, USA.
*/
#include "bacula.h"
Client=@hostname@-fd
FileSet="Full Set"
Storage = File
+ Pool = Default
Messages = Standard
Where = /tmp/bacula-restores
}
extern DIRRES *director;
-static char *substitute_prompts(UAContext *ua,
- char *query, char **prompt, int nprompt);
+static POOLMEM *substitute_prompts(UAContext *ua,
+ POOLMEM *query, char **prompt, int nprompt);
/*
* Read a file containing SQL queries and prompt
*/
int querycmd(UAContext *ua, char *cmd)
{
- FILE *fd;
+ FILE *fd = NULL;
POOLMEM *query = get_pool_memory(PM_MESSAGE);
char line[1000];
int i, item, len;
char *prompt[9];
- int nprompt;
+ int nprompt = 0;;
char *query_file = director->query_file;
if (!open_db(ua)) {
- free_pool_memory(query);
- return 1;
+ goto bail_out;
}
if ((fd=fopen(query_file, "r")) == NULL) {
bsendmsg(ua, "Could not open %s: ERR=%s\n", query_file,
strerror(errno));
- free_pool_memory(query);
- return 1;
+ goto bail_out;
}
start_prompt(ua, _("Available queries:\n"));
}
}
if ((item=do_prompt(ua, "", _("Choose a query"), NULL, 0)) < 0) {
- fclose(fd);
- free_pool_memory(query);
- return 1;
+ goto bail_out;
}
rewind(fd);
i = -1;
}
if (i != item) {
bsendmsg(ua, _("Could not find query.\n"));
- fclose(fd);
- free_pool_memory(query);
- return 1;
+ goto bail_out;
}
query[0] = 0;
for (i=0; i<9; i++) {
prompt[i] = NULL;
}
- nprompt = 0;
while (fgets(line, sizeof(line), fd) != NULL) {
if (line[0] == '#') {
continue;
continue;
}
}
- query = check_pool_memory_size(query, len + 1);
if (*query != 0) {
- strcat(query, " ");
+ pm_strcat(&query, " ");
}
- strcat(query, line);
+ pm_strcat(&query, line);
if (line[len-1] != ';') {
continue;
}
bsendmsg(ua, "%s\n", query);
}
}
+
+bail_out:
+ if (fd) {
+ fclose(fd);
+ }
free_pool_memory(query);
for (i=0; i<nprompt; i++) {
free(prompt[i]);
}
static POOLMEM *substitute_prompts(UAContext *ua,
- char *query, char **prompt, int nprompt)
+ POOLMEM *query, char **prompt, int nprompt)
{
char *p, *q, *o;
POOLMEM *new_query;
* so that the memory is allocated through smartalloc.
*/
+#ifdef xxx
void * operator new(size_t size)
{
// Dmsg1(000, "new called %d\n", size);
// Dmsg1(000, "free called 0x%x\n", buf);
sm_free(__FILE__, __LINE__, buf);
}
+#endif
#endif
if (spool_stats.data_size < 0) {
spool_stats.data_size = 0;
}
+ jcr->dcr->spool_size = 0;
V(mutex);
make_unique_data_spool_filename(jcr, &name);
dcr->spooling = false;
lock_device(dcr->dev);
dcr->dev_locked = true;
- /* Set up a dev structure to read */
+
+ /* Setup a dev structure to read */
rdev = (DEVICE *)malloc(sizeof(DEVICE));
memset(rdev, 0, sizeof(DEVICE));
rdev->dev_name = get_memory(strlen("spool")+1);
strcpy(rdev->dev_name, "spool");
rdev->errmsg = get_pool_memory(PM_EMSG);
*rdev->errmsg = 0;
+ rdev->max_block_size = dcr->dev->max_block_size;
+ rdev->min_block_size = dcr->dev->min_block_size;
rdev->device = dcr->dev->device;
rdcr = new_dcr(NULL, rdev);
rdcr->spool_fd = dcr->spool_fd;
rdcr->jcr = jcr; /* set a valid jcr */
block = rdcr->block;
+ Dmsg1(800, "read/write block size = %d\n", block->buf_len);
lseek(rdcr->spool_fd, 0, SEEK_SET); /* rewind */
for ( ; ok; ) {