mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-22 05:28:25 +00:00
types: Make FS sharing disable by default
All the other caps are inverted (not supported by default). Make fs sharing not supported by default and let hypervisors expose if it supports it. Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
This commit is contained in:
parent
4fe62ade7f
commit
0a1ffc1d97
@ -360,8 +360,6 @@ func (a *acrnArchBase) memoryTopology(memoryMb uint64) Memory {
|
||||
func (a *acrnArchBase) capabilities() types.Capabilities {
|
||||
var caps types.Capabilities
|
||||
|
||||
// For devicemapper disable support for filesystem sharing
|
||||
caps.SetFsSharingUnsupported()
|
||||
caps.SetBlockDeviceSupport()
|
||||
caps.SetBlockDeviceHotplugSupport()
|
||||
|
||||
|
@ -1065,7 +1065,6 @@ func (fc *firecracker) capabilities() types.Capabilities {
|
||||
span, _ := fc.trace("capabilities")
|
||||
defer span.Finish()
|
||||
var caps types.Capabilities
|
||||
caps.SetFsSharingUnsupported()
|
||||
caps.SetBlockDeviceHotplugSupport()
|
||||
|
||||
return caps
|
||||
|
@ -119,6 +119,7 @@ func (q *qemuAmd64) capabilities() types.Capabilities {
|
||||
}
|
||||
|
||||
caps.SetMultiQueueSupport()
|
||||
caps.SetFsSharingSupport()
|
||||
|
||||
return caps
|
||||
}
|
||||
|
@ -271,6 +271,7 @@ func (q *qemuArchBase) capabilities() types.Capabilities {
|
||||
var caps types.Capabilities
|
||||
caps.SetBlockDeviceHotplugSupport()
|
||||
caps.SetMultiQueueSupport()
|
||||
caps.SetFsSharingSupport()
|
||||
return caps
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@ const (
|
||||
blockDeviceSupport = 1 << iota
|
||||
blockDeviceHotplugSupport
|
||||
multiQueueSupport
|
||||
fsSharingUnsupported
|
||||
fsSharingSupported
|
||||
)
|
||||
|
||||
// Capabilities describe a virtcontainers hypervisor capabilities
|
||||
@ -50,10 +50,10 @@ func (caps *Capabilities) SetMultiQueueSupport() {
|
||||
|
||||
// IsFsSharingSupported tells if an hypervisor supports host filesystem sharing.
|
||||
func (caps *Capabilities) IsFsSharingSupported() bool {
|
||||
return caps.flags&fsSharingUnsupported == 0
|
||||
return caps.flags&fsSharingSupported != 0
|
||||
}
|
||||
|
||||
// SetFsSharingUnsupported sets the host filesystem sharing capability to true.
|
||||
func (caps *Capabilities) SetFsSharingUnsupported() {
|
||||
caps.flags |= fsSharingUnsupported
|
||||
func (caps *Capabilities) SetFsSharingSupport() {
|
||||
caps.flags |= fsSharingSupported
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ func TestBlockDeviceHotplugCapability(t *testing.T) {
|
||||
func TestFsSharingCapability(t *testing.T) {
|
||||
var caps Capabilities
|
||||
|
||||
assert.True(t, caps.IsFsSharingSupported())
|
||||
caps.SetFsSharingUnsupported()
|
||||
assert.False(t, caps.IsFsSharingSupported())
|
||||
caps.SetFsSharingSupport()
|
||||
assert.True(t, caps.IsFsSharingSupported())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user