mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-30 01:02:33 +00:00
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:
parent
75f75862c2
commit
0a69eb8fff
@ -92,6 +92,7 @@ type HypervisorInfo struct {
|
|||||||
MemorySlots uint32
|
MemorySlots uint32
|
||||||
Debug bool
|
Debug bool
|
||||||
UseVSock bool
|
UseVSock bool
|
||||||
|
SharedFS string
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProxyInfo stores proxy details
|
// ProxyInfo stores proxy details
|
||||||
@ -352,6 +353,7 @@ func getHypervisorInfo(config oci.RuntimeConfig) HypervisorInfo {
|
|||||||
UseVSock: config.HypervisorConfig.UseVSock,
|
UseVSock: config.HypervisorConfig.UseVSock,
|
||||||
MemorySlots: config.HypervisorConfig.MemSlots,
|
MemorySlots: config.HypervisorConfig.MemSlots,
|
||||||
EntropySource: config.HypervisorConfig.EntropySource,
|
EntropySource: config.HypervisorConfig.EntropySource,
|
||||||
|
SharedFS: config.HypervisorConfig.SharedFS,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@ const testHypervisorVersion = "QEMU emulator version 2.7.0+git.741f430a96-6.1, C
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
hypervisorDebug = false
|
hypervisorDebug = false
|
||||||
|
enableVirtioFS = false
|
||||||
proxyDebug = false
|
proxyDebug = false
|
||||||
runtimeDebug = false
|
runtimeDebug = false
|
||||||
runtimeTrace = false
|
runtimeTrace = false
|
||||||
@ -91,6 +92,7 @@ func makeRuntimeConfig(prefixDir string) (configFile string, config oci.RuntimeC
|
|||||||
enableIOThreads := true
|
enableIOThreads := true
|
||||||
hotplugVFIOOnRootBus := true
|
hotplugVFIOOnRootBus := true
|
||||||
disableNewNetNs := false
|
disableNewNetNs := false
|
||||||
|
sharedFS := "virtio-9p"
|
||||||
|
|
||||||
filesToCreate := []string{
|
filesToCreate := []string{
|
||||||
hypervisorPath,
|
hypervisorPath,
|
||||||
@ -126,6 +128,10 @@ func makeRuntimeConfig(prefixDir string) (configFile string, config oci.RuntimeC
|
|||||||
return "", oci.RuntimeConfig{}, err
|
return "", oci.RuntimeConfig{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if enableVirtioFS {
|
||||||
|
sharedFS = "virtio-fs"
|
||||||
|
}
|
||||||
|
|
||||||
hypConfig := katautils.GetDefaultHypervisorConfig()
|
hypConfig := katautils.GetDefaultHypervisorConfig()
|
||||||
|
|
||||||
configFileOptions := katatestutils.RuntimeConfigOptions{
|
configFileOptions := katatestutils.RuntimeConfigOptions{
|
||||||
@ -157,6 +163,7 @@ func makeRuntimeConfig(prefixDir string) (configFile string, config oci.RuntimeC
|
|||||||
NetmonDebug: netmonDebug,
|
NetmonDebug: netmonDebug,
|
||||||
AgentDebug: agentDebug,
|
AgentDebug: agentDebug,
|
||||||
AgentTrace: agentTrace,
|
AgentTrace: agentTrace,
|
||||||
|
SharedFS: sharedFS,
|
||||||
}
|
}
|
||||||
|
|
||||||
runtimeConfig := katatestutils.MakeRuntimeConfigFileData(configFileOptions)
|
runtimeConfig := katatestutils.MakeRuntimeConfigFileData(configFileOptions)
|
||||||
@ -321,6 +328,7 @@ func getExpectedHypervisor(config oci.RuntimeConfig) HypervisorInfo {
|
|||||||
MemorySlots: config.HypervisorConfig.MemSlots,
|
MemorySlots: config.HypervisorConfig.MemSlots,
|
||||||
Debug: config.HypervisorConfig.Debug,
|
Debug: config.HypervisorConfig.Debug,
|
||||||
EntropySource: config.HypervisorConfig.EntropySource,
|
EntropySource: config.HypervisorConfig.EntropySource,
|
||||||
|
SharedFS: config.HypervisorConfig.SharedFS,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -498,6 +506,7 @@ func TestEnvGetEnvInfo(t *testing.T) {
|
|||||||
// options are tested.
|
// options are tested.
|
||||||
for _, toggle := range []bool{false, true} {
|
for _, toggle := range []bool{false, true} {
|
||||||
hypervisorDebug = toggle
|
hypervisorDebug = toggle
|
||||||
|
enableVirtioFS = toggle
|
||||||
proxyDebug = toggle
|
proxyDebug = toggle
|
||||||
runtimeDebug = toggle
|
runtimeDebug = toggle
|
||||||
runtimeTrace = toggle
|
runtimeTrace = toggle
|
||||||
|
@ -27,6 +27,7 @@ type RuntimeConfigOptions struct {
|
|||||||
BlockDeviceDriver string
|
BlockDeviceDriver string
|
||||||
AgentTraceMode string
|
AgentTraceMode string
|
||||||
AgentTraceType string
|
AgentTraceType string
|
||||||
|
SharedFS string
|
||||||
DisableBlock bool
|
DisableBlock bool
|
||||||
EnableIOThreads bool
|
EnableIOThreads bool
|
||||||
HotplugVFIOOnRootBus bool
|
HotplugVFIOOnRootBus bool
|
||||||
@ -61,6 +62,8 @@ func MakeRuntimeConfigFileData(config RuntimeConfigOptions) string {
|
|||||||
msize_9p = ` + strconv.FormatUint(uint64(config.DefaultMsize9p), 10) + `
|
msize_9p = ` + strconv.FormatUint(uint64(config.DefaultMsize9p), 10) + `
|
||||||
enable_debug = ` + strconv.FormatBool(config.HypervisorDebug) + `
|
enable_debug = ` + strconv.FormatBool(config.HypervisorDebug) + `
|
||||||
guest_hook_path = "` + config.DefaultGuestHookPath + `"
|
guest_hook_path = "` + config.DefaultGuestHookPath + `"
|
||||||
|
shared_fs = "` + config.SharedFS + `"
|
||||||
|
virtio_fs_daemon = "/path/to/virtiofsd"
|
||||||
|
|
||||||
[proxy.kata]
|
[proxy.kata]
|
||||||
enable_debug = ` + strconv.FormatBool(config.ProxyDebug) + `
|
enable_debug = ` + strconv.FormatBool(config.ProxyDebug) + `
|
||||||
|
@ -83,6 +83,7 @@ func createAllRuntimeConfigFiles(dir, hypervisor string) (config testRuntimeConf
|
|||||||
enableIOThreads := true
|
enableIOThreads := true
|
||||||
hotplugVFIOOnRootBus := true
|
hotplugVFIOOnRootBus := true
|
||||||
disableNewNetNs := false
|
disableNewNetNs := false
|
||||||
|
sharedFS := "virtio-9p"
|
||||||
|
|
||||||
configFileOptions := katatestutils.RuntimeConfigOptions{
|
configFileOptions := katatestutils.RuntimeConfigOptions{
|
||||||
Hypervisor: "qemu",
|
Hypervisor: "qemu",
|
||||||
@ -113,6 +114,7 @@ func createAllRuntimeConfigFiles(dir, hypervisor string) (config testRuntimeConf
|
|||||||
NetmonDebug: netmonDebug,
|
NetmonDebug: netmonDebug,
|
||||||
AgentDebug: agentDebug,
|
AgentDebug: agentDebug,
|
||||||
AgentTrace: agentTrace,
|
AgentTrace: agentTrace,
|
||||||
|
SharedFS: sharedFS,
|
||||||
}
|
}
|
||||||
|
|
||||||
runtimeConfigFileData := katatestutils.MakeRuntimeConfigFileData(configFileOptions)
|
runtimeConfigFileData := katatestutils.MakeRuntimeConfigFileData(configFileOptions)
|
||||||
@ -160,6 +162,8 @@ func createAllRuntimeConfigFiles(dir, hypervisor string) (config testRuntimeConf
|
|||||||
MemSlots: defaultMemSlots,
|
MemSlots: defaultMemSlots,
|
||||||
EntropySource: defaultEntropySource,
|
EntropySource: defaultEntropySource,
|
||||||
GuestHookPath: defaultGuestHookPath,
|
GuestHookPath: defaultGuestHookPath,
|
||||||
|
SharedFS: sharedFS,
|
||||||
|
VirtioFSDaemon: "/path/to/virtiofsd",
|
||||||
}
|
}
|
||||||
|
|
||||||
agentConfig := vc.KataAgentConfig{}
|
agentConfig := vc.KataAgentConfig{}
|
||||||
|
Loading…
Reference in New Issue
Block a user