Sha256: ba9379f5f55a9cb2575dd2cdaab625066d34882229bb64bc21ee1b7276793bc1

Contents?: true

Size: 1.03 KB

Versions: 7

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

require 'ffi'
require 'objspace'
require 'libvirt/domain_callback_storage'
require 'libvirt/util'
require 'libvirt/errors'
require 'libvirt/ffi'
require 'libvirt/base_info'
require 'libvirt/node_info'
require 'libvirt/storage_pool_info'
require 'libvirt/storage_volume_info'
require 'libvirt/event'
require 'libvirt/connection'
require 'libvirt/domain'
require 'libvirt/stream'
require 'libvirt/storage_pool'
require 'libvirt/storage_volume'
require 'libvirt/version'

module Libvirt
  EVENT_HANDLE_READABLE = 1
  EVENT_HANDLE_WRITABLE = 2
  EVENT_HANDLE_ERROR = 4
  EVENT_HANDLE_HANGUP = 8

  class << self
    def lib_version
      version_ptr = ::FFI::MemoryPointer.new(:ulong)
      code = FFI::Host.virGetVersion(version_ptr, nil, nil)
      raise Errors::LibError, 'failed to get version' if code.negative?

      version_number = version_ptr.get_ulong(0)
      Util.parse_version(version_number)
    end

    def logger
      Util.logger
    end

    def logger=(logger)
      Util.logger = logger
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
libvirt_ffi-0.5.6 lib/libvirt.rb
libvirt_ffi-0.5.5 lib/libvirt.rb
libvirt_ffi-0.5.4 lib/libvirt.rb
libvirt_ffi-0.5.3 lib/libvirt.rb
libvirt_ffi-0.5.2 lib/libvirt.rb
libvirt_ffi-0.5.1 lib/libvirt.rb
libvirt_ffi-0.5.0 lib/libvirt.rb