Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockDevice ¶
type BlockDevice struct { // nbd1 Name string `json:"name"` // 512 LogSec int `json:"log-sec"` // gpt Pttype string `json:"pttype"` // Child partitions of a device. Partitions []Child `json:"children"` }
BlockDevice a unique device in lsblk output.
type Child ¶
type Child struct { // nbd1p1 Name string `json:"name"` // 0fc63daf-8483-4772-8e79-3d69d8477de4 Parttype string `json:"parttype"` // Linux filesystem Parttypename string `json:"parttypename"` // ext4 Fstype string `json:"fstype"` // cloudimg-rootfs Label string `json:"label"` }
Child details each partition of a device.
type Chroot ¶
type Chroot struct {
MountPoint string
}
Chroot details about the chroot storing the image.
type Image ¶
type Image struct { Filename string `json:"filename"` // Settings used during mounting the image. PartNum int `json:"-"` NoSysDNS bool `json:"-"` NoSysMounts bool `json:"-"` ReadOnly bool `json:"-"` // Used to manipulate the image. MountPoint string `json:"-"` NBD NBD `json:"-"` // Information about the image and its' partitions. ImageFormat string `json:"image-format"` PartitionTable string `json:"partition-table"` Size string `json:"size"` VirtualSize string `json:"virtual-size"` SectorSize int `json:"sector-size"` Partitions []Partition `json:"partitions"` }
Image is the user's main control point for manipulating the image.
type Lsblk ¶
type Lsblk struct {
LsblkDevices []BlockDevice `json:"blockdevices"`
}
Lsblk captures the JSON output of lsblk command.
type NBD ¶
type NBD struct { // /sys/block/nbd0 BlockPath string // /dev/nbd0 DevicePath string // nbd0 Name string // PID of the nbd device PID string // /sys/block/nbd0/pid PIDFile string }
NBD collects details about the used NBD device.
func (*NBD) Disconnect ¶
Disconnect the NBD device from qemu-nbd to free it.
type Partition ¶
type Partition struct { Name string `json:"name"` Type string `json:"type"` Label string `json:"label"` Filesystem string `json:"filesystem"` }
Partition captures info about each partition in an image.
type QEMUImgInfo ¶
type QEMUImgInfo struct { // Filename analyzed Filename string `json:"filename"` // Type of image (e.g. qcow2, raw, etc.) Format string `json:"format"` // Physical size of the disk (e.g. 550637568) ActualSize int64 `json:"actual-size"` // Virtual size of the disk (e.g. 2361393152) VirtualSize int64 `json:"virtual-size"` }
QEMUImgInfo captures qemu-img JSON output.
e.g. qemu-img info --output=json focal-server-cloudimg-amd64.img
Click to show internal directories.
Click to hide internal directories.