diskutils

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: 30 Imported by: 0

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 IDisk

type IDisk interface {
	Connect(desc *apis.GuestDesc) error
	Disconnect() error
	MountRootfs() (fsdriver.IRootFsDriver, error)
	UmountRootfs(driver fsdriver.IRootFsDriver) error
	Cleanup()

	DeployGuestfs(req *apis.DeployParams) (res *apis.DeployGuestFsResponse, err error)
	ResizeFs() (res *apis.Empty, err error)
	FormatFs(req *apis.FormatFsParams) (*apis.Empty, error)
	SaveToGlance(req *apis.SaveToGlanceParams) (*apis.SaveToGlanceResponse, error)
	ProbeImageInfo(req *apis.ProbeImageInfoPramas) (*apis.ImageInfo, error)
}

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(guestDesc *apis.GuestDesc) error

func (*SKVMGuestDisk) DeployGuestfs

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

func (*SKVMGuestDisk) Disconnect

func (d *SKVMGuestDisk) Disconnect() error

func (*SKVMGuestDisk) FormatFs

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

func (*SKVMGuestDisk) IsLVMPartition

func (d *SKVMGuestDisk) IsLVMPartition() bool

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) ProbeImageInfo

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

func (*SKVMGuestDisk) ResizeFs

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

func (*SKVMGuestDisk) SaveToGlance

func (*SKVMGuestDisk) UmountKvmRootfs

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

func (*SKVMGuestDisk) UmountRootfs

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

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(*apis.GuestDesc) 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) DeployGuestfs

func (vd *VDDKDisk) DeployGuestfs(req *apis.DeployParams) (res *apis.DeployGuestFsResponse, err 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) FormatFs

func (d *VDDKDisk) FormatFs(req *apis.FormatFsParams) (*apis.Empty, 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) ProbeImageInfo

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

func (*VDDKDisk) ResizeFs

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

func (*VDDKDisk) SaveToGlance

func (d *VDDKDisk) SaveToGlance(req *apis.SaveToGlanceParams) (*apis.SaveToGlanceResponse, 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