guestman

package
v0.3.11-8 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: Apache-2.0 Imports: 79 Imported by: 7

Documentation

Index

Constants

View Source
const (
	VNC_PORT_BASE           = 5900
	GUEST_RUNNING           = compute.VM_RUNNING
	GUEST_BLOCK_STREAM      = compute.VM_BLOCK_STREAM
	GUEST_BLOCK_STREAM_FAIL = compute.VM_BLOCK_STREAM_FAIL
	GUEST_SUSPEND           = compute.VM_SUSPEND
	GUSET_STOPPED           = "stopped"
	GUEST_NOT_FOUND         = "notfound"
)
View Source
const (
	STATE_FILE_PREFIX             = "STATEFILE"
	MONITOR_PORT_BASE             = 55900
	QMP_MONITOR_PORT_BASE         = 56100
	LIVE_MIGRATE_PORT_BASE        = 4396
	BUILT_IN_NBD_SERVER_PORT_BASE = 7777
	MAX_TRY                       = 3
)
View Source
const (
	OS_NAME_LINUX   = qemu.OS_NAME_LINUX
	OS_NAME_WINDOWS = qemu.OS_NAME_WINDOWS
	OS_NAME_MACOS   = qemu.OS_NAME_MACOS
	OS_NAME_ANDROID = qemu.OS_NAME_ANDROID
	OS_NAME_VMWARE  = qemu.OS_NAME_VMWARE
	OS_NAME_CIRROS  = qemu.OS_NAME_CIRROS
	OS_NAME_OPENWRT = qemu.OS_NAME_OPENWRT

	MODE_READLINE = qemu.MODE_READLINE
	MODE_CONTROL  = qemu.MODE_CONTROL

	DISK_DRIVER_VIRTIO = qemu.DISK_DRIVER_VIRTIO
	DISK_DRIVER_SCSI   = qemu.DISK_DRIVER_SCSI
	DISK_DRIVER_PVSCSI = qemu.DISK_DRIVER_PVSCSI
	DISK_DRIVER_IDE    = qemu.DISK_DRIVER_IDE
	DISK_DRIVER_SATA   = qemu.DISK_DRIVER_SATA
)

Variables

View Source
var (
	LAST_USED_PORT            = 0
	LAST_USED_NBD_SERVER_PORT = 0
	LAST_USED_MIGRATE_PORT    = 0
	NbdWorker                 *appsrv.SWorkerManager
)

Functions

func GetMemorySnapshotPath

func GetMemorySnapshotPath(serverId, instanceSnapshotId string) string

func Init

func Init(host hostutils.IHost, serversPath string, workerCnt int) error

func IsMacInGuestConfig

func IsMacInGuestConfig(guestConfig *compute.SImportGuestDesc, mac string) bool

func Stop

func Stop()

func SyncGuestNicsTraffics

func SyncGuestNicsTraffics(guestNicsTraffics map[string]map[string]compute.SNicTrafficRecord)

Types

type CPUDie

type CPUDie struct {
	CpuFree           map[int]int
	LogicalProcessors cpuset.CPUSet
	VcpuCount         int
}

type CancelBlockReplication

type CancelBlockReplication struct {
	SCancelBlockJobs
}

func NewCancelBlockReplicationTask

func NewCancelBlockReplicationTask(ctx context.Context, guest *SKVMGuestInstance) *CancelBlockReplication

func (*CancelBlockReplication) Start

func (task *CancelBlockReplication) Start()

type CpuSetCounter

type CpuSetCounter struct {
	Nodes       []*NumaNode
	NumaEnabled bool
	Lock        sync.Mutex
}

func NewGuestCpuSetCounter

func NewGuestCpuSetCounter(info *hostapi.HostTopology, reservedCpus *cpuset.CPUSet, numaAllocate bool, hugepageSizeKB, cpuCmtbound int) (*CpuSetCounter, error)

func (*CpuSetCounter) AllocCpuset

func (pq *CpuSetCounter) AllocCpuset(vcpuCount int, memSizeKB int64, perferNumaNode int8) (map[int]SAllocNumaCpus, error)

func (*CpuSetCounter) AllocCpusetWithNodeCount

func (pq *CpuSetCounter) AllocCpusetWithNodeCount(vcpuCount int, memSizeKB int64, nodeCount int) (map[int]SAllocNumaCpus, error)

func (*CpuSetCounter) AllocNumaNodes

func (pq *CpuSetCounter) AllocNumaNodes(vcpuCount int, memSizeKB int64, perferNumaNode int8, res map[int]SAllocNumaCpus) error

func (*CpuSetCounter) IsNumaEnabled

func (pq *CpuSetCounter) IsNumaEnabled() bool

func (CpuSetCounter) Len

func (pq CpuSetCounter) Len() int

func (CpuSetCounter) Less

func (pq CpuSetCounter) Less(i, j int) bool

func (*CpuSetCounter) LoadCpus

func (pq *CpuSetCounter) LoadCpus(cpus []int, vcpuCpunt int)

func (*CpuSetCounter) LoadNumaCpus

func (pq *CpuSetCounter) LoadNumaCpus(memSizeMb int64, hostNode int, cpus []int, vcpuCount int)

func (*CpuSetCounter) Pop

func (pq *CpuSetCounter) Pop() interface{}

func (*CpuSetCounter) Push

func (pq *CpuSetCounter) Push(item interface{})

func (*CpuSetCounter) ReleaseCpus

func (pq *CpuSetCounter) ReleaseCpus(cpus []int, vcpuCount int)

func (*CpuSetCounter) ReleaseNumaCpus

func (pq *CpuSetCounter) ReleaseNumaCpus(memSizeMb int64, hostNode int, cpus []int, vcpuCount int)

func (CpuSetCounter) Swap

func (pq CpuSetCounter) Swap(i, j int)

type IGuestBlockProgressTask

type IGuestBlockProgressTask interface {
	OnGetBlockJobs(jobs []monitor.BlockJob)
	StreamingDiskCompletedCount() int
	StreamingDiskCount() int
}

type IGuestTasks

type IGuestTasks interface {
	Start(func(...error))
}

type NumaNode

type NumaNode struct {
	CpuDies           SorttedCPUDie
	LogicalProcessors cpuset.CPUSet
	VcpuCount         int
	CpuCount          int

	NodeId                int
	NumaHugeMemSizeKB     int64
	NumaHugeFreeMemSizeKB int64
}

func NewNumaNode

func NewNumaNode(nodeId int, numaAllocate bool, hugepageSizeKB int) (*NumaNode, error)

func (*NumaNode) AllocCpuset

func (n *NumaNode) AllocCpuset(vcpuCount int) []int

func (*NumaNode) AllocCpuset1

func (n *NumaNode) AllocCpuset1(vcpuCount int) []int

type SAllocNumaCpus

type SAllocNumaCpus struct {
	Cpuset    []int
	MemSizeKB int64

	Unregular bool
}

type SBaseParams

type SBaseParams struct {
	Sid  string
	Body jsonutils.JSONObject
}

type SCancelBlockJobs

type SCancelBlockJobs struct {
	*SKVMGuestInstance
	// contains filtered or unexported fields
}

func NewCancelBlockJobsTask

func NewCancelBlockJobsTask(ctx context.Context, guest *SKVMGuestInstance) *SCancelBlockJobs

func (*SCancelBlockJobs) Start

func (task *SCancelBlockJobs) Start()

func (*SCancelBlockJobs) StartCancelBlockJobs

func (task *SCancelBlockJobs) StartCancelBlockJobs(drivers []string)

type SCloudpodsAccessInfo

type SCloudpodsAccessInfo struct {
	HostIp        string
	OriginDisksId []string
}

type SDeleteDiskSnapshot

type SDeleteDiskSnapshot struct {
	Sid             string
	DeleteSnapshot  string
	Disk            storageman.IDisk
	ConvertSnapshot string
	BlockStream     bool
	EncryptInfo     apis.SEncryptInfo
}

type SDestPrepareMigrate

type SDestPrepareMigrate struct {
	Sid          string
	ServerUrl    string
	QemuVersion  string
	MigrateCerts map[string]string
	EnableTLS    bool
	SnapshotsUri string
	DisksUri     string
	// TargetStorageId string
	TargetStorageIds []string
	LiveMigrate      bool
	RebaseDisks      bool

	Desc               *desc.SGuestDesc
	SrcDesc            *desc.SGuestDesc
	DisksBackingFile   jsonutils.JSONObject
	DiskSnapsChain     jsonutils.JSONObject
	OutChainSnaps      jsonutils.JSONObject
	SysDiskHasTemplate bool

	MemorySnapshotsUri string
	SrcMemorySnapshots []string

	UserCred mcclient.TokenCredential
}

type SDiskBackup

type SDiskBackup struct {
	Sid        string
	SnapshotId string
	BackupId   string
	Disk       storageman.IDisk
}

type SDiskSnapshot

type SDiskSnapshot struct {
	UserCred   mcclient.TokenCredential
	Sid        string
	SnapshotId string
	Disk       storageman.IDisk
}

type SDriveBackupTask

type SDriveBackupTask struct {
	*SKVMGuestInstance
	// contains filtered or unexported fields
}

func NewDriveBackupTask

func NewDriveBackupTask(
	ctx context.Context, s *SKVMGuestInstance, nbdUri, syncMode string, onSucc func(),
) *SDriveBackupTask

func (*SDriveBackupTask) Start

func (s *SDriveBackupTask) Start()

type SDriveMirrorTask

type SDriveMirrorTask struct {
	*SKVMGuestInstance
	// contains filtered or unexported fields
}

func NewDriveMirrorTask

func NewDriveMirrorTask(
	ctx context.Context, s *SKVMGuestInstance, nbdUri, syncMode string,
	blockReplication bool, onSucc func(),
) *SDriveMirrorTask

func (*SDriveMirrorTask) Start

func (s *SDriveMirrorTask) Start()

type SDriverMirror

type SDriverMirror struct {
	Sid          string
	NbdServerUri string
	Desc         *desc.SGuestDesc
}

type SEsxiAccessInfo

type SEsxiAccessInfo struct {
	Datastore  vcenter.SVCenterAccessInfo
	HostIp     string
	GuestExtId string
}

type SGuestBlockIoThrottleTask

type SGuestBlockIoThrottleTask struct {
	*SKVMGuestInstance
	// contains filtered or unexported fields
}

func (*SGuestBlockIoThrottleTask) Start

func (task *SGuestBlockIoThrottleTask) Start()

type SGuestBlockProgressBaseTask

type SGuestBlockProgressBaseTask struct {
	*SKVMGuestInstance
	// contains filtered or unexported fields
}

type SGuestBlockReplicationTask

type SGuestBlockReplicationTask struct {
	*SKVMGuestInstance
	// contains filtered or unexported fields
}

func NewGuestBlockReplicationTask

func NewGuestBlockReplicationTask(
	ctx context.Context, s *SKVMGuestInstance,
	nbdHost, nbdPort, syncMode string, onSucc func(), onFail func(string),
) *SGuestBlockReplicationTask

func (*SGuestBlockReplicationTask) Start

func (s *SGuestBlockReplicationTask) Start()

type SGuestCreateFromCloudpods

type SGuestCreateFromCloudpods struct {
	Sid                 string
	GuestDesc           *desc.SGuestDesc
	CloudpodsAccessInfo SCloudpodsAccessInfo
}

type SGuestCreateFromEsxi

type SGuestCreateFromEsxi struct {
	Sid            string
	GuestDesc      *desc.SGuestDesc
	EsxiAccessInfo SEsxiAccessInfo
}

type SGuestCreateFromLibvirt

type SGuestCreateFromLibvirt struct {
	Sid         string
	MonitorPath string
	GuestDesc   *desc.SGuestDesc
	DisksPath   *jsonutils.JSONDict
}

type SGuestDeploy

type SGuestDeploy struct {
	UserCred mcclient.TokenCredential

	Sid    string
	Body   jsonutils.JSONObject
	IsInit bool
}

type SGuestDiskSnapshotTask

type SGuestDiskSnapshotTask struct {
	*SGuestReloadDiskTask
	// contains filtered or unexported fields
}

func NewGuestDiskSnapshotTask

func NewGuestDiskSnapshotTask(
	ctx context.Context, s *SKVMGuestInstance, disk storageman.IDisk, snapshotId string,
) *SGuestDiskSnapshotTask

func (*SGuestDiskSnapshotTask) Start

func (s *SGuestDiskSnapshotTask) Start()

type SGuestDiskSyncTask

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

func NewGuestDiskSyncTask

func NewGuestDiskSyncTask(guest *SKVMGuestInstance, delDisks, addDisks []*desc.SGuestDisk, cdroms []*desc.SGuestCdrom, floppys []*desc.SGuestFloppy) *SGuestDiskSyncTask

func (*SGuestDiskSyncTask) OnChangeCdromContentSucc

func (d *SGuestDiskSyncTask) OnChangeCdromContentSucc(cdrom *desc.SGuestCdrom)

func (*SGuestDiskSyncTask) OnChangeFloppyContentSucc

func (d *SGuestDiskSyncTask) OnChangeFloppyContentSucc(floppy *desc.SGuestFloppy)

func (*SGuestDiskSyncTask) OnEjectCdromContentSucc

func (d *SGuestDiskSyncTask) OnEjectCdromContentSucc(cdName string)

func (*SGuestDiskSyncTask) OnEjectFloppyContentSucc

func (d *SGuestDiskSyncTask) OnEjectFloppyContentSucc(flName string)

func (*SGuestDiskSyncTask) Start

func (d *SGuestDiskSyncTask) Start(callback func(...error))

type SGuestHotplugCpuMem

type SGuestHotplugCpuMem struct {
	Sid         string
	AddCpuCount int64
	AddMemSize  int64

	CpuNumaPin []*desc.SCpuNumaPin
}

type SGuestHotplugCpuMemTask

type SGuestHotplugCpuMemTask struct {
	*SKVMGuestInstance
	// contains filtered or unexported fields
}

func NewGuestHotplugCpuMemTask

func NewGuestHotplugCpuMemTask(
	ctx context.Context, s *SKVMGuestInstance, addCpuCount, addMemSize int, cpuNumaPin []*desc.SCpuNumaPin,
) *SGuestHotplugCpuMemTask

func (*SGuestHotplugCpuMemTask) Start

func (task *SGuestHotplugCpuMemTask) Start()

First at all add cpu count, second add mem size

type SGuestIoThrottle

type SGuestIoThrottle struct {
	Sid   string
	Input *compute.ServerSetDiskIoThrottleInput
}

type SGuestIsolatedDeviceSyncTask

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

func NewGuestIsolatedDeviceSyncTask

func NewGuestIsolatedDeviceSyncTask(guest *SKVMGuestInstance, delDevs, addDevs []*desc.SGuestIsolatedDevice) *SGuestIsolatedDeviceSyncTask

func (*SGuestIsolatedDeviceSyncTask) Start

func (t *SGuestIsolatedDeviceSyncTask) Start(cb func(...error))

type SGuestLiveChangeDisk

type SGuestLiveChangeDisk struct {
	*SKVMGuestInstance
	// contains filtered or unexported fields
}

func NewGuestLiveChangeDiskTask

func NewGuestLiveChangeDiskTask(ctx context.Context, guest *SKVMGuestInstance, params *SStorageCloneDisk) (*SGuestLiveChangeDisk, error)

func (*SGuestLiveChangeDisk) Start

func (t *SGuestLiveChangeDisk) Start()

type SGuestLiveMigrateTask

type SGuestLiveMigrateTask struct {
	*SKVMGuestInstance
	// contains filtered or unexported fields
}

func NewGuestLiveMigrateTask

func NewGuestLiveMigrateTask(
	ctx context.Context, guest *SKVMGuestInstance, params *SLiveMigrate,
) *SGuestLiveMigrateTask

func (*SGuestLiveMigrateTask) SetLiveMigrateCancelled

func (s *SGuestLiveMigrateTask) SetLiveMigrateCancelled()

func (*SGuestLiveMigrateTask) Start

func (s *SGuestLiveMigrateTask) Start()

type SGuestManager

type SGuestManager struct {
	ServersPath      string
	Servers          *sync.Map
	CandidateServers map[string]*SKVMGuestInstance
	UnknownServers   *sync.Map
	ServersLock      *sync.Mutex

	// guests nics traffics lock
	TrafficLock *sync.Mutex

	GuestStartWorker *appsrv.SWorkerManager
	// contains filtered or unexported fields
}

func GetGuestManager

func GetGuestManager() *SGuestManager

func NewGuestManager

func NewGuestManager(host hostutils.IHost, serversPath string, workerCnt int) (*SGuestManager, error)

func (*SGuestManager) Bootstrap

func (m *SGuestManager) Bootstrap() (chan struct{}, error)

func (*SGuestManager) CPUSet

func (*SGuestManager) CPUSetRemove

func (m *SGuestManager) CPUSetRemove(ctx context.Context, sid string) error

func (*SGuestManager) CanMigrate

func (m *SGuestManager) CanMigrate(sid string) bool

func (*SGuestManager) CancelBlockJobs

func (m *SGuestManager) CancelBlockJobs(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SGuestManager) CancelBlockReplication

func (m *SGuestManager) CancelBlockReplication(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SGuestManager) CleanServer

func (m *SGuestManager) CleanServer(sid string)

func (*SGuestManager) ClenaupCpuset

func (m *SGuestManager) ClenaupCpuset()

func (*SGuestManager) CloseForward

func (*SGuestManager) CpusetBalance

func (m *SGuestManager) CpusetBalance(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

delay cpuset balance

func (*SGuestManager) Delete

func (m *SGuestManager) Delete(sid string) (*SKVMGuestInstance, error)

func (*SGuestManager) DeleteSnapshot

func (m *SGuestManager) DeleteSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SGuestManager) DestPrepareMigrate

func (m *SGuestManager) DestPrepareMigrate(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SGuestManager) DoDeleteMemorySnapshot

func (m *SGuestManager) DoDeleteMemorySnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SGuestManager) DoMemorySnapshot

func (m *SGuestManager) DoMemorySnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SGuestManager) DoResetMemorySnapshot

func (m *SGuestManager) DoResetMemorySnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SGuestManager) DoSnapshot

func (m *SGuestManager) DoSnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SGuestManager) ExitGuestCleanup

func (m *SGuestManager) ExitGuestCleanup()

func (*SGuestManager) GenerateDescFromXml

func (m *SGuestManager) GenerateDescFromXml(libvirtConfig *compute.SLibvirtHostConfig) (jsonutils.JSONObject, error)

func (*SGuestManager) GetFreePortByBase

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

func (*SGuestManager) GetFreeVncPort

func (m *SGuestManager) GetFreeVncPort() int

func (*SGuestManager) GetGuestNicDesc

func (m *SGuestManager) GetGuestNicDesc(
	mac, ip, port, bridge string, isCandidate bool,
) (*desc.SGuestDesc, *desc.SGuestNetwork)

func (*SGuestManager) GetGuestTrafficRecord

func (m *SGuestManager) GetGuestTrafficRecord(sid string) (map[string]compute.SNicTrafficRecord, error)

func (*SGuestManager) GetHost

func (m *SGuestManager) GetHost() hostutils.IHost

func (*SGuestManager) GetLiveMigrateFreePort

func (m *SGuestManager) GetLiveMigrateFreePort() int

func (*SGuestManager) GetNBDServerFreePort

func (m *SGuestManager) GetNBDServerFreePort() int

func (*SGuestManager) GetQgaRunningGuests

func (m *SGuestManager) GetQgaRunningGuests() []string

func (*SGuestManager) GetServer

func (m *SGuestManager) GetServer(sid string) (*SKVMGuestInstance, bool)

func (*SGuestManager) GetUnknownServer

func (m *SGuestManager) GetUnknownServer(sid string) (*SKVMGuestInstance, bool)

func (*SGuestManager) GuestCreate

func (m *SGuestManager) GuestCreate(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SGuestManager) GuestCreateFromCloudpods

func (m *SGuestManager) GuestCreateFromCloudpods(
	ctx context.Context, params interface{},
) (jsonutils.JSONObject, error)

func (*SGuestManager) GuestCreateFromEsxi

func (m *SGuestManager) GuestCreateFromEsxi(
	ctx context.Context, params interface{},
) (jsonutils.JSONObject, error)

func (*SGuestManager) GuestCreateFromLibvirt

func (m *SGuestManager) GuestCreateFromLibvirt(
	ctx context.Context, params interface{},
) (jsonutils.JSONObject, error)

func (*SGuestManager) GuestDeploy

func (m *SGuestManager) GuestDeploy(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

Delay process

func (*SGuestManager) GuestIoThrottle

func (m *SGuestManager) GuestIoThrottle(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SGuestManager) GuestStart

func (*SGuestManager) GuestStartRescue

func (m *SGuestManager) GuestStartRescue(ctx context.Context, userCred mcclient.TokenCredential, sid string, body jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SGuestManager) GuestStop

func (m *SGuestManager) GuestStop(ctx context.Context, sid string, timeout int64) error

func (*SGuestManager) GuestSuspend

func (m *SGuestManager) GuestSuspend(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SGuestManager) GuestSync

func (m *SGuestManager) GuestSync(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SGuestManager) HotplugCpuMem

func (m *SGuestManager) HotplugCpuMem(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SGuestManager) InitPythonPath

func (m *SGuestManager) InitPythonPath() error

func (*SGuestManager) InitQemuMaxCpus

func (m *SGuestManager) InitQemuMaxCpus(machineCaps []monitor.MachineInfo, kvmMaxCpus uint)

func (*SGuestManager) InitQemuMaxMems

func (m *SGuestManager) InitQemuMaxMems(maxMems uint)

func (*SGuestManager) IsGuestDir

func (m *SGuestManager) IsGuestDir(f os.FileInfo) bool

func (*SGuestManager) IsGuestExist

func (m *SGuestManager) IsGuestExist(sid string) bool

func (*SGuestManager) LibvirtDomainDiskToDiskConfig

func (m *SGuestManager) LibvirtDomainDiskToDiskConfig(
	domainDisks []libvirtxml.DomainDisk) ([]compute.SImportDisk, error)

func (*SGuestManager) LibvirtDomainInterfaceToNicConfig

func (m *SGuestManager) LibvirtDomainInterfaceToNicConfig(
	domainInterfaces []libvirtxml.DomainInterface) ([]compute.SImportNic, error)

func (*SGuestManager) LibvirtDomainToGuestDesc

func (m *SGuestManager) LibvirtDomainToGuestDesc(domain *libvirtxml.Domain) (*compute.SImportGuestDesc, error)

Read key infomation from domain xml

func (*SGuestManager) ListForward

func (*SGuestManager) LiveChangeDisk

func (m *SGuestManager) LiveChangeDisk(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SGuestManager) LiveMigrate

func (m *SGuestManager) LiveMigrate(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SGuestManager) LoadExistingGuests

func (m *SGuestManager) LoadExistingGuests()

func (*SGuestManager) LoadServer

func (m *SGuestManager) LoadServer(sid string)

func (*SGuestManager) Monitor

func (m *SGuestManager) Monitor(sid, cmd string, qmp bool, callback func(string)) error

func (*SGuestManager) OnLoadExistingGuestsComplete

func (m *SGuestManager) OnLoadExistingGuestsComplete()

func (*SGuestManager) OnVerifyExistingGuestsFail

func (m *SGuestManager) OnVerifyExistingGuestsFail(err error, pendingDelete bool)

func (*SGuestManager) OnVerifyExistingGuestsSucc

func (m *SGuestManager) OnVerifyExistingGuestsSucc(servers []jsonutils.JSONObject, pendingDelete bool)

func (*SGuestManager) OnlineResizeDisk

func (m *SGuestManager) OnlineResizeDisk(ctx context.Context, sid string, disk storageman.IDisk, sizeMb int64) (jsonutils.JSONObject, error)

func (*SGuestManager) OpenForward

func (*SGuestManager) PrepareCreate

func (m *SGuestManager) PrepareCreate(sid string) error

func (*SGuestManager) PrepareDeploy

func (m *SGuestManager) PrepareDeploy(sid string) error

func (*SGuestManager) PrepareImportFromLibvirt

func (m *SGuestManager) PrepareImportFromLibvirt(
	ctx context.Context, params interface{},
) (jsonutils.JSONObject, error)

func (*SGuestManager) QemuLogDir

func (m *SGuestManager) QemuLogDir() string

func (*SGuestManager) QgaCommand

func (m *SGuestManager) QgaCommand(cmd *monitor.Command, sid string, execTimeout int) (string, error)

func (*SGuestManager) QgaGetNetwork

func (m *SGuestManager) QgaGetNetwork(sid string) (string, error)

func (*SGuestManager) QgaGetOsInfo

func (m *SGuestManager) QgaGetOsInfo(sid string) (jsonutils.JSONObject, error)

func (*SGuestManager) QgaGuestInfoTask

func (m *SGuestManager) QgaGuestInfoTask(sid string) (string, error)

func (*SGuestManager) QgaGuestPing

func (m *SGuestManager) QgaGuestPing(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SGuestManager) QgaGuestSetPassword

func (m *SGuestManager) QgaGuestSetPassword(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SGuestManager) QgaSetNetwork

func (m *SGuestManager) QgaSetNetwork(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SGuestManager) ReloadDiskSnapshot

func (m *SGuestManager) ReloadDiskSnapshot(
	ctx context.Context, params interface{},
) (jsonutils.JSONObject, error)

func (*SGuestManager) RemoveCandidateServer

func (m *SGuestManager) RemoveCandidateServer(server *SKVMGuestInstance)

func (*SGuestManager) RequestVerifyDirtyServer

func (m *SGuestManager) RequestVerifyDirtyServer(s *SKVMGuestInstance)

func (*SGuestManager) ResetGuestNicTrafficLimit

func (m *SGuestManager) ResetGuestNicTrafficLimit(guestId string, input []compute.ServerNicTrafficLimit) error

func (*SGuestManager) Resume

func (m *SGuestManager) Resume(ctx context.Context, sid string, isLiveMigrate bool, cleanTLS bool) (jsonutils.JSONObject, error)

func (*SGuestManager) SaveGuestTrafficRecord

func (m *SGuestManager) SaveGuestTrafficRecord(sid string, record map[string]compute.SNicTrafficRecord) error

func (*SGuestManager) SaveServer

func (m *SGuestManager) SaveServer(sid string, s *SKVMGuestInstance)

func (*SGuestManager) SetGuestNicTrafficLimit

func (m *SGuestManager) SetGuestNicTrafficLimit(guestId string, input []compute.ServerNicTrafficLimit) error

func (*SGuestManager) ShutdownServers

func (m *SGuestManager) ShutdownServers()

func (*SGuestManager) SrcPrepareMigrate

func (m *SGuestManager) SrcPrepareMigrate(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SGuestManager) StartBlockReplication

func (m *SGuestManager) StartBlockReplication(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SGuestManager) StartCpusetBalancer

func (m *SGuestManager) StartCpusetBalancer()

func (*SGuestManager) Status

func (m *SGuestManager) Status(sid string) string

func (*SGuestManager) StatusWithBlockJobsCount

func (m *SGuestManager) StatusWithBlockJobsCount(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SGuestManager) StorageCloneDisk

func (m *SGuestManager) StorageCloneDisk(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SGuestManager) VerifyExistingGuests

func (m *SGuestManager) VerifyExistingGuests(pendingDelete bool)

type SGuestNetworkSyncTask

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

func NewGuestNetworkSyncTask

func NewGuestNetworkSyncTask(
	guest *SKVMGuestInstance, delNics, addNics []*desc.SGuestNetwork,
) *SGuestNetworkSyncTask

func (*SGuestNetworkSyncTask) Start

func (n *SGuestNetworkSyncTask) Start(callback func(...error))

type SGuestOnlineResizeDiskTask

type SGuestOnlineResizeDiskTask struct {
	*SKVMGuestInstance
	// contains filtered or unexported fields
}

func NewGuestOnlineResizeDiskTask

func NewGuestOnlineResizeDiskTask(
	ctx context.Context, s *SKVMGuestInstance, disk storageman.IDisk, sizeMB int64,
) *SGuestOnlineResizeDiskTask

func (*SGuestOnlineResizeDiskTask) OnGetBlocksSucc

func (task *SGuestOnlineResizeDiskTask) OnGetBlocksSucc(blocks []monitor.QemuBlock)

func (*SGuestOnlineResizeDiskTask) OnResizeSucc

func (task *SGuestOnlineResizeDiskTask) OnResizeSucc(err string)

func (*SGuestOnlineResizeDiskTask) Start

func (task *SGuestOnlineResizeDiskTask) Start()

type SGuestReloadDiskTask

type SGuestReloadDiskTask struct {
	*SKVMGuestInstance
	// contains filtered or unexported fields
}

func NewGuestReloadDiskTask

func NewGuestReloadDiskTask(
	ctx context.Context, s *SKVMGuestInstance, disk storageman.IDisk,
) *SGuestReloadDiskTask

func (*SGuestReloadDiskTask) Start

func (s *SGuestReloadDiskTask) Start()

func (*SGuestReloadDiskTask) WaitSnapshotReplaced

func (s *SGuestReloadDiskTask) WaitSnapshotReplaced(callback func()) error

type SGuestResumeTask

type SGuestResumeTask struct {
	*SKVMGuestInstance
	// contains filtered or unexported fields
}

func NewGuestResumeTask

func NewGuestResumeTask(ctx context.Context, s *SKVMGuestInstance, isTimeout bool, cleanTLS bool) *SGuestResumeTask

func (*SGuestResumeTask) GetStateFilePath

func (s *SGuestResumeTask) GetStateFilePath() string

func (*SGuestResumeTask) SetGetTaskData

func (s *SGuestResumeTask) SetGetTaskData(f func() (jsonutils.JSONObject, error))

func (*SGuestResumeTask) Start

func (s *SGuestResumeTask) Start()

func (*SGuestResumeTask) Stop

func (s *SGuestResumeTask) Stop()

type SGuestSnapshotDeleteTask

type SGuestSnapshotDeleteTask struct {
	*SGuestReloadDiskTask
	// contains filtered or unexported fields
}

func NewGuestSnapshotDeleteTask

func NewGuestSnapshotDeleteTask(
	ctx context.Context, s *SKVMGuestInstance, disk storageman.IDisk,
	deleteSnapshot, convertSnapshot string, blockStream bool, encryptInfo apis.SEncryptInfo,
) *SGuestSnapshotDeleteTask

func (*SGuestSnapshotDeleteTask) Start

func (s *SGuestSnapshotDeleteTask) Start()

type SGuestStopTask

type SGuestStopTask struct {
	*SKVMGuestInstance
	// contains filtered or unexported fields
}

func NewGuestStopTask

func NewGuestStopTask(guest *SKVMGuestInstance, ctx context.Context, timeout int64) *SGuestStopTask

func (*SGuestStopTask) CheckGuestRunningLater

func (s *SGuestStopTask) CheckGuestRunningLater()

func (*SGuestStopTask) Start

func (s *SGuestStopTask) Start()

type SGuestStorageCloneDiskTask

type SGuestStorageCloneDiskTask struct {
	*SGuestBlockProgressBaseTask
	// contains filtered or unexported fields
}

func NewGuestStorageCloneDiskTask

func NewGuestStorageCloneDiskTask(ctx context.Context, guest *SKVMGuestInstance, params *SStorageCloneDisk) *SGuestStorageCloneDiskTask

func (*SGuestStorageCloneDiskTask) OnGetBlockJobs

func (t *SGuestStorageCloneDiskTask) OnGetBlockJobs(jobs []monitor.BlockJob)

func (*SGuestStorageCloneDiskTask) Start

func (t *SGuestStorageCloneDiskTask) Start(guestRunning bool)

func (*SGuestStorageCloneDiskTask) StreamingDiskCompletedCount

func (t *SGuestStorageCloneDiskTask) StreamingDiskCompletedCount() int

func (*SGuestStorageCloneDiskTask) StreamingDiskCount

func (t *SGuestStorageCloneDiskTask) StreamingDiskCount() int

type SGuestStreamDisksTask

type SGuestStreamDisksTask struct {
	*SGuestBlockProgressBaseTask
	// contains filtered or unexported fields
}

func NewGuestStreamDisksTask

func NewGuestStreamDisksTask(ctx context.Context, guest *SKVMGuestInstance, callback func(), disksIdx []int) *SGuestStreamDisksTask

func (*SGuestStreamDisksTask) OnGetBlockJobs

func (s *SGuestStreamDisksTask) OnGetBlockJobs(jobs []monitor.BlockJob)

func (*SGuestStreamDisksTask) Start

func (s *SGuestStreamDisksTask) Start()

func (*SGuestStreamDisksTask) StreamingDiskCompletedCount

func (s *SGuestStreamDisksTask) StreamingDiskCompletedCount() int

func (*SGuestStreamDisksTask) StreamingDiskCount

func (s *SGuestStreamDisksTask) StreamingDiskCount() int

type SGuestSuspendTask

type SGuestSuspendTask struct {
	*SKVMGuestInstance
	// contains filtered or unexported fields
}

func NewGuestSuspendTask

func NewGuestSuspendTask(
	guest *SKVMGuestInstance,
	ctx context.Context,
	onFinishCallback func(*SGuestSuspendTask, string),
) *SGuestSuspendTask

func (*SGuestSuspendTask) GetStateFilePath

func (s *SGuestSuspendTask) GetStateFilePath() string

func (*SGuestSuspendTask) Start

func (s *SGuestSuspendTask) Start()

type SGuestSyncConfigTaskExecutor

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

func NewGuestSyncConfigTaskExecutor

func NewGuestSyncConfigTaskExecutor(ctx context.Context, guest *SKVMGuestInstance, tasks []IGuestTasks, callback func([]error)) *SGuestSyncConfigTaskExecutor

func (*SGuestSyncConfigTaskExecutor) Start

func (t *SGuestSyncConfigTaskExecutor) Start(delay int)

type SKVMGuestInstance

type SKVMGuestInstance struct {
	SKVMInstanceRuntime

	Id      string
	Monitor monitor.Monitor

	// runtime description, generate from source desc
	Desc *desc.SGuestDesc
	// source description, input from region
	SourceDesc *desc.SGuestDesc
	// contains filtered or unexported fields
}

func NewKVMGuestInstance

func NewKVMGuestInstance(id string, manager *SGuestManager) *SKVMGuestInstance

func (*SKVMGuestInstance) BlockIoThrottle

func (s *SKVMGuestInstance) BlockIoThrottle(ctx context.Context)

func (*SKVMGuestInstance) BlockJobsCount

func (s *SKVMGuestInstance) BlockJobsCount() int

func (*SKVMGuestInstance) CPUSet

func (s *SKVMGuestInstance) CPUSet(ctx context.Context, input []int) (*api.ServerCPUSetResp, error)

func (*SKVMGuestInstance) CPUSetRemove

func (s *SKVMGuestInstance) CPUSetRemove(ctx context.Context) error

func (*SKVMGuestInstance) CheckBlockOrRunning

func (s *SKVMGuestInstance) CheckBlockOrRunning(jobs int)

func (*SKVMGuestInstance) CleanGuest

func (s *SKVMGuestInstance) CleanGuest(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

Delay process

func (*SKVMGuestInstance) CleanImportMetadata

func (s *SKVMGuestInstance) CleanImportMetadata() *jsonutils.JSONDict

func (*SKVMGuestInstance) CleanStartupTask

func (s *SKVMGuestInstance) CleanStartupTask()

func (*SKVMGuestInstance) CleanStatefiles

func (s *SKVMGuestInstance) CleanStatefiles()

func (*SKVMGuestInstance) CleanupCpuset

func (s *SKVMGuestInstance) CleanupCpuset()

func (*SKVMGuestInstance) CpuMax

func (s *SKVMGuestInstance) CpuMax() (uint, error)

func (*SKVMGuestInstance) CreateFromDesc

func (s *SKVMGuestInstance) CreateFromDesc(desc *desc.SGuestDesc) error

func (*SKVMGuestInstance) Delete

func (s *SKVMGuestInstance) Delete(ctx context.Context, migrated, recycle bool) error

func (*SKVMGuestInstance) DeployFs

func (*SKVMGuestInstance) DirtyServerRequestStart

func (s *SKVMGuestInstance) DirtyServerRequestStart()

func (*SKVMGuestInstance) DiskCount

func (s *SKVMGuestInstance) DiskCount() int

func (*SKVMGuestInstance) DoResumeTask

func (s *SKVMGuestInstance) DoResumeTask(ctx context.Context, isTimeout bool, cleanTls bool)

func (*SKVMGuestInstance) ExecDeleteSnapshotTask

func (s *SKVMGuestInstance) ExecDeleteSnapshotTask(
	ctx context.Context, disk storageman.IDisk,
	deleteSnapshot string, convertSnapshot string, blockStream bool, encryptInfo apis.SEncryptInfo,
) (jsonutils.JSONObject, error)

func (*SKVMGuestInstance) ExecDiskSnapshotTask

func (s *SKVMGuestInstance) ExecDiskSnapshotTask(
	ctx context.Context, userCred mcclient.TokenCredential, disk storageman.IDisk, snapshotId string,
) (jsonutils.JSONObject, error)

func (*SKVMGuestInstance) ExecMemorySnapshotResetTask

func (s *SKVMGuestInstance) ExecMemorySnapshotResetTask(ctx context.Context, input *hostapi.GuestMemorySnapshotResetRequest) (jsonutils.JSONObject, error)

func (*SKVMGuestInstance) ExecMemorySnapshotTask

func (*SKVMGuestInstance) ExecReloadDiskTask

func (s *SKVMGuestInstance) ExecReloadDiskTask(ctx context.Context, disk storageman.IDisk) (jsonutils.JSONObject, error)

func (*SKVMGuestInstance) ExecStopTask

func (s *SKVMGuestInstance) ExecStopTask(ctx context.Context, params interface{}) (jsonutils.JSONObject, error)

func (*SKVMGuestInstance) ExecSuspendTask

func (s *SKVMGuestInstance) ExecSuspendTask(ctx context.Context)

func (*SKVMGuestInstance) ExitCleanup

func (s *SKVMGuestInstance) ExitCleanup(clear bool)

func (*SKVMGuestInstance) ForceStop

func (s *SKVMGuestInstance) ForceStop() bool

func (*SKVMGuestInstance) GetCgroupName

func (s *SKVMGuestInstance) GetCgroupName() string

func (*SKVMGuestInstance) GetCleanFiles

func (s *SKVMGuestInstance) GetCleanFiles() []string

func (*SKVMGuestInstance) GetDescFilePath

func (s *SKVMGuestInstance) GetDescFilePath() string

func (*SKVMGuestInstance) GetFuseTmpPath

func (s *SKVMGuestInstance) GetFuseTmpPath() string

func (*SKVMGuestInstance) GetHmpMonitorPort

func (s *SKVMGuestInstance) GetHmpMonitorPort(vncPort int) int

func (*SKVMGuestInstance) GetId

func (s *SKVMGuestInstance) GetId() string

func (*SKVMGuestInstance) GetKernelVersion

func (s *SKVMGuestInstance) GetKernelVersion() string

func (*SKVMGuestInstance) GetMonitorPath

func (s *SKVMGuestInstance) GetMonitorPath() string

func (*SKVMGuestInstance) GetName

func (s *SKVMGuestInstance) GetName() string

func (*SKVMGuestInstance) GetNeedMergeBackingFileDiskIndexs

func (s *SKVMGuestInstance) GetNeedMergeBackingFileDiskIndexs() []int

func (*SKVMGuestInstance) GetNicDescMatch

func (s *SKVMGuestInstance) GetNicDescMatch(mac, ip, port, bridge string) *desc.SGuestNetwork

func (*SKVMGuestInstance) GetOsName

func (s *SKVMGuestInstance) GetOsName() string

func (*SKVMGuestInstance) GetPciBus

func (s *SKVMGuestInstance) GetPciBus() string

func (*SKVMGuestInstance) GetPid

func (s *SKVMGuestInstance) GetPid() int

func (*SKVMGuestInstance) GetPidFilePath

func (s *SKVMGuestInstance) GetPidFilePath() string

func (*SKVMGuestInstance) GetPowerStates

func (s *SKVMGuestInstance) GetPowerStates() string

func (*SKVMGuestInstance) GetQemuVersionStr

func (s *SKVMGuestInstance) GetQemuVersionStr() string

func (*SKVMGuestInstance) GetQmpMonitorPort

func (s *SKVMGuestInstance) GetQmpMonitorPort(vncPort int) int

func (*SKVMGuestInstance) GetRescueDirPath

func (s *SKVMGuestInstance) GetRescueDirPath() string

func (*SKVMGuestInstance) GetSourceDescFilePath

func (s *SKVMGuestInstance) GetSourceDescFilePath() string

func (*SKVMGuestInstance) GetSriovDeviceByNetworkIndex

func (s *SKVMGuestInstance) GetSriovDeviceByNetworkIndex(networkIndex int) (isolated_device.IDevice, error)

func (*SKVMGuestInstance) GetStartScriptPath

func (s *SKVMGuestInstance) GetStartScriptPath() string

func (*SKVMGuestInstance) GetStateFilePath

func (s *SKVMGuestInstance) GetStateFilePath(version string) string

func (*SKVMGuestInstance) GetStopScriptPath

func (s *SKVMGuestInstance) GetStopScriptPath() string

func (*SKVMGuestInstance) GetVdiProtocol

func (s *SKVMGuestInstance) GetVdiProtocol() string

func (*SKVMGuestInstance) GetVncFilePath

func (s *SKVMGuestInstance) GetVncFilePath() string

func (*SKVMGuestInstance) GetVncPort

func (s *SKVMGuestInstance) GetVncPort() int

func (*SKVMGuestInstance) GetVpcNIC

func (s *SKVMGuestInstance) GetVpcNIC() *desc.SGuestNetwork

func (*SKVMGuestInstance) GuestPrelaunchSetCgroup

func (s *SKVMGuestInstance) GuestPrelaunchSetCgroup()

func (*SKVMGuestInstance) HideHypervisor

func (s *SKVMGuestInstance) HideHypervisor() bool

func (*SKVMGuestInstance) HideKVM

func (s *SKVMGuestInstance) HideKVM() bool

func (*SKVMGuestInstance) HomeDir

func (s *SKVMGuestInstance) HomeDir() string

func (*SKVMGuestInstance) ImportServer

func (s *SKVMGuestInstance) ImportServer(pendingDelete bool)

func (*SKVMGuestInstance) InitQga

func (s *SKVMGuestInstance) InitQga() error

func (*SKVMGuestInstance) IsDaemon

func (s *SKVMGuestInstance) IsDaemon() bool

func (*SKVMGuestInstance) IsDirtyShotdown

func (s *SKVMGuestInstance) IsDirtyShotdown() bool

func (*SKVMGuestInstance) IsKvmSupport

func (s *SKVMGuestInstance) IsKvmSupport() bool

func (*SKVMGuestInstance) IsLoaded

func (s *SKVMGuestInstance) IsLoaded() bool

func (*SKVMGuestInstance) IsMaster

func (s *SKVMGuestInstance) IsMaster() bool

func (*SKVMGuestInstance) IsMigratingDestGuest

func (s *SKVMGuestInstance) IsMigratingDestGuest() bool

func (*SKVMGuestInstance) IsMonitorAlive

func (s *SKVMGuestInstance) IsMonitorAlive() bool

func (*SKVMGuestInstance) IsNestedVirt

func (s *SKVMGuestInstance) IsNestedVirt() bool

func (*SKVMGuestInstance) IsOldWindows

func (s *SKVMGuestInstance) IsOldWindows() bool

is windows prioer to windows server 2003

func (*SKVMGuestInstance) IsRunning

func (s *SKVMGuestInstance) IsRunning() bool

func (*SKVMGuestInstance) IsSharedStorage

func (s *SKVMGuestInstance) IsSharedStorage() bool

func (*SKVMGuestInstance) IsSlave

func (s *SKVMGuestInstance) IsSlave() bool

func (*SKVMGuestInstance) IsStopped

func (s *SKVMGuestInstance) IsStopped() bool

func (*SKVMGuestInstance) IsStopping

func (s *SKVMGuestInstance) IsStopping() bool

func (*SKVMGuestInstance) IsSuspend

func (s *SKVMGuestInstance) IsSuspend() bool

func (*SKVMGuestInstance) IsValid

func (s *SKVMGuestInstance) IsValid() bool

func (*SKVMGuestInstance) IsVdiSpice

func (s *SKVMGuestInstance) IsVdiSpice() bool

func (*SKVMGuestInstance) ListStateFilePaths

func (s *SKVMGuestInstance) ListStateFilePaths() []string

func (*SKVMGuestInstance) LoadDesc

func (s *SKVMGuestInstance) LoadDesc() error

func (*SKVMGuestInstance) LogFilePath

func (s *SKVMGuestInstance) LogFilePath() string

func (*SKVMGuestInstance) NicTrafficRecordPath

func (s *SKVMGuestInstance) NicTrafficRecordPath() string

func (*SKVMGuestInstance) OnResumeSyncMetadataInfo

func (s *SKVMGuestInstance) OnResumeSyncMetadataInfo()

func (*SKVMGuestInstance) PrepareDir

func (s *SKVMGuestInstance) PrepareDir() error

func (*SKVMGuestInstance) PrepareDisksMigrate

func (s *SKVMGuestInstance) PrepareDisksMigrate(liveMigrate bool) (*jsonutils.JSONDict, *jsonutils.JSONDict, bool, error)

func (*SKVMGuestInstance) PrepareMigrateCerts

func (s *SKVMGuestInstance) PrepareMigrateCerts() (map[string]string, error)

func (*SKVMGuestInstance) QgaPath

func (s *SKVMGuestInstance) QgaPath() string

func (*SKVMGuestInstance) RecycleDir

func (s *SKVMGuestInstance) RecycleDir() string

func (*SKVMGuestInstance) SaveDesc

func (s *SKVMGuestInstance) SaveDesc(guestDesc *desc.SGuestDesc) error

func (*SKVMGuestInstance) SaveLiveDesc

func (s *SKVMGuestInstance) SaveLiveDesc(guestDesc *desc.SGuestDesc) error

func (*SKVMGuestInstance) SetNicDown

func (s *SKVMGuestInstance) SetNicDown(index int) error

func (*SKVMGuestInstance) SetNicUp

func (s *SKVMGuestInstance) SetNicUp(nic *desc.SGuestNetwork) error

func (*SKVMGuestInstance) SetVncPassword

func (s *SKVMGuestInstance) SetVncPassword()

func (*SKVMGuestInstance) SlaveDisksBlockStream

func (s *SKVMGuestInstance) SlaveDisksBlockStream() error

func (*SKVMGuestInstance) StartDelete

func (s *SKVMGuestInstance) StartDelete(ctx context.Context, migrated bool) error

func (*SKVMGuestInstance) StartGuest

func (s *SKVMGuestInstance) StartGuest(ctx context.Context, userCred mcclient.TokenCredential, params *jsonutils.JSONDict) error

func (*SKVMGuestInstance) StartMonitor

func (s *SKVMGuestInstance) StartMonitor(ctx context.Context, cb func(), isScriptStart bool) error

func (*SKVMGuestInstance) StartMonitorWithImportGuestSocketFile

func (s *SKVMGuestInstance) StartMonitorWithImportGuestSocketFile(ctx context.Context, socketFile string, cb func()) error

func (*SKVMGuestInstance) StartPresendArp

func (s *SKVMGuestInstance) StartPresendArp()

func (*SKVMGuestInstance) StaticSaveSnapshot

func (s *SKVMGuestInstance) StaticSaveSnapshot(
	ctx context.Context, disk storageman.IDisk, snapshotId string,
	encryptKey string, encFormat qemuimg.TEncryptFormat, encAlg seclib2.TSymEncAlg,
) (jsonutils.JSONObject, error)

func (*SKVMGuestInstance) Stop

func (s *SKVMGuestInstance) Stop() bool

func (*SKVMGuestInstance) StreamDisks

func (s *SKVMGuestInstance) StreamDisks(ctx context.Context, callback func(), disksIdx []int)

func (*SKVMGuestInstance) SyncConfig

func (s *SKVMGuestInstance) SyncConfig(
	ctx context.Context, guestDesc *desc.SGuestDesc, fwOnly bool,
) (jsonutils.JSONObject, error)

func (*SKVMGuestInstance) SyncMetadata

func (s *SKVMGuestInstance) SyncMetadata(meta *jsonutils.JSONDict) error

func (*SKVMGuestInstance) SyncMirrorJobFailed

func (s *SKVMGuestInstance) SyncMirrorJobFailed(reason string)

func (*SKVMGuestInstance) SyncQemuCmdline

func (s *SKVMGuestInstance) SyncQemuCmdline(cmdline string)

func (*SKVMGuestInstance) SyncStatus

func (s *SKVMGuestInstance) SyncStatus(reason string)

func (*SKVMGuestInstance) WriteMigrateCerts

func (s *SKVMGuestInstance) WriteMigrateCerts(certs map[string]string) error

type SKVMInstanceRuntime

type SKVMInstanceRuntime struct {
	QemuVersion string
	VncPassword string

	LiveMigrateDestPort *int64
	LiveMigrateUseTls   bool

	StartupTask *SGuestResumeTask
	MigrateTask *SGuestLiveMigrateTask
	// contains filtered or unexported fields
}

type SLibvirtDomainImportConfig

type SLibvirtDomainImportConfig struct {
	LibvritDomainXmlDir string
	Servers             []SLibvirtServer
}

type SLibvirtServer

type SLibvirtServer struct {
	Uuid  string
	MacIp map[string]string
}

type SLiveMigrate

type SLiveMigrate struct {
	Sid            string
	DestPort       int
	NbdServerPort  int
	DestIp         string
	IsLocal        bool
	EnableTLS      bool
	MaxBandwidthMB *int64
	QuicklyFinish  bool
}

type SMemorySnapshot

type SMemorySnapshot struct {
	*hostapi.GuestMemorySnapshotRequest
	Sid string
}

type SMemorySnapshotDelete

type SMemorySnapshotDelete struct {
	*hostapi.GuestMemorySnapshotDeleteRequest
}

type SMemorySnapshotReset

type SMemorySnapshotReset struct {
	*hostapi.GuestMemorySnapshotResetRequest
	Sid string
}

type SQgaGuestSetNetwork

type SQgaGuestSetNetwork struct {
	Timeout int
	Sid     string
	Device  string
	Ipmask  string
	Gateway string
}

type SQgaGuestSetPassword

type SQgaGuestSetPassword struct {
	*hostapi.GuestSetPasswordRequest
	Sid string
}

type SReloadDisk

type SReloadDisk struct {
	Sid  string
	Disk storageman.IDisk
}

type SSrcPrepareMigrate

type SSrcPrepareMigrate struct {
	Sid               string
	LiveMigrate       bool
	LiveMigrateUseTLS bool
}

type SStorageCloneDisk

type SStorageCloneDisk struct {
	ServerId       string
	SourceStorage  storageman.IStorage
	SourceDisk     storageman.IDisk
	TargetStorage  storageman.IStorage
	TargetDiskId   string
	DiskFormat     string
	TargetDiskDesc *compute.GuestdiskJsonDesc

	// clone progress
	CompletedDiskCount int
	CloneDiskCount     int
}

type SorttedCPUDie

type SorttedCPUDie []*CPUDie

func (SorttedCPUDie) Len

func (pq SorttedCPUDie) Len() int

func (SorttedCPUDie) Less

func (pq SorttedCPUDie) Less(i, j int) bool

func (*SorttedCPUDie) LoadCpus

func (pq *SorttedCPUDie) LoadCpus(cpus []int, vcpuCount int)

func (*SorttedCPUDie) Pop

func (pq *SorttedCPUDie) Pop() interface{}

func (*SorttedCPUDie) Push

func (pq *SorttedCPUDie) Push(item interface{})

func (*SorttedCPUDie) ReleaseCpus

func (pq *SorttedCPUDie) ReleaseCpus(cpus []int, vcpuCount int)

func (SorttedCPUDie) Swap

func (pq SorttedCPUDie) Swap(i, j int)

Directories

Path Synopsis
api

Jump to

Keyboard shortcuts

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