Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
hypervisor: Add hypervisor interface to return config
Browse files Browse the repository at this point in the history
This api will allow the config to be accessed by other subsystems
such as network.

Signed-off-by: Archana Shinde <[email protected]>
  • Loading branch information
amshinde committed Sep 12, 2018
1 parent a5f05bf commit 2f552fb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions virtcontainers/hypervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -560,4 +560,5 @@ type hypervisor interface {
getSandboxConsole(sandboxID string) (string, error)
disconnect()
capabilities() capabilities
hypervisorConfig() HypervisorConfig
}
4 changes: 4 additions & 0 deletions virtcontainers/mock_hypervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ func (m *mockHypervisor) capabilities() capabilities {
return capabilities{}
}

func (m *mockHypervisor) hypervisorConfig() HypervisorConfig {
return HypervisorConfig{}
}

func (m *mockHypervisor) createSandbox() error {
return nil
}
Expand Down
4 changes: 4 additions & 0 deletions virtcontainers/qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ func (q *qemu) capabilities() capabilities {
return q.arch.capabilities()
}

func (q *qemu) hypervisorConfig() HypervisorConfig {
return q.config
}

// get the QEMU binary path
func (q *qemu) qemuPath() (string, error) {
p, err := q.config.HypervisorAssetPath()
Expand Down

0 comments on commit 2f552fb

Please sign in to comment.