Sha256: 25885a3545bffbe533ae4ca3129de041b80296dfa8047c6ef909d13a9960b713

Contents?: true

Size: 437 Bytes

Versions: 14

Compression:

Stored size: 437 Bytes

Contents

module ZFSProbe
  ZFS_SUPER_OFFSET  = 0
  ZFS_MAGIC_OFFSET  = 0
  ZFS_MAGIC_SIZE    = 4
  ZFS_SUPER_MAGIC   = 0x00bab10c

  def self.probe(dobj)
    return(false) unless dobj.kind_of?(MiqDisk)

    # Check for magic at uberblock offset.
    dobj.seek(ZFS_SUPER_OFFSET + ZFS_MAGIC_OFFSET)
    magic = dobj.read(ZFS_MAGIC_SIZE).unpack('L')[0]
    raise "ZFS is Not Supported" if magic == ZFS_SUPER_MAGIC

    # No ZFS.
    false
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
manageiq-smartstate-0.2.6 lib/fs/MiqFS/modules/ZFSProbe.rb
manageiq-smartstate-0.2.5 lib/fs/MiqFS/modules/ZFSProbe.rb
manageiq-smartstate-0.2.4 lib/fs/MiqFS/modules/ZFSProbe.rb
manageiq-smartstate-0.2.3 lib/fs/MiqFS/modules/ZFSProbe.rb
manageiq-smartstate-0.2.2 lib/fs/MiqFS/modules/ZFSProbe.rb
manageiq-smartstate-0.2.1 lib/fs/MiqFS/modules/ZFSProbe.rb
manageiq-smartstate-0.2.0 lib/fs/MiqFS/modules/ZFSProbe.rb
manageiq-smartstate-0.1.6 lib/fs/MiqFS/modules/ZFSProbe.rb
manageiq-smartstate-0.1.5 lib/fs/MiqFS/modules/ZFSProbe.rb
manageiq-smartstate-0.1.4 lib/fs/MiqFS/modules/ZFSProbe.rb
manageiq-smartstate-0.1.3 lib/fs/MiqFS/modules/ZFSProbe.rb
manageiq-smartstate-0.1.2 lib/fs/MiqFS/modules/ZFSProbe.rb
manageiq-smartstate-0.1.1 lib/fs/MiqFS/modules/ZFSProbe.rb
manageiq-smartstate-0.1.0 lib/fs/MiqFS/modules/ZFSProbe.rb