mirror of
https://github.com/containers/podman.git
synced 2025-06-20 00:51:16 +08:00
Merge pull request #11691 from afbjorklund/machine-list
Add more information about the VM to podman machine list
This commit is contained in:
@ -17,6 +17,8 @@ type MachineVM struct {
|
||||
ImagePath string
|
||||
// Memory in megabytes assigned to the vm
|
||||
Memory uint64
|
||||
// Disk size in gigabytes assigned to the vm
|
||||
DiskSize uint64
|
||||
// Name of the vm
|
||||
Name string
|
||||
// SSH port for user networking
|
||||
|
@ -64,6 +64,7 @@ func NewMachine(opts machine.InitOptions) (machine.VM, error) {
|
||||
|
||||
vm.CPUs = opts.CPUS
|
||||
vm.Memory = opts.Memory
|
||||
vm.DiskSize = opts.DiskSize
|
||||
|
||||
// Look up the executable
|
||||
execPath, err := exec.LookPath(QemuCommand)
|
||||
@ -574,6 +575,9 @@ func GetVMInfos() ([]*machine.ListResponse, error) {
|
||||
|
||||
listEntry.Name = vm.Name
|
||||
listEntry.VMType = "qemu"
|
||||
listEntry.CPUs = vm.CPUs
|
||||
listEntry.Memory = vm.Memory
|
||||
listEntry.DiskSize = vm.DiskSize
|
||||
fi, err := os.Stat(fullPath)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user