xfs
[Top] [All Lists]

xfsdump patch for automatic media changes

To: linux-xfs@xxxxxxxxxxx
Subject: xfsdump patch for automatic media changes
From: dwild+xfs@xxxxxxxxxxxxx
Date: Fri, 20 Jun 2003 15:53:03 -0400 (EDT)
Sender: linux-xfs-bounce@xxxxxxxxxxx
I'm new here, so if people aren't supposed to post patches to the list
just let me know.

I needed the capability for xfsdump to change a tape in a jukebox when the
tape ran out, and the -c flag just didn't work right.  So, this patch
alters the -c flag to work when the program is running in the background
with the -F flag enabled.

I use it to call a perl script that does backup accounting/tape
changes/etc then passes control back to xfsdump.  It hasn't broken
anything yet =)

-dwild


-----
diff -ur xfsdump-2.2.6/dump/content.c xfsdump-2.2.6.X/dump/content.c
--- xfsdump-2.2.6/dump/content.c        2002-12-30 18:09:33.000000000 -0500
+++ xfsdump-2.2.6.1/dump/content.c      2003-06-20 14:39:34.000000000 -0400
@@ -6095,7 +6095,8 @@
 changemedia:
        /* if the drive does not support media change, quit.
         */
-       if ( ! ( dcaps & DRIVE_CAP_REMOVABLE )) {
+
+       if ( ! ( dcaps & DRIVE_CAP_REMOVABLE ) && (media_change_alert_program 
== NULL)) {
                return RV_ERROR;
        }

@@ -6113,7 +6114,7 @@

        /* if dialogs not allowed, we are done.
         */
-       if ( ! dlog_allowed( )) {
+       if ( ! dlog_allowed( ) && (media_change_alert_program == NULL)) {
                return RV_QUIT; /* this return value will cause approp. msg */
        }

@@ -6125,7 +6126,7 @@
        /* if media change prompt declined or times out,
         * we are done
         */
-       if ( drivecnt > 1 && ! stdoutpiped ) {
+       if ( drivecnt > 1 && ! stdoutpiped && dlog_allowed( )) {
                ix_t thrdix = drivep->d_index;
                ASSERT( sistr );
                mlog( MLOG_NORMAL | MLOG_NOTE | MLOG_MEDIA, _(
@@ -6142,7 +6143,11 @@
                }
                ok = BOOL_TRUE;
        } else {
-               ok = Media_prompt_change( drivep );
+               if (media_change_alert_program != NULL) {
+                       ok = BOOL_TRUE;
+               } else {
+                       ok = Media_prompt_change( drivep );
+               }
        }
        if ( intr_allowed && cldmgr_stop_requested( )) {
                return RV_INTR;


<Prev in Thread] Current Thread [Next in Thread>