hypervisor: Add hypervisor interface to return config

This api will allow the config to be accessed by other subsystems
such as network.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
This commit is contained in:
Archana Shinde 2018-09-12 12:02:15 -07:00
parent a5f05bf3e1
commit 2f552fbf43
3 changed files with 9 additions and 0 deletions

View File

@ -560,4 +560,5 @@ type hypervisor interface {
getSandboxConsole(sandboxID string) (string, error)
disconnect()
capabilities() capabilities
hypervisorConfig() HypervisorConfig
}

View File

@ -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
}

View File

@ -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()