[stgt] Dealing with virtual tapes when they are moved out of a drive ...

Richard Sharpe realrichardsharpe at gmail.com
Sun Aug 17 20:51:00 CEST 2008


Hi,

It strikes me that one might want to deal with virtual tapes when they
are moved out of a virtual tape drive and back to a slot.

This might take the form of a script that the sys admin provides that
does something special with the tape or whatever.

Here is one possible approach to doing that (I have not fully
implemented it, I only throw this out as a possibility):

--- smc.c       2008-08-15 16:12:26.000000000 -0700
+++ smc.c.dispose-tape  2008-08-17 11:47:33.000000000 -0700
@@ -457,9 +457,21 @@
                        asc = ASC_MECHANICAL_POSITIONING_ERROR;
                        goto sense;
                }
-       } else
+       } else {
                set_slot_full(dest_slot, src, NULL);

+               /*
+                * Now, if the source slot was a data transfer element
+                * execute any unload script provided ...
+                */
+               if (src_slot->element_type == ELEMENT_DATA_TRANSFER) {
+
+                       /*
+                        * execve etc ...
+                        */
+               }
+       }
+
        set_slot_empty(src_slot);

        scsi_set_in_resid_by_actual(cmd, 0);
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list