From 2cb92fbc5f7f1ad452b9be44670b02d5bd33d194 Mon Sep 17 00:00:00 2001 From: Jean-Louis Martineau Date: Tue, 21 Apr 2009 16:11:10 +0000 Subject: [PATCH] * man/xml-source/amanda-devices.7.xml: Add 'FSF_AFTER_FILEMARK' property to 'tape:' driver. * device-src/tape-device.c: Add code for new 'FSF_AFTER_FILEMARK' property, set is_eof to FLASE where needed. * device-src/tape-device.h: Add fsf_after_filemark to _TapeDevice. * device-src/tape-aix.c, device-src/tape-uware.c, device-src/tape-xenix.c, device-src/tape-posix.c: Set default value for FSF_AFTER_FILEMARK. * config/amanda/defaults.m4: Find default value for 'FSF_AFTER_FILEMARK' property. * xfer-src/dest-null.c: Remove bogus assert. * device-src/amtapetype.pl: New -p option to discover driver properties, it can find value for the 'FSF_AFTER_FILEMARK' property. * man/xml-source/amtapetype.8.xml: Document -p options git-svn-id: https://amanda.svn.sourceforge.net/svnroot/amanda/amanda/trunk@1892 a8d146d6-cc15-0410-8900-af154a0219e0 --- ChangeLog | 16 ++ config/amanda/defaults.m4 | 8 + device-src/amtapetype.pl | 274 +++++++++++++++++++++++++++- device-src/tape-aix.c | 1 + device-src/tape-device.c | 26 ++- device-src/tape-device.h | 6 +- device-src/tape-posix.c | 1 + device-src/tape-uware.c | 1 + device-src/tape-xenix.c | 1 + man/xml-source/amanda-devices.7.xml | 4 + man/xml-source/amtapetype.8.xml | 8 + xfer-src/dest-null.c | 1 - 12 files changed, 334 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index e3952d7dd9..47061776bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2009-04-21 Jean-Louis Martineau + * man/xml-source/amanda-devices.7.xml: Add 'FSF_AFTER_FILEMARK' + property to 'tape:' driver. + * device-src/tape-device.c: Add code for new 'FSF_AFTER_FILEMARK' + property, set is_eof to FLASE where needed. + * device-src/tape-device.h: Add fsf_after_filemark to _TapeDevice. + * device-src/tape-aix.c, device-src/tape-uware.c, + device-src/tape-xenix.c, device-src/tape-posix.c: Set default value + for FSF_AFTER_FILEMARK. + * config/amanda/defaults.m4: Find default value for 'FSF_AFTER_FILEMARK' + property. + * xfer-src/dest-null.c: Remove bogus assert. + * device-src/amtapetype.pl: New -p option to discover driver properties, + it can find value for the 'FSF_AFTER_FILEMARK' property. + * man/xml-source/amtapetype.8.xml: Document -p options + 2009-04-20 Jean-Louis Martineau * client-src/sendsize.c: Typo * server-src/planner.c: Don't log failed estimate message. diff --git a/config/amanda/defaults.m4 b/config/amanda/defaults.m4 index af870c4cff..8076f27912 100644 --- a/config/amanda/defaults.m4 +++ b/config/amanda/defaults.m4 @@ -139,4 +139,12 @@ AC_DEFUN([AMANDA_SETUP_DEFAULTS], AC_DEFINE_DIR([DEFAULT_AMANDATES_FILE], [amandates], [Default location for 'amandates']) + + DEFAULT_FSF_AFTER_FILEMARK="FALSE" + case "$target" in + *-solaris*) DEFAULT_FSF_AFTER_FILEMARK="TRUE" + ;; + esac + AC_DEFINE_UNQUOTED(DEFAULT_FSF_AFTER_FILEMARK, $DEFAULT_FSF_AFTER_FILEMARK, + [Define if a FSF is needed on filemark.]) ]) diff --git a/device-src/amtapetype.pl b/device-src/amtapetype.pl index a4a1960b17..0b8f56b505 100644 --- a/device-src/amtapetype.pl +++ b/device-src/amtapetype.pl @@ -45,6 +45,7 @@ my $opt_label = "amtapetype-".(int rand 2**31); my $opt_device_name; my $opt_config; +my $opt_property; # global "hint" from the compression heuristic as to how fast this # drive is. @@ -280,6 +281,252 @@ sub check_compression { return $compression_enabled; } +sub data_to_null { + my ($device) = @_; + my $got_error = 0; + + my $xfer = Amanda::Xfer->new([ + Amanda::Xfer::Source::Device->new($device), + Amanda::Xfer::Dest::Null->new(0), + ]); + + $xfer->get_source()->set_callback(sub { + my ($src, $xmsg, $xfer) = @_; + if ($xmsg->{type} == $Amanda::Xfer::XMSG_ERROR) { + $got_error = $xmsg->{message}; + } + if ($xfer->get_status() == $Amanda::Xfer::XFER_DONE) { + Amanda::MainLoop::quit(); + } + }); + $xfer->start(); + + Amanda::MainLoop::run(); +} + +sub check_property { + my ($device) = @_; + + my $fsf_after_filemark = $device->property_get("FSF_AFTER_FILEMARK"); + + # not a 'tape:' device + return if !defined $fsf_after_filemark; + + $device->start($ACCESS_WRITE, "TEST-001", "20080706050403"); + + my $hdr = new Amanda::Header; + + $hdr->{type} = $Amanda::Header::F_DUMPFILE; + $hdr->{name} = "localhost"; + $hdr->{disk} = "/test1"; + $hdr->{datestamp} = "20080706050403"; + $device->start_file($hdr); + $device->finish_file(); + + $hdr->{type} = $Amanda::Header::F_DUMPFILE; + $hdr->{name} = "localhost"; + $hdr->{disk} = "/test2"; + $hdr->{datestamp} = "20080706050403"; + $device->start_file($hdr); + $device->finish_file(); + + $hdr->{type} = $Amanda::Header::F_DUMPFILE; + $hdr->{name} = "localhost"; + $hdr->{disk} = "/test3"; + $hdr->{datestamp} = "20080706050403"; + $device->start_file($hdr); + $device->finish_file(); + + $device->finish(); + + #set fsf_after_filemark to false + $device->property_set('FSF_AFTER_FILEMARK', 0) + or die "Error setting FSF_AFTER_FILEMARK: " . $device->error_or_status(); + + my $need_fsf_after_filemark = 0; + + if ($device->read_label() != $DEVICE_STATUS_SUCCESS) { + die ("Could not read label from: " . $device->error_or_status()); + } + if ($device->volume_label != "TEST-001") { + die ("wrong label: ", $device->volume_label); + } + $device->start($ACCESS_READ, undef, undef) + or die ("Could not start device: " . $device->error_or_status()); + + $hdr = $device->seek_file(1); + if ($device->status() != $DEVICE_STATUS_SUCCESS) { + die ("seek_file(1) failed"); + } + if ($hdr->{disk} ne "/test1") { + die ("Wrong disk: " . $hdr->{disk} . " expected /test1"); + } + data_to_null($device); + + $hdr = $device->seek_file(2); + if ($device->status() == $DEVICE_STATUS_SUCCESS) { + if ($hdr->{disk} ne "/test2") { + die ("Wrong disk: " . $hdr->{disk} . " expected /test2"); + } + data_to_null($device); + + $hdr = $device->seek_file(3); + if ($device->status() != $DEVICE_STATUS_SUCCESS) { + die("seek_file(3) failed"); + } + if ($hdr->{disk} ne "/test3") { + die ("Wrong disk: " . $hdr->{disk} . " expected /test3"); + } + data_to_null($device); + } else { + $need_fsf_after_filemark = 1; + } + + $device->finish(); + + #verify need_fsf_after_filemark + my $fsf_after_filemark_works = 0; + if ($need_fsf_after_filemark) { + #set fsf_after_filemark to true + $device->property_set('FSF_AFTER_FILEMARK', 1) + or die "Error setting FSF_AFTER_FILEMARK: " . $device->error_or_status(); + + if ($device->read_label() != $DEVICE_STATUS_SUCCESS) { + die ("Could not read label from: " . $device->error_or_status()); + } + if ($device->volume_label != "TEST-001") { + die ("wrong label: ", $device->volume_label); + } + $device->start($ACCESS_READ, undef, undef) + or die ("Could not start device: " . $device->error_or_status()); + + $hdr = $device->seek_file(1); + if ($device->status() != $DEVICE_STATUS_SUCCESS) { + die ("seek_file(1) failed"); + } + if ($hdr->{disk} ne "/test1") { + die ("Wrong disk: " . $hdr->{disk} . " expected /test1"); + } + data_to_null($device); + + $hdr = $device->seek_file(2); + if ($device->status() == $DEVICE_STATUS_SUCCESS) { + if ($hdr->{disk} ne "/test2") { + die ("Wrong disk: " . $hdr->{disk} . " expected /test2"); + } + data_to_null($device); + + $hdr = $device->seek_file(3); + if ($device->status() != $DEVICE_STATUS_SUCCESS) { + die("seek_file(3) failed"); + } + if ($hdr->{disk} ne "/test3") { + die ("Wrong disk: " . $hdr->{disk} . " expected /test3"); + } + data_to_null($device); + $fsf_after_filemark_works = 1; + } else { + die("seek_file(2) failed"); + } + $device->finish(); + } + + if ($need_fsf_after_filemark == 0 && $fsf_after_filemark_works == 0) { + if (defined $opt_property || $fsf_after_filemark) { + print STDOUT "device_property \"FSF_AFTER_FILEMARK\" \"false\"\n"; + } + $device->property_set('FSF_AFTER_FILEMARK', 0); + } elsif ($need_fsf_after_filemark == 1 && $fsf_after_filemark_works == 1) { + if (defined $opt_property || !$fsf_after_filemark) { + print STDOUT "device_property \"FSF_AFTER_FILEMARK\" \"true\"\n"; + } + $device->property_set('FSF_AFTER_FILEMARK', 1); + } else { + die ("Broken seek_file"); + } + + #Check seek to file 1 from header + if ($device->read_label() != $DEVICE_STATUS_SUCCESS) { + die ("Could not read label from: " . $device->error_or_status()); + } + if ($device->volume_label != "TEST-001") { + die ("wrong label: ", $device->volume_label); + } + $device->start($ACCESS_READ, undef, undef) + or die ("Could not start device: " . $device->error_or_status()); + + $hdr = $device->seek_file(1); + if ($device->status() != $DEVICE_STATUS_SUCCESS) { + die ("seek_file(1) failed"); + } + if ($hdr->{disk} ne "/test1") { + die ("Wrong disk: " . $hdr->{disk} . " expected /test1"); + } + $device->finish(); + + #Check seek to file 2 from header + if ($device->read_label() != $DEVICE_STATUS_SUCCESS) { + die ("Could not read label from: " . $device->error_or_status()); + } + if ($device->volume_label != "TEST-001") { + die ("wrong label: ", $device->volume_label); + } + $device->start($ACCESS_READ, undef, undef) + or die ("Could not start device: " . $device->error_or_status()); + + $hdr = $device->seek_file(2); + if ($device->status() != $DEVICE_STATUS_SUCCESS) { + die ("seek_file(2) failed"); + } + if ($hdr->{disk} ne "/test2") { + die ("Wrong disk: " . $hdr->{disk} . " expected /test1"); + } + $device->finish(); + + #Check seek to file 3 from header + if ($device->read_label() != $DEVICE_STATUS_SUCCESS) { + die ("Could not read label from: " . $device->error_or_status()); + } + if ($device->volume_label != "TEST-001") { + die ("wrong label: ", $device->volume_label); + } + $device->start($ACCESS_READ, undef, undef) + or die ("Could not start device: " . $device->error_or_status()); + + $hdr = $device->seek_file(3); + if ($device->status() != $DEVICE_STATUS_SUCCESS) { + die ("seek_file(3) failed"); + } + if ($hdr->{disk} ne "/test3") { + die ("Wrong disk: " . $hdr->{disk} . " expected /test1"); + } + $device->finish(); + + #Check seek to file 3 from eof of 1 + if ($device->read_label() != $DEVICE_STATUS_SUCCESS) { + die ("Could not read label from: " . $device->error_or_status()); + } + if ($device->volume_label != "TEST-001") { + die ("wrong label: ", $device->volume_label); + } + $device->start($ACCESS_READ, undef, undef) + or die ("Could not start device: " . $device->error_or_status()); + + $hdr = $device->seek_file(1); + if ($device->status() != $DEVICE_STATUS_SUCCESS) { + die ("seek_file(1) failed"); + } + data_to_null($device); + $hdr = $device->seek_file(3); + if ($device->status() != $DEVICE_STATUS_SUCCESS) { + die ("seek_file(3) failed"); + } + if ($hdr->{disk} ne "/test3") { + die ("Wrong disk: " . $hdr->{disk} . " expected /test3"); + } + $device->finish(); +} + sub make_tapetype { my ($device, $compression_enabled) = @_; my $blocksize = $device->property_get("BLOCK_SIZE"); @@ -363,6 +610,7 @@ sub usage { -b Blocksize to use (default 32k) -t Name to give to the new tapetype definition -l Label to write to the tape (default is randomly generated) + -p Check property of the device. -o Overwrite configuration parameter (such as device properties) Blocksize can include an optional suffix (k, m, or g) @@ -394,6 +642,7 @@ sub usage { 't=s' => \$opt_tapetype_name, 'f' => \$opt_force, 'l' => \$opt_label, + 'p' => \$opt_property, 'o=s' => sub { add_config_overwrite_opt($config_overwrites, $_[1]); }, ) or usage(); usage() if (@ARGV < 1 or @ARGV > 2); @@ -417,16 +666,21 @@ sub usage { my $device = open_device(); -my $compression_enabled = check_compression($device); -print STDERR "Compression: ", - $compression_enabled? "enabled" : "disabled", - "\n"; +# Find property of the device. +check_property($device); -if ($compression_enabled and !$opt_force) { - print STDERR "Turn off compression or run amtapetype with the -f option\n"; - exit(1); -} +if (!defined $opt_property) { + my $compression_enabled = check_compression($device); + print STDERR "Compression: ", + $compression_enabled? "enabled" : "disabled", + "\n"; -if (!$opt_only_compression) { - make_tapetype($device, $compression_enabled); + if ($compression_enabled and !$opt_force) { + print STDERR "Turn off compression or run amtapetype with the -f option\n"; + exit(1); + } + + if (!$opt_only_compression) { + make_tapetype($device, $compression_enabled); + } } diff --git a/device-src/tape-aix.c b/device-src/tape-aix.c index cd2e626ed0..a973b2635f 100644 --- a/device-src/tape-aix.c +++ b/device-src/tape-aix.c @@ -104,6 +104,7 @@ DeviceStatusFlags tape_is_ready(int fd G_GNUC_UNUSED, TapeDevice *t_self G_GNUC_ void tape_device_detect_capabilities(TapeDevice * t_self) { tape_device_set_capabilities(t_self, TRUE, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* fsf*/ + DEFAULT_FSF_AFTER_FILEMARK, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* fsf_after_filemark*/ TRUE, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* bsf*/ TRUE, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* fsr*/ TRUE, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* bsr*/ diff --git a/device-src/tape-device.c b/device-src/tape-device.c index 1181e44a0e..8e4989a9ab 100644 --- a/device-src/tape-device.c +++ b/device-src/tape-device.c @@ -57,6 +57,7 @@ typedef enum { */ DevicePropertyBase device_property_broken_gmt_online; DevicePropertyBase device_property_fsf; +DevicePropertyBase device_property_fsf_after_filemark; DevicePropertyBase device_property_bsf; DevicePropertyBase device_property_fsr; DevicePropertyBase device_property_bsr; @@ -166,6 +167,8 @@ tape_device_init (TapeDevice * self) { &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); device_set_simple_property(d_self, PROPERTY_FSF, &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); + device_set_simple_property(d_self, PROPERTY_FSF_AFTER_FILEMARK, + &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); device_set_simple_property(d_self, PROPERTY_BSF, &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); device_set_simple_property(d_self, PROPERTY_FSR, @@ -291,6 +294,11 @@ tape_device_base_init (TapeDeviceClass * c) device_simple_property_get_fn, tape_device_set_feature_property_fn); + device_class_register_property(device_class, PROPERTY_FSF_AFTER_FILEMARK, + PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, + device_simple_property_get_fn, + tape_device_set_feature_property_fn); + device_class_register_property(device_class, PROPERTY_BSF, PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, device_simple_property_get_fn, @@ -375,6 +383,8 @@ tape_device_set_feature_property_fn(Device *p_self, DevicePropertyBase *base, self->broken_gmt_online = new_bool; else if (base->ID == PROPERTY_FSF) self->fsf = new_bool; + else if (base->ID == PROPERTY_FSF_AFTER_FILEMARK) + self->fsf_after_filemark = new_bool; else if (base->ID == PROPERTY_BSF) self->bsf = new_bool; else if (base->ID == PROPERTY_FSR) @@ -482,6 +492,10 @@ void tape_device_register(void) { G_TYPE_BOOLEAN, "fsf", "Does this drive support the MTFSF command?"); + device_property_fill_and_register(&device_property_fsf_after_filemark, + G_TYPE_BOOLEAN, "fsf_after_filemark", + "Does this drive needs a FSF if a filemark is already read?"); + device_property_fill_and_register(&device_property_bsf, G_TYPE_BOOLEAN, "bsf", "Does this drive support the MTBSF command?" ); @@ -650,6 +664,7 @@ tape_device_open_device (Device * d_self, char * device_name, void tape_device_set_capabilities(TapeDevice *self, gboolean fsf, PropertySurety fsf_surety, PropertySource fsf_source, + gboolean fsf_after_filemark, PropertySurety faf_surety, PropertySource faf_source, gboolean bsf, PropertySurety bsf_surety, PropertySource bsf_source, gboolean fsr, PropertySurety fsr_surety, PropertySource fsr_source, gboolean bsr, PropertySurety bsr_surety, PropertySource bsr_source, @@ -672,6 +687,10 @@ tape_device_set_capabilities(TapeDevice *self, g_value_set_boolean(&val, fsf); device_set_simple_property(dself, PROPERTY_FSF, &val, fsf_surety, fsf_source); + self->fsf_after_filemark = fsf_after_filemark; + g_value_set_boolean(&val, fsf_after_filemark); + device_set_simple_property(dself, PROPERTY_FSF_AFTER_FILEMARK, &val, faf_surety, faf_source); + self->bsf = bsf; g_value_set_boolean(&val, bsf); device_set_simple_property(dself, PROPERTY_BSF, &val, bsf_surety, bsf_source); @@ -1148,7 +1167,9 @@ tape_device_seek_file (Device * d_self, guint file) { difference = file - d_self->file; /* Check if we already read a filemark. */ - if (d_self->is_eof) { + /* If we already read a filemark and the drive automaticaly goes to the + next file, then we must reduce the difference by one. */ + if (d_self->is_eof && !self->fsf_after_filemark) { difference --; } @@ -1335,6 +1356,7 @@ tape_device_finish (Device * d_self) { return FALSE; } + d_self->is_eof = FALSE; d_self->access_mode = ACCESS_NULL; return TRUE; @@ -1360,9 +1382,11 @@ tape_device_robust_read (TapeDevice * self, void * buf, int * count, char **errm result = read(self->fd, buf, *count); if (result > 0) { /* Success. By definition, we read a full block. */ + d_self->is_eof = FALSE; *count = result; return RESULT_SUCCESS; } else if (result == 0) { + d_self->is_eof = TRUE; return RESULT_NO_DATA; } else { if (0 diff --git a/device-src/tape-device.h b/device-src/tape-device.h index bfb0ee7fca..6327afba2b 100644 --- a/device-src/tape-device.h +++ b/device-src/tape-device.h @@ -51,7 +51,7 @@ typedef struct _TapeDevice { /* characteristics of the device */ gboolean fsf, bsf, fsr, bsr, eom, bsf_after_eom, broken_gmt_online; - gboolean nonblocking_open; + gboolean nonblocking_open, fsf_after_filemark; int final_filemarks; /* 0 if we opened with O_RDWR; error otherwise. */ @@ -77,6 +77,9 @@ extern DevicePropertyBase device_property_broken_gmt_online; extern DevicePropertyBase device_property_fsf; #define PROPERTY_FSF (device_property_fsf.ID) +extern DevicePropertyBase device_property_fsf_after_filemark; +#define PROPERTY_FSF_AFTER_FILEMARK (device_property_fsf_after_filemark.ID) + extern DevicePropertyBase device_property_bsf; #define PROPERTY_BSF (device_property_bsf.ID) @@ -107,6 +110,7 @@ extern DevicePropertyBase device_property_final_filemarks; /* useful callback for tape ops */ void tape_device_set_capabilities(TapeDevice *self, gboolean fsf, PropertySurety fsf_surety, PropertySource fsf_source, + gboolean fsf_after_filemark, PropertySurety faf_surety, PropertySource faf_source, gboolean bsf, PropertySurety bsf_surety, PropertySource bsf_source, gboolean fsr, PropertySurety fsr_surety, PropertySource fsr_source, gboolean bsr, PropertySurety bsr_surety, PropertySource bsr_source, diff --git a/device-src/tape-posix.c b/device-src/tape-posix.c index 80e2a50bec..cada501153 100644 --- a/device-src/tape-posix.c +++ b/device-src/tape-posix.c @@ -180,6 +180,7 @@ DeviceStatusFlags tape_is_ready(int fd, TapeDevice *t_self G_GNUC_UNUSED) { void tape_device_detect_capabilities(TapeDevice * t_self) { tape_device_set_capabilities(t_self, TRUE, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* fsf*/ + DEFAULT_FSF_AFTER_FILEMARK, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* fsf_after_filemark*/ TRUE, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* bsf*/ TRUE, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* fsr*/ TRUE, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* bsr*/ diff --git a/device-src/tape-uware.c b/device-src/tape-uware.c index ab13a5ba6d..52e11edc5a 100644 --- a/device-src/tape-uware.c +++ b/device-src/tape-uware.c @@ -102,6 +102,7 @@ DeviceStatusFlags tape_is_ready(int fd G_GNUC_UNUSED, TapeDevice *t_self G_GNUC_ void tape_device_detect_capabilities(TapeDevice * t_self) { tape_device_set_capabilities(t_self, TRUE, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* fsf*/ + DEFAULT_FSF_AFTER_FILEMARK, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* fsf_after_filemark*/ TRUE, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* bsf*/ TRUE, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* fsr*/ TRUE, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* bsr*/ diff --git a/device-src/tape-xenix.c b/device-src/tape-xenix.c index 0d65443318..31d7d7e5ff 100644 --- a/device-src/tape-xenix.c +++ b/device-src/tape-xenix.c @@ -99,6 +99,7 @@ DeviceStatusFlags tape_is_ready(int fd G_GNUC_UNUSED, TapeDevice *t_self G_GNUC_ void tape_device_detect_capabilities(TapeDevice * t_self) { tape_device_set_capabilities(t_self, TRUE, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* fsf*/ + DEFAULT_FSF_AFTER_FILEMARK, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* fsf_after_filemark*/ FALSE, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT, /* bsf*/ FALSE, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT, /* fsr*/ FALSE, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT, /* bsr*/ diff --git a/man/xml-source/amanda-devices.7.xml b/man/xml-source/amanda-devices.7.xml index 44241e3b17..d325fbfe4a 100644 --- a/man/xml-source/amanda-devices.7.xml +++ b/man/xml-source/amanda-devices.7.xml @@ -486,6 +486,10 @@ operations can be emulated with the MTREW and read data operations. FSF (read-write) This boolean property specifies whether the device driver may use the MTFSF operation (forward seek file). + + + FSF_AFTER_FILEMARK + (read-write) This boolean property specifies whether the device driver needs a FSF to go the next file after the filemark is read. Default to "TRUE" on Solaris and "FALSE" on all others machines. FSR diff --git a/man/xml-source/amtapetype.8.xml b/man/xml-source/amtapetype.8.xml index 019c78fd38..ba7d5f07e4 100644 --- a/man/xml-source/amtapetype.8.xml +++ b/man/xml-source/amtapetype.8.xml @@ -33,6 +33,7 @@ -h -c -f + -p -b blocksize -t typename -l label @@ -70,6 +71,13 @@ This takes a few minutes only. Run amtapetype even if the loaded volume is already in use or compression is enabled. + + + + + +Run only the device property discovery. + diff --git a/xfer-src/dest-null.c b/xfer-src/dest-null.c index 5167ceb29e..2f0ff6d08e 100644 --- a/xfer-src/dest-null.c +++ b/xfer-src/dest-null.c @@ -150,7 +150,6 @@ xfer_dest_null( self->do_verify = TRUE; simpleprng_seed(&self->prng, prng_seed); } else { - g_assert(0); self->do_verify = FALSE; }