qemu_kvm

package
v0.0.0-...-21b9e53 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 License: Apache-2.0 Imports: 26 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	QEMU_KVM_PATH = "/usr/libexec/qemu-kvm"

	OS_ARCH_AARCH64 = "aarch64"
	ARM_INITRD_PATH = "/yunionos/aarch64/initramfs"
	ARM_KERNEL_PATH = "/yunionos/aarch64/kernel"
	X86_INITRD_PATH = "/yunionos/x86_64/initramfs"
	X86_KERNEL_PATH = "/yunionos/x86_64/kernel"

	RUN_ON_HOST_ROOT_PATH = "/opt/cloud/host-deployer"

	DEPLOY_ISO = "/opt/cloud/host-deployer/host_deployer_v1.iso"
	// DEPLOYER_BIN    = "/opt/yunion/bin/host-deployer --common-config-file /opt/yunion/common.conf --config /opt/yunion/host.conf"
	DEPLOYER_BIN       = "/opt/yunion/bin/host-deployer --config /opt/yunion/host.conf"
	DEPLOY_PARAMS_FILE = "/deploy_params"
	YUNIONOS_PASSWD    = "mosbaremetal"
)
View Source
var BASE_SSH_PORT = 28000

Functions

func InitQemuDeployManager

func InitQemuDeployManager(
	cpuArch, qemuVersion string,
	enableRemoteExecutor, hugepage bool,
	hugepageSizeKB, memSizeMb, deployConcurrent int,
) error

Types

type IQemuArchDriver

type IQemuArchDriver interface {
	StartGuest(sshPort, ncpu, memSizeMB int, hugePage bool, pageSizeKB int, imageInfo qemuimg.SImageInfo, disksPath []string) error
	CleanGuest()
}

func NewCpuArchDriver

func NewCpuArchDriver(cpuArch string) IQemuArchDriver

type LocalDiskDriver

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

func NewLocalDiskDriver

func NewLocalDiskDriver() *LocalDiskDriver

func (*LocalDiskDriver) Connect

func (d *LocalDiskDriver) Connect(desc *apis.GuestDesc) error

func (*LocalDiskDriver) DeployGuestfs

func (d *LocalDiskDriver) DeployGuestfs(req *apis.DeployParams) (res *apis.DeployGuestFsResponse, err error)

func (*LocalDiskDriver) DetectIsUEFISupport

func (d *LocalDiskDriver) DetectIsUEFISupport(rootfs fsdriver.IRootFsDriver) bool

func (*LocalDiskDriver) Disconnect

func (d *LocalDiskDriver) Disconnect() error

func (*LocalDiskDriver) FormatFs

func (d *LocalDiskDriver) FormatFs(req *apis.FormatFsParams) (*apis.Empty, error)

func (*LocalDiskDriver) FormatPartition

func (d *LocalDiskDriver) FormatPartition(fs, uuid string, features *apis.FsFeatures) error

func (*LocalDiskDriver) GetPartitions

func (d *LocalDiskDriver) GetPartitions() []fsdriver.IDiskPartition

func (*LocalDiskDriver) IsLVMPartition

func (d *LocalDiskDriver) IsLVMPartition() bool

func (*LocalDiskDriver) MakePartition

func (d *LocalDiskDriver) MakePartition(fs string) error

func (*LocalDiskDriver) MountRootfs

func (d *LocalDiskDriver) MountRootfs(readonly bool) (fsdriver.IRootFsDriver, error)

func (*LocalDiskDriver) ProbeImageInfo

func (d *LocalDiskDriver) ProbeImageInfo(req *apis.ProbeImageInfoPramas) (*apis.ImageInfo, error)

func (*LocalDiskDriver) ResizeFs

func (d *LocalDiskDriver) ResizeFs() (*apis.Empty, error)

func (*LocalDiskDriver) ResizePartition

func (d *LocalDiskDriver) ResizePartition() error

func (*LocalDiskDriver) SaveToGlance

func (*LocalDiskDriver) UmountRootfs

func (d *LocalDiskDriver) UmountRootfs(fd fsdriver.IRootFsDriver) error

func (*LocalDiskDriver) Zerofree

func (d *LocalDiskDriver) Zerofree()

type LvNames

type LvNames struct {
	Report []struct {
		LV []struct {
			LVName string `json:"lv_name"`
			LVPath string `json:"lv_path"`
		} `json:"lv"`
	} `json:"report"`
}

type LvProps

type LvProps struct {
	LvName string
	LvPath string
}

type QemuARMDriver

type QemuARMDriver struct {
	QemuBaseDriver
}

func (*QemuARMDriver) StartGuest

func (d *QemuARMDriver) StartGuest(sshPort, ncpu, memSizeMB int, hugePage bool, pageSizeKB int, imageInfo qemuimg.SImageInfo, disksPath []string) error

type QemuBaseDriver

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

func (*QemuBaseDriver) CleanGuest

func (d *QemuBaseDriver) CleanGuest()

type QemuDeployManager

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

func (*QemuDeployManager) Acquire

func (m *QemuDeployManager) Acquire()

func (*QemuDeployManager) GetARMInitrdPath

func (m *QemuDeployManager) GetARMInitrdPath() string

func (*QemuDeployManager) GetARMKernelPath

func (m *QemuDeployManager) GetARMKernelPath() string

func (*QemuDeployManager) GetFreePortByBase

func (m *QemuDeployManager) GetFreePortByBase(basePort int) int

func (*QemuDeployManager) GetSshFreePort

func (m *QemuDeployManager) GetSshFreePort() int

func (*QemuDeployManager) GetX86InitrdPath

func (m *QemuDeployManager) GetX86InitrdPath() string

func (*QemuDeployManager) GetX86KernelPath

func (m *QemuDeployManager) GetX86KernelPath() string

func (*QemuDeployManager) Release

func (m *QemuDeployManager) Release()

type QemuKvmDriver

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

func NewQemuKvmDriver

func NewQemuKvmDriver(imageInfo qemuimg.SImageInfo) *QemuKvmDriver

func (*QemuKvmDriver) Connect

func (d *QemuKvmDriver) Connect(guestDesc *apis.GuestDesc) error

func (*QemuKvmDriver) DeployGuestfs

func (d *QemuKvmDriver) DeployGuestfs(req *apis.DeployParams) (*apis.DeployGuestFsResponse, error)

func (*QemuKvmDriver) DetectIsUEFISupport

func (d *QemuKvmDriver) DetectIsUEFISupport(rootfs fsdriver.IRootFsDriver) bool

func (*QemuKvmDriver) Disconnect

func (d *QemuKvmDriver) Disconnect() error

func (*QemuKvmDriver) FormatFs

func (d *QemuKvmDriver) FormatFs(req *apis.FormatFsParams) (*apis.Empty, error)

func (*QemuKvmDriver) FormatPartition

func (d *QemuKvmDriver) FormatPartition(fs, uuid string, features *apis.FsFeatures) error

func (*QemuKvmDriver) GetPartitions

func (d *QemuKvmDriver) GetPartitions() []fsdriver.IDiskPartition

func (*QemuKvmDriver) IsLVMPartition

func (d *QemuKvmDriver) IsLVMPartition() bool

func (*QemuKvmDriver) MakePartition

func (d *QemuKvmDriver) MakePartition(fs string) error

func (*QemuKvmDriver) MountRootfs

func (d *QemuKvmDriver) MountRootfs(readonly bool) (fsdriver.IRootFsDriver, error)

func (*QemuKvmDriver) ProbeImageInfo

func (d *QemuKvmDriver) ProbeImageInfo(req *apis.ProbeImageInfoPramas) (*apis.ImageInfo, error)

func (*QemuKvmDriver) ResizeFs

func (d *QemuKvmDriver) ResizeFs() (*apis.Empty, error)

func (*QemuKvmDriver) ResizePartition

func (d *QemuKvmDriver) ResizePartition() error

func (*QemuKvmDriver) SaveToGlance

func (*QemuKvmDriver) UmountRootfs

func (d *QemuKvmDriver) UmountRootfs(fd fsdriver.IRootFsDriver) error

func (*QemuKvmDriver) Zerofree

func (d *QemuKvmDriver) Zerofree()

type QemuX86Driver

type QemuX86Driver struct {
	QemuBaseDriver
}

func (*QemuX86Driver) StartGuest

func (d *QemuX86Driver) StartGuest(sshPort, ncpu, memSizeMB int, hugePage bool, pageSizeKB int, imageInfo qemuimg.SImageInfo, disksPath []string) error

type VgProps

type VgProps struct {
	VgName string
	VgUuid string
}

type VgReports

type VgReports struct {
	Report []struct {
		VG []struct {
			VgName string `json:"vg_name"`
			VgUuid string `json:"vg_uuid"`
		} `json:"vg"`
	} `json:"report"`
}

Jump to

Keyboard shortcuts

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