diff options
author | Brent Baude <bbaude@redhat.com> | 2022-04-01 15:31:13 -0500 |
---|---|---|
committer | Brent Baude <bbaude@redhat.com> | 2022-04-12 15:51:39 -0500 |
commit | 8710197e8592e9726d98d11d017d1c79ab07415b (patch) | |
tree | d3e1788912e4b1ac7d58e72d1a56cf0cbaf6a143 /pkg/machine/config.go | |
parent | db7cd88c6781c3d42376f02b5b1547c466c45d3e (diff) | |
download | podman-8710197e8592e9726d98d11d017d1c79ab07415b.tar.gz podman-8710197e8592e9726d98d11d017d1c79ab07415b.tar.bz2 podman-8710197e8592e9726d98d11d017d1c79ab07415b.zip |
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 <bbaude@redhat.com>
[NO NEW TESTS NEEDED]
Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/machine/config.go')
-rw-r--r-- | pkg/machine/config.go | 15 |
1 files changed, 11 insertions, 4 deletions
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? |