Documentation
¶
Overview ¶
Package vz implements the hypervisor.Hypervisor interface for Apple's Virtualization.framework on macOS via the vz-shim subprocess.
Index ¶
- func NewVsockDialer(vsockSocket string, vsockCID int64) hypervisor.VsockDialer
- type Client
- func (c *Client) Capabilities() hypervisor.Capabilities
- func (c *Client) DeleteVM(ctx context.Context) error
- func (c *Client) GetVMInfo(ctx context.Context) (*hypervisor.VMInfo, error)
- func (c *Client) Pause(ctx context.Context) error
- func (c *Client) ResizeMemory(ctx context.Context, bytes int64) error
- func (c *Client) ResizeMemoryAndWait(ctx context.Context, bytes int64, timeout time.Duration) error
- func (c *Client) Resume(ctx context.Context) error
- func (c *Client) Shutdown(ctx context.Context) error
- func (c *Client) Snapshot(ctx context.Context, destPath string) error
- type Starter
- func (s *Starter) GetBinaryPath(p *paths.Paths, version string) (string, error)
- func (s *Starter) GetVersion(p *paths.Paths) (string, error)
- func (s *Starter) RestoreVM(ctx context.Context, p *paths.Paths, version string, socketPath string, ...) (int, hypervisor.Hypervisor, error)
- func (s *Starter) SocketName() string
- func (s *Starter) StartVM(ctx context.Context, p *paths.Paths, version string, socketPath string, ...) (int, hypervisor.Hypervisor, error)
- type VsockDialer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewVsockDialer ¶
func NewVsockDialer(vsockSocket string, vsockCID int64) hypervisor.VsockDialer
NewVsockDialer creates a new VsockDialer for vz. vsockSocket is the path to the vz.vsock Unix socket proxy. vsockCID is unused because the vz proxy is per-VM (unlike QEMU which uses kernel AF_VSOCK with CID routing).
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements hypervisor.Hypervisor via HTTP to the vz-shim process.
func (*Client) Capabilities ¶
func (c *Client) Capabilities() hypervisor.Capabilities
func (*Client) ResizeMemoryAndWait ¶
type Starter ¶
type Starter struct{}
Starter implements hypervisor.VMStarter for Virtualization.framework.
func (*Starter) GetBinaryPath ¶
GetBinaryPath extracts the embedded vz-shim and returns its path.
func (*Starter) GetVersion ¶
GetVersion returns "vz-shim".
func (*Starter) RestoreVM ¶
func (s *Starter) RestoreVM(ctx context.Context, p *paths.Paths, version string, socketPath string, snapshotPath string) (int, hypervisor.Hypervisor, error)
RestoreVM is not supported by vz (Virtualization.framework cannot restore Linux guests).
func (*Starter) SocketName ¶
func (*Starter) StartVM ¶
func (s *Starter) StartVM(ctx context.Context, p *paths.Paths, version string, socketPath string, config hypervisor.VMConfig) (int, hypervisor.Hypervisor, error)
StartVM spawns a vz-shim subprocess to host the VM.
type VsockDialer ¶
type VsockDialer struct {
// contains filtered or unexported fields
}
VsockDialer implements hypervisor.VsockDialer for vz via the shim's Unix socket proxy. Uses the same protocol as Cloud Hypervisor: CONNECT {port}\n -> OK {port}\n
func (*VsockDialer) DialVsock ¶
DialVsock connects to the guest on the specified port via the shim's vsock proxy.
func (*VsockDialer) Key ¶
func (d *VsockDialer) Key() string
Key returns a unique identifier for this dialer, used for connection pooling.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package shimconfig defines the configuration types shared between the hypeman API server and the vz-shim subprocess.
|
Package shimconfig defines the configuration types shared between the hypeman API server and the vz-shim subprocess. |