[Libguestfs] Consider to replace isoinfo by own code rather than by xorriso

Thomas Schmitt scdbackup at gmx.net
Tue Mar 30 20:57:07 UTC 2021


Hi,

thank you for flying xorriso. :))

But as its author and looking at

  https://github.com/libguestfs/libguestfs/blob/master/daemon/isoinfo.ml

i feel obliged to point out that using it as replacement for isoinfo
will increase the consumption of RAM and CPU cycles substantially.

xorriso command -indev loads the whole directory tree of the ISO filesystem
with names and metadata. Depending on that tree this can be dozens of
megabytes and lots of insertion operations in a not much optimized tree
model.
On the other hand it is quite uncomplicated to implement an own ISO 9660
PVD reader and to become independent of any external program for that
purpose.

The Primary Volume Descriptor begins at LBA 16 (= byte offset 32768).
Its layout is described in ECMA-119 8.4 (note: BP = byte offset + 1)
  https://www.ecma-international.org/wp-content/uploads/ECMA-119_4th_edition_june_2019.pdf
or in HTML at
  https://wiki.osdev.org/ISO_9660#The_Primary_Volume_Descriptor

E.g. the info missing in xorriso's output of -pvd_info is at offsets:

   80 -  87 iso_volume_space_size
            (unsigned 32 bit, little endian first, then again as big endian)

  124 - 127 iso_volume_sequence_number
            (unsigned 16 bit, little endian first, then again as big endian)

  128 - 131 iso_logical_block_size
            (unsigned 16 bit, little endian first, then again as big endian)
            (If you don't read 2048 here, then you are in unchartered
             territory.)

The date format for e.g. iso_volume_creation_t at offset 813 - 829
is a decimal digit string YYYMMDDhhmmsshh with a trailing binary byte
value for the time zone with 15 minutes granularity. ("hh" means
hundredths of seconds.)
See also
  https://wiki.osdev.org/ISO_9660#Numerical_formats
  https://wiki.osdev.org/ISO_9660#Date.2Ftime_format


Have a nice day :)

Thomas





More information about the Libguestfs mailing list