cloudimg

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsQcow2File

func IsQcow2File(path string) bool

IsQcow2File checks whether path starts with the qcow2 magic bytes. Short or unreadable files return false.

Types

type CloudImg

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

CloudImg stores cloud image blobs for UEFI boot under Cloud Hypervisor.

func New

func New(ctx context.Context, conf *config.Config) (*CloudImg, error)

New creates a new cloud image backend.

func (*CloudImg) Config

func (c *CloudImg) Config(ctx context.Context, vms []*types.VMConfig) (result [][]*types.StorageConfig, boot []*types.BootConfig, err error)

Config resolves cloud images to qcow2 storage plus firmware boot config.

func (*CloudImg) Delete

func (c *CloudImg) Delete(ctx context.Context, ids []string) ([]string, error)

Delete removes images from the index.

func (*CloudImg) GCModule

func (c *CloudImg) GCModule() gc.Module[images.ImageGCSnapshot]

GCModule returns a typed gc.Module for the cloud image backend.

func (*CloudImg) Import

func (c *CloudImg) Import(ctx context.Context, name string, tracker progress.Tracker, file ...string) error

Import imports local qcow2 file(s) as a cloud image.

func (*CloudImg) ImportFromReader added in v0.2.7

func (c *CloudImg) ImportFromReader(ctx context.Context, name string, tracker progress.Tracker, r io.Reader) error

ImportFromReader imports a qcow2 image from a reader (stdin, gzip stream, etc.).

func (*CloudImg) Inspect

func (c *CloudImg) Inspect(ctx context.Context, id string) (*types.Image, error)

Inspect returns the record for a single image. Returns (nil, nil) if not found.

func (*CloudImg) List

func (c *CloudImg) List(ctx context.Context) ([]*types.Image, error)

List returns all locally stored cloud images.

func (*CloudImg) Pull

func (c *CloudImg) Pull(ctx context.Context, url string, force bool, tracker progress.Tracker) error

Pull downloads a cloud image and stores it in the blob cache.

func (*CloudImg) RegisterGC

func (c *CloudImg) RegisterGC(orch *gc.Orchestrator)

RegisterGC registers the cloud image GC module with the given Orchestrator.

func (*CloudImg) Type

func (c *CloudImg) Type() string

Type returns the image backend identifier.

type Config

type Config struct {
	images.BaseConfig
}

Config holds cloud image backend specific configuration, embedding the shared BaseConfig.

func NewConfig

func NewConfig(conf *config.Config) *Config

NewConfig creates a Config from a global config.

func (*Config) EnsureDirs

func (c *Config) EnsureDirs() error

EnsureDirs creates all required directories for the cloudimg backend.

func (*Config) FirmwarePath

func (c *Config) FirmwarePath() string

FirmwarePath returns the path to the UEFI firmware blob (CLOUDHV.fd).

Jump to

Keyboard shortcuts

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