kvm

package
v0.0.0-...-9ec6d29 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: Apache-2.0, MIT Imports: 36 Imported by: 0

Documentation

Overview

Package kvm provides a kvm-based implementation of the platform interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenDevice

func OpenDevice(devicePath string) (*os.File, error)

OpenDevice opens the KVM device and returns the File. If the devicePath is empty, it will default to /dev/kvm.

Types

type KVM

type KVM struct {
	platform.NoCPUPreemptionDetection

	// KVM never changes mm_structs.
	platform.UseHostProcessMemoryBarrier
	// contains filtered or unexported fields
}

KVM represents a lightweight VM context.

func New

func New(deviceFile *os.File) (*KVM, error)

New returns a new KVM-based implementation of the platform interface.

func (*KVM) CooperativelySchedulesAddressSpace

func (*KVM) CooperativelySchedulesAddressSpace() bool

CooperativelySchedulesAddressSpace implements platform.Platform.CooperativelySchedulesAddressSpace.

func (*KVM) MapUnit

func (*KVM) MapUnit() uint64

MapUnit implements platform.Platform.MapUnit.

func (*KVM) MaxUserAddress

func (*KVM) MaxUserAddress() hostarch.Addr

MaxUserAddress returns the first address that may not be used.

func (*KVM) MinUserAddress

func (*KVM) MinUserAddress() hostarch.Addr

MinUserAddress returns the lowest available address.

func (*KVM) NewAddressSpace

func (k *KVM) NewAddressSpace(any) (platform.AddressSpace, <-chan struct{}, error)

NewAddressSpace returns a new pagetable root.

func (*KVM) NewContext

func (k *KVM) NewContext(pkgcontext.Context) platform.Context

NewContext returns an interruptible context.

func (*KVM) SupportsAddressSpaceIO

func (*KVM) SupportsAddressSpaceIO() bool

SupportsAddressSpaceIO implements platform.Platform.SupportsAddressSpaceIO.

func (*KVM) SyscallFilters

func (k *KVM) SyscallFilters() seccomp.SyscallRules

SyscallFilters returns syscalls made exclusively by the KVM platform.

Directories

Path Synopsis
Package testutil provides common assembly stubs for testing.
Package testutil provides common assembly stubs for testing.

Jump to

Keyboard shortcuts

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