vminfo

package
v0.0.0-...-fbda11f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package vminfo extracts information about the target VM. The package itself runs on the host, which may be a different OS/arch. User of the package first requests set of files that needs to be fetched from the VM and set of test programs that needs to be executed in the VM (Checker.RequiredThings), then fetches these files and executes test programs, and calls Checker.MachineInfo to parse the files and extract information about the VM, and optionally calls Checker.Check to obtain list of enabled/disabled syscalls. The information includes information about kernel modules and OS-specific info (for Linux that includes things like parsed /proc/cpuinfo).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, cfg *Config) *Checker

func (*Checker) MachineInfo

func (checker *Checker) MachineInfo(fileInfos []*flatrpc.FileInfo) ([]*KernelModule, []byte, error)

func (*Checker) Next

func (checker *Checker) Next() *queue.Request

Implementation of the queue.Source interface.

func (*Checker) Run

func (checker *Checker) Run(files []*flatrpc.FileInfo, featureInfos []*flatrpc.FeatureInfo) (
	map[*prog.Syscall]bool, map[*prog.Syscall]string, Features, error)

type Config

type Config struct {
	Target *prog.Target
	VMType string
	// Set of features to check, missing features won't be checked/enabled after Run.
	Features flatrpc.Feature
	// Set of syscalls to check.
	Syscalls   []int
	Debug      bool
	Cover      bool
	Sandbox    flatrpc.ExecEnv
	SandboxArg int64
}

type Feature

type Feature struct {
	Enabled   bool
	NeedSetup bool
	Reason    string
}

type Features

type Features map[flatrpc.Feature]Feature

func (Features) Enabled

func (features Features) Enabled() flatrpc.Feature

func (Features) NeedSetup

func (features Features) NeedSetup() flatrpc.Feature

type KernelModule

type KernelModule struct {
	Name string
	Addr uint64
	Size uint64
	Path string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL