Sha256: 633dc7a26b53dc2e609b11067c66b9affd8d1f8f0534ba5a5bcf0484e0afb4c0

Contents?: true

Size: 752 Bytes

Versions: 46

Compression:

Stored size: 752 Bytes

Contents

require 'disk/modules/MiqLargeFile'
require 'disk/modules/miq_disk_common'

module MSVSFixedDisk
  def d_init
    @diskType = "MSVSFixed"
    @blockSize = 512

    fileMode = MiqDiskCommon.file_mode

    if dInfo.hyperv_connection
      @ms_flat_disk_file = MSCommon.connect_to_hyperv(dInfo)
    else
      @ms_flat_disk_file = MiqLargeFile.open(dInfo.fileName, fileMode)
    end
  end

  def d_read(pos, len)
    @ms_flat_disk_file.seek(pos, IO::SEEK_SET)
    @ms_flat_disk_file.read(len)
  end

  def getBase
    self
  end

  def d_write(pos, buf, len)
    @ms_flat_disk_file.seek(pos, IO::SEEK_SET)
    @ms_flat_disk_file.write(buf, len)
  end

  def d_close
    @ms_flat_disk_file.close
  end

  def d_size
    File.size(dInfo.fileName)
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
manageiq-smartstate-0.2.15 lib/disk/modules/MSVSFixedDisk.rb
manageiq-smartstate-0.2.14 lib/disk/modules/MSVSFixedDisk.rb
manageiq-smartstate-0.2.13 lib/disk/modules/MSVSFixedDisk.rb
manageiq-smartstate-0.2.12 lib/disk/modules/MSVSFixedDisk.rb
manageiq-smartstate-0.2.11 lib/disk/modules/MSVSFixedDisk.rb
manageiq-smartstate-0.2.10 lib/disk/modules/MSVSFixedDisk.rb