module FFI::VixDiskLib::API

Constants

AdapterType

Disk adapter types

ConnectParams
CredType

Credential Type - SessionId not yet supported

DiskType

Disk types

HWVERSION_CURRENT

Defines the state of the art hardware version. Be careful using this as it will change from time to time.

HWVERSION_ESX30

VMware ESX Server 3.0

HWVERSION_WORKSTATION_4

VMware Workstation 4.x and GSX Server 3.x

HWVERSION_WORKSTATION_5

VMware Workstation 5.x and Server 1.x

HWVERSION_WORKSTATION_6

VMware Workstation 6.x

LOADED_LIBRARY
VERSION
VIXDISKLIB_FLAG_OPEN_READ_ONLY
VIXDISKLIB_FLAG_OPEN_UNBUFFERED

Flags for open

VIXDISKLIB_SECTOR_SIZE
VixErrorType

The error codes are returned by all public VIX routines.

Public Class Methods

attach_function(*args) click to toggle source
Calls superclass method
# File lib/ffi-vix_disk_lib/api.rb, line 8
def self.attach_function(*args)
  super
rescue FFI::NotFoundError
  warn "unable to attach #{args.first}"
end
enum(*args) click to toggle source
Calls superclass method
# File lib/ffi-vix_disk_lib/enum.rb, line 8
def self.enum(*args)
  s = super
  # Expose enums as constants
  s.symbols.each { |sym| const_set(sym, s[sym]) }
  s
end
evaluate_versioned_connect_params() click to toggle source
# File lib/ffi-vix_disk_lib/api.rb, line 58
def self.evaluate_versioned_connect_params
  Gem::Version.new(VERSION) >= Gem::Version.new("6.5.0") ? ConnectParams_6_5_0 : ConnectParams_1_0_0
end
load_error() click to toggle source

Maintain backwards compatibility with the previous method of loading libvixDiskLib

# File lib/ffi-vix_disk_lib/api.rb, line 18
def self.load_error
  nil
end
vix_error_code(err) click to toggle source

An error is a 64-bit value. If there is no error, then the value is set to VIX_OK. If there is an error, then the least significant bits will be set to one of the integer error codes defined below. The more significant bits may or may not be set to various values, depending on the errors.

# File lib/ffi-vix_disk_lib/api.rb, line 46
def self.vix_error_code(err)
  err & 0xFFFF
end
vix_failed?(err) click to toggle source
# File lib/ffi-vix_disk_lib/api.rb, line 54
def self.vix_failed?(err)
  err != VixErrorType[:VIX_OK]
end
vix_succeeded?(err) click to toggle source
# File lib/ffi-vix_disk_lib/api.rb, line 50
def self.vix_succeeded?(err)
  err == VixErrorType[:VIX_OK]
end