From: Kern Sibbald Date: Sun, 6 Oct 2002 19:28:44 +0000 (+0000) Subject: Update doc -- minor changes to btape X-Git-Tag: Release-1.26~6 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b63963fef65fc569e785cf8c2a506865565d27ca;p=bacula%2Fbacula Update doc -- minor changes to btape git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@165 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/kernstodo b/bacula/kernstodo index b1cdb068c4..99774626bf 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -1,5 +1,5 @@ Kern's ToDo List - 23 September 2002 + 6 October 2002 Irix conversion notes: - no uuencode @@ -27,6 +27,12 @@ From Chuck: I tried this and it didn't find sqlite.h ======= +- Figure out why my Catalog size keeps growing. +- Document bscan. +- Document Restore. + +- Make SD disallow writing on Volume with fewer files than in + the catalog. - Check if GZIP1 is working -- check speed. - Put MaximumVolumeSize in Director. - Document how to cancel a job that is waiting on a Volume. @@ -50,8 +56,6 @@ From Chuck: only a single filename split routine. - Add command to reset VolFiles to a larger value (don't allow a smaller number or print big warning). -- Make SD disallow writing on Volume with fewer files than in - the catalog. - Make Restore report an error if FD or SD term codes are not OK. - Convert all %x substitution variables, which are hard to remember and read to %(variable-name). Idea from TMDA. @@ -75,7 +79,7 @@ From Chuck: - No READLINE_SRC if found in alternate directory. - Add Client FS/OS id (Linux, Win95/98, ...). - Put Windows files in Windows stream? -- Ensure that everyone uses btime routines. +- Ensure that everyone uses btime routines (mostly done). Projects: @@ -610,3 +614,6 @@ Done: (see kernsdone for more) Another try with tape mounted and Job hung in Director. - Write updated bootstrap after every Job. +- Document driver testing with btape. +- Document autochanger. + diff --git a/bacula/src/stored/btape.c b/bacula/src/stored/btape.c index cde20fc881..91e624bc23 100644 --- a/bacula/src/stored/btape.c +++ b/bacula/src/stored/btape.c @@ -111,7 +111,7 @@ int main(int argc, char *argv[]) Emsg1(M_ABORT, 0, "Tape block size (%d) is not a power of 2\n", TAPE_BSIZE); } - printf("Tape block size is %d bytes.\n", TAPE_BSIZE); + printf("Tape block granularity is %d bytes.\n", TAPE_BSIZE); while ((ch = getopt(argc, argv, "c:d:st?")) != -1) { switch (ch) { @@ -441,75 +441,6 @@ static void weofcmd() } } -/* - * Test on uninitialized tape - * Destroys tape contents !!!! Including Bacula label. - */ -static void rawtestcmd() -{ -#ifdef xxxx - int i, j, k; - - if (!dev) { - Pmsg0(0, "No device: Use device command.\n"); - return; - } - if (!rewind_dev(dev)) { - Pmsg1(0, "Bad status from rewind. ERR=%s\n", strerror_dev(dev)); - return; - } - Pmsg0(0, "Rewound, now writing 100 blocks\n"); - for (i=0; i<100; i++) { - j = 10000 + i; - memset(buf, i, j); - if (!write_dev(dev, buf, j)) { - Pmsg1(0, "Bad status from write. ERR=%s\n", strerror_dev(dev)); - return; - } - Pmsg2(10, "Wrote %d bytes of %d\n", j, i); - } - Pmsg0(0, "100 Blocks written, flushing buffers and writing EOF\n"); - if (flush_dev(dev) != 0) { - Pmsg1(0, "Error writing flushing. ERR=%s\n", strerror(errno)); - return; - } - if (weof_dev(dev, 1) != 0) { - Pmsg1(0, "Error writing eof. ERR=%s\n", strerror(errno)); - return; - } - Pmsg0(0, "Rewinding ...\n"); - if (!rewind_dev(dev)) { - Pmsg1(0, "Bad status from rewind. ERR=%s\n", strerror_dev(dev)); - return; - } - - - Pmsg0(0, "Read and verify data ...\n"); - for (i=0; i<100; i++) { - j = 10000 + i; - if (!read_dev(dev, buf, j)) { - Pmsg1(0, "Bad status from read. ERR=%s\n", strerror_dev(dev)); - return; - } - for (k=0; kdata = (char *) check_pool_memory_size(rec->data, i); + rec->data = check_pool_memory_size(rec->data, i); memset(rec->data, i & 0xFF, i); rec->data_len = i; sm_check(__FILE__, __LINE__, False); - while (!write_record_to_block(block, rec)) { + if (write_record_to_block(block, rec)) { empty_block(block); blkno++; Pmsg2(0, "Block %d i=%d\n", blkno, i); + } else { + break; } sm_check(__FILE__, __LINE__, False); } @@ -884,91 +826,9 @@ static void statcmd() } -/* - * Test on labeled tape. Preserves Bacula label. - */ -static void appendcmd() -{ - -#ifdef xxxx_this_code_turned_off - - int i, j, k; - int file; - DEV_BLOCK *block; - - if (!dev) { - Pmsg0(0, "No device: Use device command.\n"); - return; - } - - block = new_block(dev); - - if (!ready_device_for_append(jcr, dev, block, VolName)) { - Pmsg0(0, "Cannot append, not a Bacula tape.\n"); - return; - } - - file = dev_file(dev); - Pmsg1(0, "Begin write test data in file %d\n", file); - - /* Write our test data */ - for (i=0; i<100; i++) { - j = 10000 + i; - memset(buf, i, j); - if (!write_dev(dev, buf, j)) { - Pmsg1(0, "Bad status from write. ERR=%s\n", strerror_dev(dev)); - return; - } - Pmsg2(10, "Wrote %d bytes of %d\n", j, i); - } - - if (flush_dev(dev) != 0) { /* ensure written to tape */ - Pmsg1(0, "Flush error: %s\n", strerror(errno)); - } - if (weof_dev(dev, 1) != 0) { - Pmsg1(0, "EOF error: %s\n", strerror(errno)); - } - - Pmsg0(0, "Rewind and reread label\n"); - if (read_dev_volume_label(dev, VolName) != VOL_OK) { - return; - } - - if (file != 0) { - Pmsg1(0, "FSF %d files\n", file); - fsf_dev(dev, file); - } - - file = dev_file(dev); - Pmsg1(0, "Begin read/test from file %d\n", file); - /* Now read our test data and make sure it is what we wrote */ - for (i=0; i<100; i++) { - j = 10000 + i; - if (!read_dev(dev, buf, j)) { - Pmsg1(0, "Bad status from read. ERR=%s\n", strerror_dev(dev)); - return; - } - for (k=0; k