+ $steps->{'get_xfer_src'}->();
+ };
+
+ step get_xfer_src => sub {
+ $src->{'clerk'}->get_xfer_src(
+ dump => $current->{'dump'},
+ xfer_src_cb => $steps->{'got_xfer_src'})
+ };
+
+ step got_xfer_src => sub {
+ my ($errors, $header, $xfer_src_, $directtcp_supported) = @_;
+ $xfer_src = $xfer_src_;
+
+ return $finished_cb->(join("\n", @$errors))
+ if $errors;
+
+ $current->{'header'} = $header;
+
+ # set up splitting args from the tapetype only, since we have no DLEs
+ my $tt = lookup_tapetype(getconf($CNF_TAPETYPE));
+ sub empty2undef { $_[0]? $_[0] : undef }
+ my %xfer_dest_args;
+ if ($tt) {
+ %xfer_dest_args = get_splitting_args_from_config(
+ part_size_kb =>
+ empty2undef(tapetype_getconf($tt, $TAPETYPE_PART_SIZE)),
+ part_cache_type_enum =>
+ empty2undef(tapetype_getconf($tt, $TAPETYPE_PART_CACHE_TYPE)),
+ part_cache_dir =>
+ empty2undef(tapetype_getconf($tt, $TAPETYPE_PART_CACHE_DIR)),
+ part_cache_max_size =>
+ empty2undef(tapetype_getconf($tt, $TAPETYPE_PART_CACHE_MAX_SIZE)),
+ );
+ }
+ # (else leave %xfer_dest_args empty, for no splitting)
+
+ $xfer_dst = $dst->{'scribe'}->get_xfer_dest(
+ max_memory => getconf($CNF_DEVICE_OUTPUT_BUFFER_SIZE),
+ can_cache_inform => 0,
+ %xfer_dest_args,
+ );
+
+ # create and start the transfer
+ $xfer = Amanda::Xfer->new([ $xfer_src, $xfer_dst ]);
+ my $size = 0;
+ $size = $current->{'dump'}->{'bytes'} if exists $current->{'dump'}->{'bytes'};
+ $xfer->start($steps->{'handle_xmsg'}, 0, $size);
+
+ # count the "threads" running here (clerk and scribe)
+ $n_threads = 2;
+
+ # and let both the scribe and the clerk know that data is in motion
+ $src->{'clerk'}->start_recovery(
+ xfer => $xfer,
+ recovery_cb => $steps->{'recovery_cb'});
+ $dst->{'scribe'}->start_dump(
+ xfer => $xfer,
+ dump_header => $header,
+ dump_cb => $steps->{'dump_cb'});
+ };