Crate system_harness

Source
Expand description

A library for programmatically controlling systems such as emulators or virtual machines.

§QEMU

A QemuSystem that implements SystemHarness can be instantiated using a QemuSystemConfig that can be deserialized using serde.

The top-most mapping should align with the QEMU argument names with the sub-mappings aligning with the backends and/or properties of the arguments.

An example QEMU configuration:

{
	"arch": "i386",
	"memory": 512,
	"machine": {
		"type": "q35"
	},
	"device": [
		{
			"driver": "virtio-blk",
			"drive": "f1"
		}],
		"blockdev": [
			{
				"driver": "file",
				"node-name": "f1",
				"filename": "tests/data/test.raw"
			}
		]
}

§Containers

A ContainerSystem that implements SystemHarness can be instantiated using a ContainerSystemConfig that can be deserialized using serde.

An example of a container configuration:

{
  "tool": "podman",
  "image": "docker.io/busybox"
}

Structs§

ContainerSystem
ContainerSystemConfig
A container system config
ContainerSystemTerminal
Error
System harness error
Event
A machine event
QemuSystem
A running QEMU system
QemuSystemConfig
A configuration for running QEMU
QemuSystemTerminal

Enums§

ErrorKind
Type of error
EventKind
Type of event
Key
System keyboard key
Status
System status

Traits§

EventPublisher
An event publisher
EventSubscriber
A trait representing event listener
SystemConfig
A traint representing a system configuration
SystemHarness
A trait representing a harnessed system
SystemTerminal
A trait representing a harnessed system that should be treated as a terminal