Sha256: bf281e382aba1c36cfd7c8a5d8d70320e2bca69ea9efffbf038b1f54c7ab363d

Contents?: true

Size: 605 Bytes

Versions: 66

Compression:

Stored size: 605 Bytes

Contents

# encoding: US-ASCII
module QcowDiskProbe
  QCOW_MAGIC   = "QFI\xfb"
  QCOW_DISK    = "QcowDisk"

  def self.probe(ostruct)
    return nil if ostruct.fileName.nil?

    size  = File.size(ostruct.fileName)
    f     = File.new(ostruct.fileName, "rb")

    rv = doProbe(f)
    f.close

    rv
  end

  def self.probeByDisk(disk)
    doProbe(disk)
  end

  def self.doProbe(io)
    io.seek(0)
    magic = io.read(4)

    return QCOW_DISK if magic == QCOW_MAGIC
    $log.debug "QcowDiskProbe.doProbe: returning nil, #{magic.dump} != #{QCOW_MAGIC.dump}"
    nil
  end

  def self.stackable?
    true
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
manageiq-smartstate-0.10.1 lib/disk/modules/QcowDiskProbe.rb
manageiq-smartstate-0.10.0 lib/disk/modules/QcowDiskProbe.rb
manageiq-smartstate-0.9.0 lib/disk/modules/QcowDiskProbe.rb
manageiq-smartstate-0.8.1 lib/disk/modules/QcowDiskProbe.rb
manageiq-smartstate-0.8.0 lib/disk/modules/QcowDiskProbe.rb
manageiq-smartstate-0.7.0 lib/disk/modules/QcowDiskProbe.rb
manageiq-smartstate-0.6.2 lib/disk/modules/QcowDiskProbe.rb
manageiq-smartstate-0.5.10 lib/disk/modules/QcowDiskProbe.rb
manageiq-smartstate-0.3.10 lib/disk/modules/QcowDiskProbe.rb
manageiq-smartstate-0.6.1 lib/disk/modules/QcowDiskProbe.rb
manageiq-smartstate-0.3.9 lib/disk/modules/QcowDiskProbe.rb
manageiq-smartstate-0.6.0 lib/disk/modules/QcowDiskProbe.rb
manageiq-smartstate-0.5.9 lib/disk/modules/QcowDiskProbe.rb
manageiq-smartstate-0.5.8 lib/disk/modules/QcowDiskProbe.rb
manageiq-smartstate-0.3.8 lib/disk/modules/QcowDiskProbe.rb
manageiq-smartstate-0.5.7 lib/disk/modules/QcowDiskProbe.rb
manageiq-smartstate-0.3.7 lib/disk/modules/QcowDiskProbe.rb
manageiq-smartstate-0.5.6 lib/disk/modules/QcowDiskProbe.rb
manageiq-smartstate-0.3.6 lib/disk/modules/QcowDiskProbe.rb
manageiq-smartstate-0.5.5 lib/disk/modules/QcowDiskProbe.rb