mirror of
https://github.com/moibenko/mtx.git
synced 2025-12-23 05:55:13 +00:00
Merge pull request #3 from moibenko/revert-2-mtx_jinr
Revert "Found problem with fullup of product ID and Serial Number"
This commit is contained in:
@@ -1040,17 +1040,6 @@ int parse_args(void)
|
|||||||
device = argv[i++];
|
device = argv[i++];
|
||||||
open_device(); /* open the device and do a status scan on it... */
|
open_device(); /* open the device and do a status scan on it... */
|
||||||
}
|
}
|
||||||
else if (strcmp(argv[i], "-a") == 0)
|
|
||||||
{
|
|
||||||
printf("absolute addressing\n");
|
|
||||||
i++;
|
|
||||||
if (i >= argc)
|
|
||||||
{
|
|
||||||
Usage();
|
|
||||||
}
|
|
||||||
absolute_addressing = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cmd_tbl_idx = 0; /* default to the first command... */
|
cmd_tbl_idx = 0; /* default to the first command... */
|
||||||
|
|||||||
@@ -565,10 +565,7 @@ TransportElementDescriptor_T;
|
|||||||
/* Now for element status data; */
|
/* Now for element status data; */
|
||||||
|
|
||||||
typedef unsigned char barcode[37];
|
typedef unsigned char barcode[37];
|
||||||
//typedef unsigned char serialnumber[13];
|
|
||||||
typedef unsigned char serialnumber[13];
|
typedef unsigned char serialnumber[13];
|
||||||
typedef unsigned char devicetype[17];
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct ElementStatus {
|
typedef struct ElementStatus {
|
||||||
|
|
||||||
@@ -578,7 +575,7 @@ typedef struct ElementStatus {
|
|||||||
int *DataTransferElementAddress; /* array. */
|
int *DataTransferElementAddress; /* array. */
|
||||||
int *DataTransferElementSourceStorageElementNumber; /* array */
|
int *DataTransferElementSourceStorageElementNumber; /* array */
|
||||||
int *DataTransferElementPhysicalLocation; /*array */
|
int *DataTransferElementPhysicalLocation; /*array */
|
||||||
devicetype *DataTransferElementProductId; /*array */
|
serialnumber *DataTransferElementProductId; /*array */
|
||||||
serialnumber *DataTransferElementSerialNumber; /*array */
|
serialnumber *DataTransferElementSerialNumber; /*array */
|
||||||
barcode *StorageElementPhysicalLocation; /*array */
|
barcode *StorageElementPhysicalLocation; /*array */
|
||||||
barcode *DataTransferPrimaryVolumeTag; /* array. */
|
barcode *DataTransferPrimaryVolumeTag; /* array. */
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
Name: mtx
|
Name: mtx
|
||||||
Version: 1.3.12
|
Version: 1.3.12
|
||||||
Release: 19fnal_jinr%{?dist}
|
Release: 15fnal%{?dist}
|
||||||
Summary: SCSI media changer control program
|
Summary: SCSI media changer control program
|
||||||
License: GPLv2
|
License: GPLv2
|
||||||
Group: Applications/System
|
Group: Applications/System
|
||||||
@@ -51,10 +51,6 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Thu Dec 07 2023 Alexander Moibenko <moibenko@jinr.ru> - 1.3.12-19fnal
|
|
||||||
- mtx CLI hasn hidden option (-a) to show status information with absolute addresses
|
|
||||||
- Fixed problem seen in JINR where serial number was missing few last symbols
|
|
||||||
|
|
||||||
* Wed Jan 23 2019 Alexander Moibenko <moibenko@fnal.gov> - 1.3.12-15fnal
|
* Wed Jan 23 2019 Alexander Moibenko <moibenko@fnal.gov> - 1.3.12-15fnal
|
||||||
- For absolute_addressing refresh elements data when status command is executed. This is needed to update tape library infortion in the calling program.
|
- For absolute_addressing refresh elements data when status command is executed. This is needed to update tape library infortion in the calling program.
|
||||||
- Changes to allow to use mtx as library and show absolute transfer and storage elements as output of status call
|
- Changes to allow to use mtx as library and show absolute transfer and storage elements as output of status call
|
||||||
|
|||||||
@@ -563,7 +563,7 @@ static ElementStatus_T *AllocateElementData(ElementModeSense_T *mode_sense)
|
|||||||
retval->DataTransferElementPhysicalLocation =
|
retval->DataTransferElementPhysicalLocation =
|
||||||
(int *)xzmalloc(sizeof(int) * (mode_sense->NumDataTransfer + 1));
|
(int *)xzmalloc(sizeof(int) * (mode_sense->NumDataTransfer + 1));
|
||||||
retval->DataTransferElementProductId =
|
retval->DataTransferElementProductId =
|
||||||
(devicetype *)xzmalloc(sizeof(devicetype) * (mode_sense->NumDataTransfer + 1));
|
(serialnumber *)xzmalloc(sizeof(serialnumber) * (mode_sense->NumDataTransfer + 1));
|
||||||
retval->DataTransferElementSerialNumber =
|
retval->DataTransferElementSerialNumber =
|
||||||
(serialnumber *)xzmalloc(sizeof(serialnumber) * (mode_sense->NumDataTransfer + 1));
|
(serialnumber *)xzmalloc(sizeof(serialnumber) * (mode_sense->NumDataTransfer + 1));
|
||||||
retval->StorageElementPhysicalLocation =
|
retval->StorageElementPhysicalLocation =
|
||||||
@@ -618,16 +618,9 @@ void copy_physical_location(unsigned char *src, unsigned char *dest)
|
|||||||
void copy_char_buffer(unsigned char *src, unsigned char *dest, int num)
|
void copy_char_buffer(unsigned char *src, unsigned char *dest, int num)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char *dest_tmp;
|
while ((*src< 32) || (*src > 127)) {
|
||||||
dest_tmp = dest;
|
|
||||||
while ((*src<= 32) || (*src > 127)) {
|
|
||||||
src++;
|
src++;
|
||||||
}
|
}
|
||||||
for (i=0; i < num; i++)
|
|
||||||
{
|
|
||||||
*dest_tmp++ = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i=0; i < num; i++)
|
for (i=0; i < num; i++)
|
||||||
{
|
{
|
||||||
*dest = *src++;
|
*dest = *src++;
|
||||||
|
|||||||
Reference in New Issue
Block a user