Giter Site home page Giter Site logo

Comments (2)

doug-gilbert avatar doug-gilbert commented on June 9, 2024

Thanks for bringing that to my attention. There has been a big code re-arrangement under both sg_inq and sg_vpd since both output more or less the same VPD pages. When I was looking at JSON output, I realized that duplicating the code for sg_inq and sg_vpd was pretty wasteful. My thinking with -H (especially used multiple times) has evolved over time, and I use it a lot for testing since it can now be parsed (with the --inhex=FN option). I'm in the middle of adding the "cappid" changes (see the newly released sbc5r04.pdf and spc6r07.pdf), so it will be a few days before (svn) revision 999 hits this mirror. Hopefully that revision will improve the 'sg_inq -HH' and 'sg_vpd -HH' handling. They should output VPD pages in hex, with a running address/index in the first column, and with no ASCII rendering to the right. Hmmm, that contradicts what 'man sg3_utils' says under the '--hex' option. I need to sort this out ....

from sg3_utils.

doug-gilbert avatar doug-gilbert commented on June 9, 2024

Recently checked-in svn revision 999 and it is mirrored here. Lots of --hex option related changes. The broad thrust is to follow what 'man sg3_utils(8)' says about that option. When used once, 16 bytes (or less) are output on each line with a leading address or index at the start of each line (starting at 0). When used twice, an ASCII rendering of the data is appended to each line. When used more than twice, the output is meant to be parsable. That means no leading address/index nor ASCII rendering to the right, just the hex bytes. But there are corner cases such as 'sg_inq -p ai -HHH' which outputs 16 bit hexadecimal words (little endian) suitable as input for hdparm to accept as input and decode. Using '-HHHHH' or one less in many utilities then each VPD, log, etc page is prefixed by a blank line and then a comment line starting with '#' followed by the name of that page. Thereafter that page is output in hex. So that output is both easy to parse and can also be cut up with a text editor to remove pages that are not of interest. The simplifies handling something like: 'sg_vpd -p all -HHHHH <scsi_device_node>'.
As for checked in code failing to compile, that seems strange. Before I check-in code I run clang -analyze and g++ -std=c++23 on it. Once it is checked in, github runs the code on many architectures and reports any warnings or errors to me. Note that recently I removed ./configure and all the Makefile.in files and their supports. So now ./autogen.sh or ./bootstrap needs to be run to generate ./configure and friends. The downside of that change is the ./autogen.sh needs autoconf installed. The upside is that it removed over 49,000 line of code from my svn and git repositories.

from sg3_utils.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.