hostimage

package
v0.0.0-...-6410feb Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartService

func StartService()

Types

type IImage

type IImage interface {
	// Open image file and its backing file (if have)
	Open(imagePath string, readonly bool, encryptInfo *apis.SEncryptInfo) error

	// load opend qcow2 img form qemu blk cache
	Load(imagePath string, readonly, reference bool) error

	// Close may not really close image file handle, just reudce ref count
	Close()

	// If return number < 0 indicate read failed
	Read(offset, count int64) ([]byte, error)

	// Get image file length, not file actual length, it's image virtual size
	Length() int64
}

type QemuioBlkDev

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

func LoadQcow2

func LoadQcow2(imagePath string, readonly bool) *QemuioBlkDev

func OpenQcow2

func OpenQcow2(disk *qemuimg.SImageInfo, readonly bool) *QemuioBlkDev

func (*QemuioBlkDev) CloseQcow2

func (qb *QemuioBlkDev) CloseQcow2()

func (*QemuioBlkDev) Qcow2GetLength

func (qb *QemuioBlkDev) Qcow2GetLength() int64

func (*QemuioBlkDev) ReadQcow2

func (qb *QemuioBlkDev) ReadQcow2(offset int64, count int64) ([]byte, int64)

type SFile

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

func (*SFile) Close

func (f *SFile) Close()

func (*SFile) Length

func (f *SFile) Length() int64

func (*SFile) Load

func (f *SFile) Load(imagePath string, readonly, reference bool) error

func (*SFile) Open

func (f *SFile) Open(imagePath string, readonly bool, encryptInfo *apis.SEncryptInfo) error

func (*SFile) Read

func (f *SFile) Read(offset, count int64) ([]byte, error)

type SHostImageOptions

type SHostImageOptions struct {
	common_options.CommonOptions
	LocalImagePath    []string `help:"Local Image Paths"`
	LVMVolumeGroups   []string `help:"LVM Volume Groups(vgs)"`
	SnapshotDirSuffix string   `help:"Snapshot dir name equal diskId concat snapshot dir suffix" default:"_snap"`
	CommonConfigFile  string   `help:"common config file for container"`
	StreamChunkSize   int      `help:"Download stream chunk size KB" default:"4096"`
	Lz4ChecksumOff    bool     `help:"Turn off lz4 checksum option"`
}
var (
	HostImageOptions SHostImageOptions
)

type SQcow2Image

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

func (*SQcow2Image) Close

func (img *SQcow2Image) Close()

func (*SQcow2Image) Length

func (img *SQcow2Image) Length() int64

func (*SQcow2Image) Load

func (img *SQcow2Image) Load(imagePath string, readonly, reference bool) error

func (*SQcow2Image) Open

func (img *SQcow2Image) Open(imagePath string, readonly bool, encryptInfo *apis.SEncryptInfo) error

func (*SQcow2Image) Read

func (img *SQcow2Image) Read(offset, count int64) ([]byte, error)

Jump to

Keyboard shortcuts

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