sg_logs: output for Device Statistics page (14h), serial numbers should be strings?
Closed this issue · 5 comments
Hi,
stumbled across this output for sg_logs --page=0x14
on a tape device:
Device statistics page (ssc-3 and adc)
Lifetime media loads: 0
Drive manufacturer's serial number: 0
Drive serial number: 0
Should parameter codes 0x40 and 0x41 be printed as string data?
https://github.com/doug-gilbert/sg3_utils/blob/main/src/sg_logs.c#L8038
Thanks!
Yes they should. Should be fixed in svn revision 1058 which is now mirrored here.
@patrickdowling, can you verify this? How does the output look like after the fix?
Great. I don't have access today but I'll check the output on Monday.
Okay, the output both default and json looks much better:
Device statistics log page (ssc-3 and adc)
Lifetime media loads: 0
Drive manufacturer's serial number: 5000000100
Drive serial number: 50000001
{
"parameter_code": {
"i": 64,
"meaning": "Drive manufacturer's serial number"
},
"serial_number": "5000000100 "
},
{
"parameter_code": {
"i": 65,
"meaning": "Drive serial number"
},
"serial_number": "50000001\\x00\\x00\\x00\\x00"
}
(Please ignore the malformed string, that’s a broken response from the emulated device code. Mea culpa.)
I'll see if there's a physical drive available.
I never did get access to a physical device to check against, but I think we can close this.
Sorry for the dangling issue. Thanks again!