libvirt

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: BSD-2-Clause Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type Service

type Service struct {
	DB *gorm.DB

	System systemServiceInterfaces.SystemServiceInterface

	Conn *libvirt.Libvirt

	GZFS *gzfs.Client
	// contains filtered or unexported fields
}

func (*Service) ApplyVMStatsRetention added in v0.1.0

func (s *Service) ApplyVMStatsRetention() error

func (*Service) CheckPCIDevicesInUse

func (s *Service) CheckPCIDevicesInUse(vm vmModels.VM) error

func (*Service) CheckVersion

func (s *Service) CheckVersion() error

func (*Service) ConvertVMToTemplate added in v0.2.0

func (s *Service) ConvertVMToTemplate(
	ctx context.Context,
	rid uint,
	req libvirtServiceInterfaces.ConvertToTemplateRequest,
) (retErr error)

func (*Service) CreateCloudInitISO added in v0.1.0

func (s *Service) CreateCloudInitISO(vm vmModels.VM) error

func (*Service) CreateLvVm

func (s *Service) CreateLvVm(id int, ctx context.Context) error

func (*Service) CreateStorageParent added in v0.1.0

func (s *Service) CreateStorageParent(rid uint, poolName string, ctx context.Context) error

func (*Service) CreateVM

func (*Service) CreateVMDirectory added in v0.1.0

func (s *Service) CreateVMDirectory(rid uint) (string, error)

func (*Service) CreateVMDisk added in v0.1.0

func (s *Service) CreateVMDisk(rid uint, storage vmModels.Storage, ctx context.Context) error

func (*Service) CreateVMSnapshot added in v0.1.0

func (s *Service) CreateVMSnapshot(
	ctx context.Context,
	rid uint,
	name string,
	description string,
) (*vmModels.VMSnapshot, error)

func (*Service) CreateVMsFromTemplate added in v0.2.0

func (s *Service) CreateVMsFromTemplate(ctx context.Context, templateID uint, req libvirtServiceInterfaces.CreateFromTemplateRequest) error

func (*Service) CreateVmXML

func (s *Service) CreateVmXML(vm vmModels.VM, vmPath string) (string, error)

func (*Service) DeleteVMSnapshot added in v0.1.0

func (s *Service) DeleteVMSnapshot(ctx context.Context, rid uint, snapshotID uint) error

func (*Service) DeleteVMTemplate added in v0.2.0

func (s *Service) DeleteVMTemplate(ctx context.Context, templateID uint) error

func (*Service) FindAndChangeMAC

func (s *Service) FindAndChangeMAC(rid uint, oldMac string, newMac string) error

func (*Service) FindISOByUUID

func (s *Service) FindISOByUUID(uuid string, includeImg bool) (string, error)

func (*Service) FindJailsByMac added in v0.2.2

func (s *Service) FindJailsByMac(mac string) ([]jailModels.Jail, error)

func (*Service) FindVMsByMac added in v0.2.2

func (s *Service) FindVMsByMac(mac string) ([]vmModels.VM, error)

func (*Service) FindVmByMac

func (s *Service) FindVmByMac(mac string) (vmModels.VM, error)

func (*Service) FlashCloudInitMediaToDisk added in v0.1.0

func (s *Service) FlashCloudInitMediaToDisk(vm vmModels.VM) error

func (*Service) ForceRemoveVM added in v0.1.0

func (s *Service) ForceRemoveVM(rid uint, cleanUpMacs bool, ctx context.Context) ([]string, error)

func (*Service) GeneratePinArgs added in v0.1.0

func (s *Service) GeneratePinArgs(pins []vmModels.VMCPUPinning) []string

func (*Service) GetCloudInitISOPath added in v0.1.0

func (s *Service) GetCloudInitISOPath(rid uint) (string, error)

func (*Service) GetDomainState added in v0.1.0

func (s *Service) GetDomainState(rid int) (libvirt.DomainState, error)

func (*Service) GetDomainStates added in v0.1.0

func (s *Service) GetDomainStates() ([]libvirtServiceInterfaces.DomainState, error)

func (*Service) GetLvDomain

func (s *Service) GetLvDomain(rid uint) (*libvirtServiceInterfaces.LvDomain, error)

func (*Service) GetNextBootOrderIndex added in v0.1.0

func (s *Service) GetNextBootOrderIndex(vmId int) (int, error)

func (*Service) GetQemuGuestAgentInfo added in v0.1.0

func (s *Service) GetQemuGuestAgentInfo(rid uint) (libvirtServiceInterfaces.QemuGuestAgentInfo, error)

func (*Service) GetSimpleVM added in v0.1.0

func (s *Service) GetSimpleVM(identifier int, byRID bool) (libvirtServiceInterfaces.SimpleList, error)

func (*Service) GetVM added in v0.1.0

func (s *Service) GetVM(id int) (vmModels.VM, error)

func (*Service) GetVMByRID added in v0.1.0

func (s *Service) GetVMByRID(rid uint) (vmModels.VM, error)

func (*Service) GetVMConfigDirectory added in v0.1.0

func (s *Service) GetVMConfigDirectory(rid uint) (string, error)

func (*Service) GetVMIDByRID added in v0.2.0

func (s *Service) GetVMIDByRID(rid uint) (uint, error)

func (*Service) GetVMLogs added in v0.2.0

func (s *Service) GetVMLogs(rid uint) (string, error)

func (*Service) GetVMTemplate added in v0.2.0

func (s *Service) GetVMTemplate(templateID uint) (*vmModels.VMTemplate, error)

func (*Service) GetVMTemplatesSimple added in v0.2.0

func (s *Service) GetVMTemplatesSimple() ([]libvirtServiceInterfaces.SimpleTemplateList, error)

func (*Service) GetVMUsage

func (s *Service) GetVMUsage(rid int, step db.GFSStep) ([]vmModels.VMStats, error)

func (*Service) GetVMXML

func (s *Service) GetVMXML(rid uint) (string, error)

func (*Service) IsDomainInactive

func (s *Service) IsDomainInactive(rid uint) (bool, error)

func (*Service) IsDomainShutOff

func (s *Service) IsDomainShutOff(rid uint) (bool, error)

func (*Service) IsDomainShutOffByID added in v0.1.0

func (s *Service) IsDomainShutOffByID(id uint) (bool, error)

func (*Service) IsVirtualizationEnabled added in v0.1.0

func (s *Service) IsVirtualizationEnabled() bool

func (*Service) ListVMSnapshots added in v0.1.0

func (s *Service) ListVMSnapshots(rid uint) ([]vmModels.VMSnapshot, error)

func (*Service) ListVMs

func (s *Service) ListVMs() ([]vmModels.VM, error)

func (*Service) LvVMAction

func (s *Service) LvVMAction(vm vmModels.VM, action string) error

func (*Service) ModifyBootOrder

func (s *Service) ModifyBootOrder(rid uint, startAtBoot bool, bootOrder int) error

func (*Service) ModifyCPU

func (*Service) ModifyClock added in v0.1.0

func (s *Service) ModifyClock(rid uint, timeOffset string) error

func (*Service) ModifyCloudInitData added in v0.1.0

func (s *Service) ModifyCloudInitData(rid uint, data string, metadata string, networkConfig string) error

func (*Service) ModifyIgnoreUMSRs added in v0.1.0

func (s *Service) ModifyIgnoreUMSRs(rid uint, ignore bool) error

func (*Service) ModifyPassthrough

func (s *Service) ModifyPassthrough(rid uint, pciDevices []int) error

func (*Service) ModifyQemuGuestAgent added in v0.1.0

func (s *Service) ModifyQemuGuestAgent(rid uint, enabled bool) error

func (*Service) ModifyRAM

func (s *Service) ModifyRAM(rid uint, ram int) error

func (*Service) ModifySerial added in v0.1.0

func (s *Service) ModifySerial(rid uint, enabled bool) error

func (*Service) ModifyShutdownWaitTime added in v0.1.0

func (s *Service) ModifyShutdownWaitTime(rid uint, waitTime int) error

func (*Service) ModifyTPMEmulation added in v0.1.0

func (s *Service) ModifyTPMEmulation(rid uint, enabled bool) error

func (*Service) ModifyVNC

func (*Service) ModifyWakeOnLan

func (s *Service) ModifyWakeOnLan(rid uint, enabled bool) error

func (*Service) NetworkAttach

func (*Service) NetworkDetach

func (s *Service) NetworkDetach(rid uint, networkId uint) error

func (*Service) NetworkUpdate added in v0.1.0

func (*Service) PerformAction

func (s *Service) PerformAction(rid uint, action string) error

func (*Service) PreflightConvertVMToTemplate added in v0.2.0

func (s *Service) PreflightConvertVMToTemplate(
	ctx context.Context,
	rid uint,
	req libvirtServiceInterfaces.ConvertToTemplateRequest,
) error

func (*Service) PreflightCreateVMsFromTemplate added in v0.2.0

func (s *Service) PreflightCreateVMsFromTemplate(ctx context.Context, templateID uint, req libvirtServiceInterfaces.CreateFromTemplateRequest) error

func (*Service) PruneOrphanedVMStats

func (s *Service) PruneOrphanedVMStats() error

func (*Service) RemoveLvVm

func (s *Service) RemoveLvVm(rid uint) error

func (*Service) RemoveQGASocket added in v0.1.0

func (s *Service) RemoveQGASocket(vm vmModels.VM) error

func (*Service) RemoveStorageXML added in v0.1.0

func (s *Service) RemoveStorageXML(rid uint, storage vmModels.Storage) error

func (*Service) RemoveVM

func (s *Service) RemoveVM(rid uint, cleanUpMacs bool, deleteRawDisks bool, deleteVolumes bool, ctx context.Context) error

func (*Service) ResetUEFIVars added in v0.1.0

func (s *Service) ResetUEFIVars(rid uint) error

func (*Service) RetireVMLocalMetadata added in v0.1.0

func (s *Service) RetireVMLocalMetadata(rid uint, cleanUpMacs bool) error

func (*Service) RollbackVMSnapshot added in v0.1.0

func (s *Service) RollbackVMSnapshot(
	ctx context.Context,
	rid uint,
	snapshotID uint,
	destroyMoreRecent bool,
) error

func (*Service) SetActionDate

func (s *Service) SetActionDate(vm vmModels.VM, action string) error

func (*Service) SetLeftPanelRefreshEmitter added in v0.1.0

func (s *Service) SetLeftPanelRefreshEmitter(emitter func(reason string))

func (*Service) SimpleListVM

func (s *Service) SimpleListVM() ([]libvirtServiceInterfaces.SimpleList, error)

func (*Service) StartLifecycleWatcher added in v0.1.0

func (s *Service) StartLifecycleWatcher(ctx context.Context)

func (*Service) StartTPM

func (s *Service) StartTPM() error

func (*Service) StopTPM

func (s *Service) StopTPM(rid uint) error

func (*Service) StorageAttach

func (*Service) StorageDetach

func (*Service) StorageImport added in v0.1.0

func (*Service) StorageNew added in v0.1.0

func (*Service) StorageUpdate added in v0.1.0

func (*Service) StoreVMUsage

func (s *Service) StoreVMUsage() error

func (*Service) SyncVMDisks added in v0.1.0

func (s *Service) SyncVMDisks(rid uint) error

func (*Service) UpdateDescription

func (s *Service) UpdateDescription(rid uint, description string) error

func (*Service) UpdateName added in v0.2.1

func (s *Service) UpdateName(rid uint, name string) error

func (*Service) ValidateBootOrderIndex added in v0.1.0

func (s *Service) ValidateBootOrderIndex(vmId int, bootOrder int) (bool, error)

func (*Service) ValidateCPUPins added in v0.1.0

func (s *Service) ValidateCPUPins(rid uint, pins []libvirtServiceInterfaces.CPUPinning, hostLogicalPerSocket int) error

func (*Service) WriteVMJson added in v0.1.0

func (s *Service) WriteVMJson(rid uint) error

Jump to

Keyboard shortcuts

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