Sha256: 8b9b4ec223d36c1a807c8a65ed4a15e8caea82374a0b4f2326afd1877df30639

Contents?: true

Size: 1.4 KB

Versions: 5

Compression:

Stored size: 1.4 KB

Contents

# frozen_string_literal: true

module Libvirt
  module FFI
    module NodeInfo
      extend ::FFI::Library
      ffi_lib Util.library_path

      # struct virNodeInfo {
      #
      #   char model[32] 	model - string indicating the CPU model
      #   unsigned long 	memory - memory size in kilobytes
      #   unsigned int 	cpus - the number of active CPUs
      #   unsigned int 	mhz - expected CPU frequency, 0 if not known or on unusual architectures
      #   unsigned int 	nodes - the number of NUMA cell, 1 for unusual NUMA topologies or uniform memory access;
      #     check capabilities XML for the actual NUMA topology
      #   unsigned int 	sockets - number of CPU sockets per node if nodes > 1, 1 in case of unusual NUMA topology
      #   unsigned int 	cores - number of cores per socket, total number of processors in case of unusual NUMA topolog
      #   unsigned int 	threads - number of threads per core, 1 in case of unusual numa topology
      # }
      class Struct < ::FFI::Struct
        layout :model, [:char, 32],
               :memory, :ulong,
               :cpus, :uint,
               :mhz, :uint,
               :nodes, :uint,
               :sockets, :uint,
               :cores, :uint,
               :threads, :uint
      end

      # int	virNodeGetInfo			(virConnectPtr conn,
      # 					 virNodeInfoPtr info)
      attach_function :virNodeGetInfo, [:pointer, :pointer], :int
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
libvirt_ffi-0.4.1 lib/libvirt/ffi/node_info.rb
libvirt_ffi-0.4.0 lib/libvirt/ffi/node_info.rb
libvirt_ffi-0.3.0 lib/libvirt/ffi/node_info.rb
libvirt_ffi-0.2.1 lib/libvirt/ffi/node_info.rb
libvirt_ffi-0.2.0 lib/libvirt/ffi/node_info.rb