mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-22 13:38:26 +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 {
|
func (a *acrnArchBase) capabilities() types.Capabilities {
|
||||||
var caps types.Capabilities
|
var caps types.Capabilities
|
||||||
|
|
||||||
// For devicemapper disable support for filesystem sharing
|
|
||||||
caps.SetFsSharingUnsupported()
|
|
||||||
caps.SetBlockDeviceSupport()
|
caps.SetBlockDeviceSupport()
|
||||||
caps.SetBlockDeviceHotplugSupport()
|
caps.SetBlockDeviceHotplugSupport()
|
||||||
|
|
||||||
|
@ -1065,7 +1065,6 @@ func (fc *firecracker) capabilities() types.Capabilities {
|
|||||||
span, _ := fc.trace("capabilities")
|
span, _ := fc.trace("capabilities")
|
||||||
defer span.Finish()
|
defer span.Finish()
|
||||||
var caps types.Capabilities
|
var caps types.Capabilities
|
||||||
caps.SetFsSharingUnsupported()
|
|
||||||
caps.SetBlockDeviceHotplugSupport()
|
caps.SetBlockDeviceHotplugSupport()
|
||||||
|
|
||||||
return caps
|
return caps
|
||||||
|
@ -119,6 +119,7 @@ func (q *qemuAmd64) capabilities() types.Capabilities {
|
|||||||
}
|
}
|
||||||
|
|
||||||
caps.SetMultiQueueSupport()
|
caps.SetMultiQueueSupport()
|
||||||
|
caps.SetFsSharingSupport()
|
||||||
|
|
||||||
return caps
|
return caps
|
||||||
}
|
}
|
||||||
|
@ -271,6 +271,7 @@ func (q *qemuArchBase) capabilities() types.Capabilities {
|
|||||||
var caps types.Capabilities
|
var caps types.Capabilities
|
||||||
caps.SetBlockDeviceHotplugSupport()
|
caps.SetBlockDeviceHotplugSupport()
|
||||||
caps.SetMultiQueueSupport()
|
caps.SetMultiQueueSupport()
|
||||||
|
caps.SetFsSharingSupport()
|
||||||
return caps
|
return caps
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ const (
|
|||||||
blockDeviceSupport = 1 << iota
|
blockDeviceSupport = 1 << iota
|
||||||
blockDeviceHotplugSupport
|
blockDeviceHotplugSupport
|
||||||
multiQueueSupport
|
multiQueueSupport
|
||||||
fsSharingUnsupported
|
fsSharingSupported
|
||||||
)
|
)
|
||||||
|
|
||||||
// Capabilities describe a virtcontainers hypervisor capabilities
|
// Capabilities describe a virtcontainers hypervisor capabilities
|
||||||
@ -50,10 +50,10 @@ func (caps *Capabilities) SetMultiQueueSupport() {
|
|||||||
|
|
||||||
// IsFsSharingSupported tells if an hypervisor supports host filesystem sharing.
|
// IsFsSharingSupported tells if an hypervisor supports host filesystem sharing.
|
||||||
func (caps *Capabilities) IsFsSharingSupported() bool {
|
func (caps *Capabilities) IsFsSharingSupported() bool {
|
||||||
return caps.flags&fsSharingUnsupported == 0
|
return caps.flags&fsSharingSupported != 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetFsSharingUnsupported sets the host filesystem sharing capability to true.
|
// SetFsSharingUnsupported sets the host filesystem sharing capability to true.
|
||||||
func (caps *Capabilities) SetFsSharingUnsupported() {
|
func (caps *Capabilities) SetFsSharingSupport() {
|
||||||
caps.flags |= fsSharingUnsupported
|
caps.flags |= fsSharingSupported
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ func TestBlockDeviceHotplugCapability(t *testing.T) {
|
|||||||
func TestFsSharingCapability(t *testing.T) {
|
func TestFsSharingCapability(t *testing.T) {
|
||||||
var caps Capabilities
|
var caps Capabilities
|
||||||
|
|
||||||
assert.True(t, caps.IsFsSharingSupported())
|
|
||||||
caps.SetFsSharingUnsupported()
|
|
||||||
assert.False(t, caps.IsFsSharingSupported())
|
assert.False(t, caps.IsFsSharingSupported())
|
||||||
|
caps.SetFsSharingSupport()
|
||||||
|
assert.True(t, caps.IsFsSharingSupported())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user