From 8710197e8592e9726d98d11d017d1c79ab07415b Mon Sep 17 00:00:00 2001 From: Brent Baude Date: Fri, 1 Apr 2022 15:31:13 -0500 Subject: Introduce machine inspect Allow users to inspect their podman virtual machines. This will be helpful for debug and development alike, because more details about the machine can be collected. Signed-off-by: Brent Baude [NO NEW TESTS NEEDED] Signed-off-by: Brent Baude --- pkg/machine/config.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'pkg/machine/config.go') diff --git a/pkg/machine/config.go b/pkg/machine/config.go index 7e1561506..6c2fab0e5 100644 --- a/pkg/machine/config.go +++ b/pkg/machine/config.go @@ -33,14 +33,14 @@ type InitOptions struct { UID string } -type QemuMachineStatus = string +type Status = string const ( // Running indicates the qemu vm is running. - Running QemuMachineStatus = "running" + Running Status = "running" // Stopped indicates the vm has stopped. - Stopped QemuMachineStatus = "stopped" - DefaultMachineName string = "podman-machine-default" + Stopped Status = "stopped" + DefaultMachineName string = "podman-machine-default" ) type Provider interface { @@ -113,12 +113,15 @@ type RemoveOptions struct { SaveIgnition bool } +type InspectOptions struct{} + type VM interface { Init(opts InitOptions) (bool, error) Remove(name string, opts RemoveOptions) (string, func() error, error) Set(name string, opts SetOptions) error SSH(name string, opts SSHOptions) error Start(name string, opts StartOptions) error + State() (Status, error) Stop(name string, opts StopOptions) error } @@ -126,6 +129,10 @@ type DistributionDownload interface { HasUsableCache() (bool, error) Get() *Download } +type InspectInfo struct { + State Status + VM +} func (rc RemoteConnectionType) MakeSSHURL(host, path, port, userName string) url.URL { //TODO Should this function have input verification? -- cgit v1.2.3-54-g00ecf