diskutils

package
v0.3.10-0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: Apache-2.0 Imports: 28 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TMPDIR = "/tmp/vmware-root"
)

Variables

View Source
var (
	MNT_PATTERN = regexp.MustCompile(`Disk flat file mounted under ([^\s]+)`)
)

Functions

This section is empty.

Types

type Command

type Command struct {
	*exec.Cmd
	// contains filtered or unexported fields
}

func NewCommand

func NewCommand(name string, arg ...string) *Command

func (*Command) Exited

func (c *Command) Exited() bool

func (*Command) Kill

func (c *Command) Kill() error

func (*Command) Send

func (c *Command) Send(msg []byte) error

func (*Command) Start

func (c *Command) Start() error

func (*Command) Wait

func (c *Command) Wait() error

Wait will block

type DiskParams

type DiskParams struct {
	Hypervisor string
	DiskInfo   qemuimg.SImageInfo
	VddkInfo   *apis.VDDKConInfo
}

type IDeployer

type IDeployer interface {
	Connect() error
	Disconnect() error

	GetPartitions() []fsdriver.IDiskPartition
	IsLVMPartition() bool
	Zerofree()
	ResizePartition() error
	FormatPartition(fs, uuid string) error
	MakePartition(fs string) error
}

type IDisk

type IDisk interface {
	Connect() error
	Disconnect() error
	MountRootfs() (fsdriver.IRootFsDriver, error)
	UmountRootfs(driver fsdriver.IRootFsDriver) error
	ResizePartition() error
	Cleanup()
}

func GetIDisk

func GetIDisk(params DiskParams, driver string, readOnly bool) (IDisk, error)

type SKVMGuestDisk

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

func NewKVMGuestDisk

func NewKVMGuestDisk(imageInfo qemuimg.SImageInfo, driver string, readOnly bool) (*SKVMGuestDisk, error)

func (*SKVMGuestDisk) Cleanup

func (d *SKVMGuestDisk) Cleanup()

func (*SKVMGuestDisk) Connect

func (d *SKVMGuestDisk) Connect() error

func (*SKVMGuestDisk) DetectIsUEFISupport

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

func (*SKVMGuestDisk) Disconnect

func (d *SKVMGuestDisk) Disconnect() error

func (*SKVMGuestDisk) FormatPartition

func (d *SKVMGuestDisk) FormatPartition(fs, uuid string) error

func (*SKVMGuestDisk) IsLVMPartition

func (d *SKVMGuestDisk) IsLVMPartition() bool

func (*SKVMGuestDisk) MakePartition

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

func (*SKVMGuestDisk) MountKvmRootfs

func (d *SKVMGuestDisk) MountKvmRootfs() (fsdriver.IRootFsDriver, error)

func (*SKVMGuestDisk) MountKvmRootfsReadOnly

func (d *SKVMGuestDisk) MountKvmRootfsReadOnly() (fsdriver.IRootFsDriver, error)

func (*SKVMGuestDisk) MountRootfs

func (d *SKVMGuestDisk) MountRootfs() (fsdriver.IRootFsDriver, error)

func (*SKVMGuestDisk) ResizePartition

func (d *SKVMGuestDisk) ResizePartition() error

func (*SKVMGuestDisk) UmountKvmRootfs

func (d *SKVMGuestDisk) UmountKvmRootfs(fd fsdriver.IRootFsDriver) error

func (*SKVMGuestDisk) UmountRootfs

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

func (*SKVMGuestDisk) Zerofree

func (d *SKVMGuestDisk) Zerofree()

type VDDKDisk

type VDDKDisk struct {
	Host     string
	Port     int
	User     string
	Passwd   string
	VmRef    string
	DiskPath string

	FUseDir  string
	PartDirs []string
	Proc     *Command
	Pid      int
	// contains filtered or unexported fields
}

func NewVDDKDisk

func NewVDDKDisk(vddkInfo *apis.VDDKConInfo, diskPath, deployDriver string, readOnly bool) (*VDDKDisk, error)

func (*VDDKDisk) Cleanup

func (vd *VDDKDisk) Cleanup()

func (*VDDKDisk) Connect

func (vd *VDDKDisk) Connect() error

func (*VDDKDisk) ConnectBlockDevice

func (vd *VDDKDisk) ConnectBlockDevice() (string, error)

connect vddk disk as fuse block device on local host return fuse device path, is null error

func (*VDDKDisk) Disconnect

func (vd *VDDKDisk) Disconnect() error

func (*VDDKDisk) DisconnectBlockDevice

func (vd *VDDKDisk) DisconnectBlockDevice() error

func (*VDDKDisk) ExecProg

func (vd *VDDKDisk) ExecProg() error

func (*VDDKDisk) Mount

func (vd *VDDKDisk) Mount() (err error)

func (*VDDKDisk) MountRootfs

func (vd *VDDKDisk) MountRootfs() (fsdriver.IRootFsDriver, error)

func (*VDDKDisk) ParsePartitions

func (vd *VDDKDisk) ParsePartitions(buf string) error

func (*VDDKDisk) ResizePartition

func (vd *VDDKDisk) ResizePartition() error

func (*VDDKDisk) Umount

func (vd *VDDKDisk) Umount() error

func (*VDDKDisk) UmountRootfs

func (vd *VDDKDisk) UmountRootfs(fd fsdriver.IRootFsDriver) error

func (*VDDKDisk) WaitMounted

func (vd *VDDKDisk) WaitMounted() error

type VDDKPartition

type VDDKPartition struct {
	*kvmpart.SLocalGuestFS
}

func (*VDDKPartition) GetPartDev

func (vp *VDDKPartition) GetPartDev() string

func (*VDDKPartition) GetPhysicalPartitionType

func (vp *VDDKPartition) GetPhysicalPartitionType() string

func (*VDDKPartition) IsMounted

func (vp *VDDKPartition) IsMounted() bool

func (*VDDKPartition) IsReadonly

func (vp *VDDKPartition) IsReadonly() bool

func (*VDDKPartition) Mount

func (vp *VDDKPartition) Mount() bool

func (*VDDKPartition) MountPartReadOnly

func (vp *VDDKPartition) MountPartReadOnly() bool

func (*VDDKPartition) Umount

func (vp *VDDKPartition) Umount() error

func (*VDDKPartition) Zerofree

func (vp *VDDKPartition) Zerofree()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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