Bug 21178

Summary: voltag selector, and unload support for chio(1).
Product: Base System Reporter: csg <csg>
Component: binAssignee: Kenneth D. Merry <ken>
Status: Closed FIXED    
Severity: Affects Only Me CC: ajk
Priority: Normal    
Version: 4.0-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
chio.diffs.20000915 none

Description csg 2000-09-11 00:30:01 UTC
chio(1) provides no mechanism to select media by "voltag."
chio(1) provides no mechanism to return a media unit to its source.

Fix: 

o A pseudo-element type selector "voltag" that can be used to select
   source elements:

      chio move voltag VOLUME-03 drive 0

      chio exchange voltag VOLUME-03 voltag VOLUME-04

 o A new sub-command "unload" that returns a media unit to the source
   element reported by 'chio status -a':

      chio unload drive 0
      chio unload voltag VOLUME-03

A patch relative to 4.1-STABLE (should work on 5.0-CURRENT as well) is
available at:

    http://www.physics.purdue.edu/~csg/FreeBSD/chio.patch
How-To-Repeat: 
N/A - new feature request.
Comment 1 mjacob 2000-09-11 00:40:33 UTC
Why doesn't somebody just merge the equivalent fixes from NetBSD's chio into
FreeBSD? Or where they already done?


> 
> >Number:         21178
> >Category:       bin
> >Synopsis:       voltag selector, and unload support for chio(1).
> >Confidential:   no
> >Severity:       non-critical
> >Priority:       low
> >Responsible:    freebsd-bugs
> >State:          open
> >Quarter:        
> >Keywords:       
> >Date-Required:
> >Class:          change-request
> >Submitter-Id:   current-users
> >Arrival-Date:   Sun Sep 10 16:30:01 PDT 2000
> >Closed-Date:
> >Last-Modified:
> >Originator:     C. Stephen Gunn
> >Release:        FreeBSD 4.0-STABLE i386
> >Organization:
> Waterpout Communications, Inc.
> >Environment:
> 
> Most versions of FreeBSD.
> 
> >Description:
> 
> chio(1) provides no mechanism to select media by "voltag."
> chio(1) provides no mechanism to return a media unit to its source.
> 
> >How-To-Repeat:
> 
> N/A - new feature request.
> 
> >Fix:
> 
>  o A pseudo-element type selector "voltag" that can be used to select
>    source elements:
> 
>       chio move voltag VOLUME-03 drive 0
> 
>       chio exchange voltag VOLUME-03 voltag VOLUME-04
> 
>  o A new sub-command "unload" that returns a media unit to the source
>    element reported by 'chio status -a':
> 
>       chio unload drive 0
>       chio unload voltag VOLUME-03
> 
> A patch relative to 4.1-STABLE (should work on 5.0-CURRENT as well) is
> available at:
> 
>     http://www.physics.purdue.edu/~csg/FreeBSD/chio.patch
> 
> 
> >Release-Note:
> >Audit-Trail:
> >Unformatted:
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-bugs" in the body of the message
>
Comment 2 csg 2000-09-11 02:35:53 UTC
On Sun, 10 Sep 2000 16:40:33 MST, Matthew Jacob wrote:

> Why doesn't somebody just merge the equivalent fixes from NetBSD's chio in
> to FreeBSD? Or where they already done?

This isn't actually a fix.  It allows you to select a media unit
to move by voltag.  It should make it easier for products like
amanda to drive a tape-changer with barcode reader on FreeBSD.

You can simply ask for a specific tape by voltag:

   chio move voltag VOLUME-03 drive 0

The other feature is the "unload" command which checks the source
parameter returned in the changer_element_status record.  If there's
a source parameter, we "unload" the media by moving it back where
the drive reports it came from.

This the logic to request a certain tape (if you have a barcode
reader or equivalent):

   chio unload drive <target-drive>
   chio move voltag <label> drive <target-drive>

If the second one fails, the tape isn't in the changer, raccoons
have eaten your barcodes, or the kids put bubblegum on the barcode
reader optics. ;-)

 - Steve

PS. the patch URL was incorrect before, I've fixed it (on my end).

--
C. Stephen Gunn                          URL: http://www.waterspout.com/
WaterSpout Communications, Inc.        Email: csg@waterspout.com
427 North 6th Street                   Phone: +1 765.742.6628
Lafayette, IN  47901                     Fax: +1 765.742.0646
Comment 3 mjacob 2000-09-11 04:55:15 UTC
hmm. Sounds good, actually. I'm not chio's maintainer tho.
Comment 4 ken 2000-09-11 07:56:23 UTC
On Sun, Sep 10, 2000 at 18:19:40 -0500, csg@waterspout.com wrote:
> >Description:
> 
> chio(1) provides no mechanism to select media by "voltag."
> chio(1) provides no mechanism to return a media unit to its source.
> 
> >How-To-Repeat:
> 
> N/A - new feature request.
> 
> >Fix:
> 
>  o A pseudo-element type selector "voltag" that can be used to select
>    source elements:
> 
>       chio move voltag VOLUME-03 drive 0
> 
>       chio exchange voltag VOLUME-03 voltag VOLUME-04
> 
>  o A new sub-command "unload" that returns a media unit to the source
>    element reported by 'chio status -a':
> 
>       chio unload drive 0
>       chio unload voltag VOLUME-03
> 
> A patch relative to 4.1-STABLE (should work on 5.0-CURRENT as well) is
> available at:
> 
>     http://www.physics.purdue.edu/~csg/FreeBSD/chio.patch

Looks like a pretty good idea.

I took a cursory glance through the patch, and noticed the 'XXX' comment
about looking through pickers and portals.

I'd suggest looking at them as well, even if it won't be used very often.
(I've moved things from pickers and portals often enough, though.)

I also wonder about the 'unload' keyword.  It almost sounds like something
you might use to eject a tape or something.  What about calling it 'return'
instead?  (I don't feel really strongly about this, but I figure we ought
to make things intuitive, if possible.)

Anyway, I'll try to give the patch a more thorough look-over in the next
few days.  I won't be able to do more than that before committing it,
though, since I don't have a test changer anymore.  (You've obviously
tested it, though, so we should be okay in that department.)

Ken
-- 
Kenneth Merry
ken@kdm.org
Comment 5 csg 2000-09-11 14:50:13 UTC
On Mon, 11 Sep 2000 00:56:23 CST, "Kenneth D. Merry" wrote:

> Looks like a pretty good idea.
> 
> I took a cursory glance through the patch, and noticed the 'XXX' comment
> about looking through pickers and portals.

Yeah.  I didn't do that because of the way the ioctl() works to
fetch information from the drive.  I guess it's not a big deal
though.  Since I don't have any pickers or portals on my test drive,
I'm not familiar with when a tape might be in one.  ( I guess I can
figure the portal one out real easy ). 

> I'd suggest looking at them as well, even if it won't be used very often.
> (I've moved things from pickers and portals often enough, though.)

I can add this.  I've got some other pending comments from my homeboys
on the cc: line.  I'll address those as well, and submit a more recent
patch early this week.

> I also wonder about the 'unload' keyword.  It almost sounds like something
> you might use to eject a tape or something. What about calling it 'return'
> instead?  (I don't feel really strongly about this, but I figure we ought
> to make things intuitive, if possible.)

<grin> I use it exclusively to "unload" a tape from the drive to the 
slot that it came from.  In my cursory investigation, drives (and
perhaps pickers/portals) are the only changer elements with a valid
source parameter.

> Anyway, I'll try to give the patch a more thorough look-over in the next
> few days.  I won't be able to do more than that before committing it,
> though, since I don't have a test changer anymore.  (You've obviously
> tested it, though, so we should be okay in that department.)

Let me fixup some stuff based input, and I'll update the pr, and cc: you.

Thanks!

 - Steve

--
C. Stephen Gunn                          URL: http://www.waterspout.com/
WaterSpout Communications, Inc.        Email: csg@waterspout.com
427 North 6th Street                   Phone: +1 765.742.6628
Lafayette, IN  47901                     Fax: +1 765.742.0646
Comment 6 csg 2000-09-12 05:21:45 UTC
On Mon, 11 Sep 2000 00:56:23 CST, "Kenneth D. Merry" wrote:

I've put a new patch online, same location:

   http://www.physics.purdue.edu/~csg/FreeBSD/chio.patch

Some cleanups, command name changes, sanity check some pointers.

> I'd suggest looking at them as well, even if it won't be used very often.
> (I've moved things from pickers and portals often enough, though.)

Done.

> I also wonder about the 'unload' keyword.  It almost sounds like something
> you might use to eject a tape or something.  What about calling it 'return'
> instead?  (I don't feel really strongly about this, but I figure we ought
> to make things intuitive, if possible.)

I slept on this, and 'return' makes as much sense (if not more) than
'unload' since it will work on any media unit that has a source attribute.

> Anyway, I'll try to give the patch a more thorough look-over in the next
> few days.  I won't be able to do more than that before committing it,
> though, since I don't have a test changer anymore.  (You've obviously
> tested it, though, so we should be okay in that department.)

Seems to work for me (tm).

Those who looked at it the first time are on the cc: line.  Have
another look if you want. :)

 - Steve

--
C. Stephen Gunn                          URL: http://www.waterspout.com/
WaterSpout Communications, Inc.        Email: csg@waterspout.com
427 North 6th Street                   Phone: +1 765.742.6628
Lafayette, IN  47901                     Fax: +1 765.742.0646
Comment 7 Sheldon Hearn freebsd_committer freebsd_triage 2000-09-12 15:19:59 UTC
Responsible Changed
From-To: freebsd-bugs->ken

Ken asked for the new patch.
Comment 8 ken 2000-09-15 07:58:23 UTC
On Mon, Sep 11, 2000 at 23:21:45 -0500, C. Stephen Gunn wrote:
> On Mon, 11 Sep 2000 00:56:23 CST, "Kenneth D. Merry" wrote:
> 
> I've put a new patch online, same location:
> 
>    http://www.physics.purdue.edu/~csg/FreeBSD/chio.patch
> 
> Some cleanups, command name changes, sanity check some pointers.

Well, I took a look through it this evening, and I don't see any code
problems.  It looks good!

I've made some minor style changes, though, diffs against -current are
attached.

Ken
-- 
Kenneth Merry
ken@kdm.org
Comment 9 Kenneth D. Merry freebsd_committer freebsd_triage 2000-09-18 07:09:18 UTC
State Changed
From-To: open->suspended

I have committed the latest version of these patches to -current.  Once 
they've had a chance to sit in -current for a little while, I'll merge them 
to RELENG_4.  Thanks Steve!
Comment 10 Pete Fritchman freebsd_committer freebsd_triage 2003-01-18 07:10:49 UTC
State Changed
From-To: suspended->closed

This support is in RELENG_4.