fix wrong for-loop calculation in position_blocks_back

Fix wrong for-loop calculation in position_blocks_back
which will cause vtltape process to crash.
Merge pull request #2 from casualfish/fixbugs

fix wrong for-loop calculation in position_blocks_back
New utility 'edit_tape'

Ability to edit meta data of virtual media.

Signed-off-by: Mark Harvey <markh794@gmail.com>
Reduce duplicate code setting media info

Routine common with mktape & edit_tape.
Use one function in vtllib.c - set_media_params()

Signed-off-by: Mark Harvey <markh794@gmail.com>
man page for edit_tape utility

Signed-off-by: Mark Harvey <markh794@gmail.com>
Update date stamp on man pages to January 2013

I need to set aside time to re-read man pages to make sure they
are still all valid.

Signed-off-by: Mark Harvey <markh794@gmail.com>
Install new man page for 'edit_tape'

Signed-off-by: Mark Harvey <markh794@gmail.com>
Update spec file for new 'edit_tape' utilities

Signed-off-by: Mark Harvey <markh794@gmail.com>
mhvtl.spec: Update for 1.4-6_release

Fix segfault in vtltape -> position_blocks_back()
Fix TAPE CAPACITY log page info

New utility 'edit_tape' to update virtual media 'metadata'

Signed-off-by: Mark Harvey <markh794@gmail.com>
Update last load MAM information

Signed-off-by: Mark Harvey <markh794@gmail.com>
Update default 'FormattedDensityCode' in MAM data

Signed-off-by: Mark Harvey <markh794@gmail.com>
Update 'drive_stats.pl' to report last drives media has been loaded into

Add to report the last 4 drives this media has been loaded into.
e.g.
Media previously mounted in  : [IBM     XYZZY_A2  ]
Media previously mounted in  : [HP      XYZZY_A1  ]
Media previously mounted in  : []
Media previously mounted in  : []

Signed-off-by: Mark Harvey <markh794@gmail.com>
Correct comment in 'drive_stats.pl'

Comment:
  last loop make key..
Changed to
  last loop matched key..
Re-formatted to suit 80 column limit

Signed-off-by: Mark Harvey <markh794@gmail.com>
Add ability to set media as 'read-only'

Enhance new 'edit_tape' utility to set/clear the media write-protect flag

Signed-off-by: Mark Harvey <markh794@gmail.com>
Remove useless ',' from media capacity log message.

Signed-off-by: Mark Harvey <markh794@gmail.com>
Fix loading media with write-protect set.

Fix faulty logic where loading of WRITE-PROTECTED media would update
the drive capabilities to load all media of the same type to READ-ONLY

Reference:
http://mhvtl-linux-virtual-tape-library-community-forums.966029.n3.nabble.com/Setting-tape-write-protect-tp2900316p4025268.html

Reported-by: nia
Signed-off-by: Mark Harvey <markh794@gmail.com>
Initial commit of DLT7000/DLT8000 emulation

Signed-off-by: Mark Harvey <markh794@gmail.com>
Personality module: Rework initialise sequence

Found many of the personality modules ordered the initialisation
in different order. Although not a problem in itself, it is confusing
to read.

Signed-off-by: Mark Harvey <markh794@gmail.com>
Make up barcode 'rules' for DLT7k & 9x40 drives

Signed-off-by: Mark Harvey <markh794@gmail.com>
Log error if buffer is too small on receiving HUP

If re-config of library and many more slots added, it is possible
the allocated buffer to return READ ELEMENT STATUS will overflow.

Log error recommeding restart of daemon.

Signed-off-by: Mark Harvey <markh794@gmail.com>