Module: Libvirt

Defined in:
lib/libvirt.rb,
lib/libvirt/ffi.rb,
lib/libvirt/xml.rb,
lib/libvirt/util.rb,
lib/libvirt/event.rb,
lib/libvirt/domain.rb,
lib/libvirt/errors.rb,
lib/libvirt/stream.rb,
lib/libvirt/network.rb,
lib/libvirt/version.rb,
lib/libvirt/ffi/host.rb,
lib/libvirt/loggable.rb,
lib/libvirt/xml/disk.rb,
lib/libvirt/xml/vcpu.rb,
lib/libvirt/base_info.rb,
lib/libvirt/ffi/error.rb,
lib/libvirt/ffi/event.rb,
lib/libvirt/interface.rb,
lib/libvirt/node_info.rb,
lib/libvirt/connection.rb,
lib/libvirt/ffi/common.rb,
lib/libvirt/ffi/domain.rb,
lib/libvirt/ffi/stream.rb,
lib/libvirt/xml/domain.rb,
lib/libvirt/xml/memory.rb,
lib/libvirt/ffi/helpers.rb,
lib/libvirt/ffi/network.rb,
lib/libvirt/ffi/storage.rb,
lib/libvirt/xml/generic.rb,
lib/libvirt/xml/network.rb,
lib/libvirt/storage_pool.rb,
lib/libvirt/xml/graphics.rb,
lib/libvirt/xml/max_vcpu.rb,
lib/libvirt/ffi/interface.rb,
lib/libvirt/xml/interface.rb,
lib/libvirt/storage_volume.rb,
lib/libvirt/xml/ip_address.rb,
lib/libvirt/xml/storage_pool.rb,
lib/libvirt/storage_pool_info.rb,
lib/libvirt/network_dhcp_lease.rb,
lib/libvirt/xml/storage_volume.rb,
lib/libvirt/storage_volume_info.rb,
lib/libvirt/host_callback_storage.rb

Defined Under Namespace

Modules: Errors, FFI, Loggable, Util, Xml Classes: BaseInfo, Connection, Domain, Event, HostCallbackStorage, Interface, Network, NetworkDhcpLease, NodeInfo, StoragePool, StoragePoolInfo, StorageVolume, StorageVolumeInfo, Stream

Constant Summary collapse

EVENT_HANDLE_READABLE =
1
EVENT_HANDLE_WRITABLE =
2
EVENT_HANDLE_ERROR =
4
EVENT_HANDLE_HANGUP =
8
VERSION =
'0.8.1'

Class Method Summary collapse

Class Method Details

.lib_versionObject

Raises:



31
32
33
34
35
36
37
38
# File 'lib/libvirt.rb', line 31

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

.loggerObject



40
41
42
# File 'lib/libvirt.rb', line 40

def logger
  Util.logger
end

.logger=(logger) ⇒ Object



44
45
46
# File 'lib/libvirt.rb', line 44

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