class VdlWrapper

Public Class Methods

__disconnect__(conn_obj) click to toggle source
# File lib/VMwareWebService/VixDiskLib/vdl_wrapper.rb, line 61
def self.__disconnect__(conn_obj)
  logger.info "VdlWrapper.__disconnect__: #{conn_obj.serverName}"
  raise VixDiskLibError, "VixDiskLib is not initialized" unless @initialized
  FFI::VixDiskLib::API.disconnect(conn_obj.vdl_connection)
  @connection = nil
end
__exit__() click to toggle source
# File lib/VMwareWebService/VixDiskLib/vdl_wrapper.rb, line 68
def self.__exit__
  raise VixDiskLibError, "VixDiskLib is not initialized" unless @initialized
  __disconnect__(@connection) unless @connection.nil?
  #
  # NOTE: We have to comment this call out for now.
  # For some reason the call to VixDiskLib.exit is causing
  # the DRb service (this process) to segfault during the exit sequence.
  #
  # super
  logger.info "VixDiskLib has exited cleanly"
  @vddk.running = true
  @vddk.shutdown = true
  @initialized = nil
end
connect(connect_parms) click to toggle source
# File lib/VMwareWebService/VixDiskLib/vdl_wrapper.rb, line 53
def self.connect(connect_parms)
  logger.info "VdlWrapper.connect: #{connect_parms[:server_name]}"
  raise VixDiskLibError, "VixDiskLib is not initialized" unless @initialized
  raise VixDiskLibError, "Already connected to #{@connection.serverName}" if @connection
  @connection = VdlConnection.new(connect_parms, @vddk)
  @connection
end
dec_server_disk_count() click to toggle source
# File lib/VMwareWebService/VixDiskLib/vdl_wrapper.rb, line 47
def self.dec_server_disk_count
  @server_disk_count -= 1
  @vddk.running = true
  @server_disk_count
end
dumpDisks(server_name) click to toggle source
# File lib/VMwareWebService/VixDiskLib/vdl_wrapper.rb, line 34
def self.dumpDisks(server_name)
  logger.warn "*** Open VdlDisks for server #{server_name}"
  @connection.dumpDisks unless @connection.nil? || @connection.serverName != server_name
  @vddk.running = true
  logger.warn "*** Open VdlDisks end"
end
inc_server_disk_count() click to toggle source
# File lib/VMwareWebService/VixDiskLib/vdl_wrapper.rb, line 41
def self.inc_server_disk_count
  @server_disk_count += 1
  @vddk.running = true
  @server_disk_count
end
init() click to toggle source
# File lib/VMwareWebService/VixDiskLib/vdl_wrapper.rb, line 27
def self.init
  return if @initialized
  FFI::VixDiskLib::ApiWrapper.init(@info_log, @warn_log, @error_log, nil)
  @initialized = true
  @connection = nil
end
server(server) click to toggle source
# File lib/VMwareWebService/VixDiskLib/vdl_wrapper.rb, line 18
def self.server(server)
  return unless @vddk.nil?
  @vddk = server
end