Documentation
¶
Index ¶
- func IsQcow2File(path string) bool
- type CloudImg
- func (c *CloudImg) Config(ctx context.Context, vms []*types.VMConfig) (result [][]*types.StorageConfig, boot []*types.BootConfig, err error)
- func (c *CloudImg) Delete(ctx context.Context, ids []string) ([]string, error)
- func (c *CloudImg) GCModule() gc.Module[images.ImageGCSnapshot]
- func (c *CloudImg) Import(ctx context.Context, name string, tracker progress.Tracker, file ...string) error
- func (c *CloudImg) ImportFromReader(ctx context.Context, name string, tracker progress.Tracker, r io.Reader) error
- func (c *CloudImg) Inspect(ctx context.Context, id string) (*types.Image, error)
- func (c *CloudImg) List(ctx context.Context) ([]*types.Image, error)
- func (c *CloudImg) Pull(ctx context.Context, url string, force bool, tracker progress.Tracker) error
- func (c *CloudImg) RegisterGC(orch *gc.Orchestrator)
- func (c *CloudImg) Type() string
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsQcow2File ¶
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 (*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) 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 ¶
Inspect returns the record for a single image. Returns (nil, nil) if not found.
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.
type Config ¶
type Config struct {
images.BaseConfig
}
Config holds cloud image backend specific configuration, embedding the shared BaseConfig.
func (*Config) EnsureDirs ¶
EnsureDirs creates all required directories for the cloudimg backend.
func (*Config) FirmwarePath ¶
FirmwarePath returns the path to the UEFI firmware blob (CLOUDHV.fd).