kata-env: add SharedFS option to output

It's useful to know whether virtio-9p or virtio-fs is being used.  Add
the status to the kata-env output.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
Stefan Hajnoczi 2019-02-20 14:41:01 +00:00
parent 75f75862c2
commit 0a69eb8fff
4 changed files with 18 additions and 0 deletions

View File

@ -92,6 +92,7 @@ type HypervisorInfo struct {
MemorySlots uint32
Debug bool
UseVSock bool
SharedFS string
}
// ProxyInfo stores proxy details
@ -352,6 +353,7 @@ func getHypervisorInfo(config oci.RuntimeConfig) HypervisorInfo {
UseVSock: config.HypervisorConfig.UseVSock,
MemorySlots: config.HypervisorConfig.MemSlots,
EntropySource: config.HypervisorConfig.EntropySource,
SharedFS: config.HypervisorConfig.SharedFS,
}
}

View File

@ -37,6 +37,7 @@ const testHypervisorVersion = "QEMU emulator version 2.7.0+git.741f430a96-6.1, C
var (
hypervisorDebug = false
enableVirtioFS = false
proxyDebug = false
runtimeDebug = false
runtimeTrace = false
@ -91,6 +92,7 @@ func makeRuntimeConfig(prefixDir string) (configFile string, config oci.RuntimeC
enableIOThreads := true
hotplugVFIOOnRootBus := true
disableNewNetNs := false
sharedFS := "virtio-9p"
filesToCreate := []string{
hypervisorPath,
@ -126,6 +128,10 @@ func makeRuntimeConfig(prefixDir string) (configFile string, config oci.RuntimeC
return "", oci.RuntimeConfig{}, err
}
if enableVirtioFS {
sharedFS = "virtio-fs"
}
hypConfig := katautils.GetDefaultHypervisorConfig()
configFileOptions := katatestutils.RuntimeConfigOptions{
@ -157,6 +163,7 @@ func makeRuntimeConfig(prefixDir string) (configFile string, config oci.RuntimeC
NetmonDebug: netmonDebug,
AgentDebug: agentDebug,
AgentTrace: agentTrace,
SharedFS: sharedFS,
}
runtimeConfig := katatestutils.MakeRuntimeConfigFileData(configFileOptions)
@ -321,6 +328,7 @@ func getExpectedHypervisor(config oci.RuntimeConfig) HypervisorInfo {
MemorySlots: config.HypervisorConfig.MemSlots,
Debug: config.HypervisorConfig.Debug,
EntropySource: config.HypervisorConfig.EntropySource,
SharedFS: config.HypervisorConfig.SharedFS,
}
}
@ -498,6 +506,7 @@ func TestEnvGetEnvInfo(t *testing.T) {
// options are tested.
for _, toggle := range []bool{false, true} {
hypervisorDebug = toggle
enableVirtioFS = toggle
proxyDebug = toggle
runtimeDebug = toggle
runtimeTrace = toggle

View File

@ -27,6 +27,7 @@ type RuntimeConfigOptions struct {
BlockDeviceDriver string
AgentTraceMode string
AgentTraceType string
SharedFS string
DisableBlock bool
EnableIOThreads bool
HotplugVFIOOnRootBus bool
@ -61,6 +62,8 @@ func MakeRuntimeConfigFileData(config RuntimeConfigOptions) string {
msize_9p = ` + strconv.FormatUint(uint64(config.DefaultMsize9p), 10) + `
enable_debug = ` + strconv.FormatBool(config.HypervisorDebug) + `
guest_hook_path = "` + config.DefaultGuestHookPath + `"
shared_fs = "` + config.SharedFS + `"
virtio_fs_daemon = "/path/to/virtiofsd"
[proxy.kata]
enable_debug = ` + strconv.FormatBool(config.ProxyDebug) + `

View File

@ -83,6 +83,7 @@ func createAllRuntimeConfigFiles(dir, hypervisor string) (config testRuntimeConf
enableIOThreads := true
hotplugVFIOOnRootBus := true
disableNewNetNs := false
sharedFS := "virtio-9p"
configFileOptions := katatestutils.RuntimeConfigOptions{
Hypervisor: "qemu",
@ -113,6 +114,7 @@ func createAllRuntimeConfigFiles(dir, hypervisor string) (config testRuntimeConf
NetmonDebug: netmonDebug,
AgentDebug: agentDebug,
AgentTrace: agentTrace,
SharedFS: sharedFS,
}
runtimeConfigFileData := katatestutils.MakeRuntimeConfigFileData(configFileOptions)
@ -160,6 +162,8 @@ func createAllRuntimeConfigFiles(dir, hypervisor string) (config testRuntimeConf
MemSlots: defaultMemSlots,
EntropySource: defaultEntropySource,
GuestHookPath: defaultGuestHookPath,
SharedFS: sharedFS,
VirtioFSDaemon: "/path/to/virtiofsd",
}
agentConfig := vc.KataAgentConfig{}