mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-01 17:52:40 +00:00
vc: capabilities: add capability flags for filesystem sharing
Not all hypervisors support filesystem sharing. Add capability flags to track this. Since most hypervisor implementations in Kata *do* support this, the set semantices are reversed (ie, set the flag if you do not support the feature). Fixes: #1022 Signed-off-by: Eric Ernst <eric.ernst@intel.com> Signed-off-by: Julio Montes <julio.montes@intel.com>
This commit is contained in:
parent
e776380ff8
commit
dcd48a9ca1
@ -9,6 +9,7 @@ const (
|
||||
blockDeviceSupport = 1 << iota
|
||||
blockDeviceHotplugSupport
|
||||
multiQueueSupport
|
||||
fsSharingUnsupported
|
||||
)
|
||||
|
||||
type capabilities struct {
|
||||
@ -47,3 +48,11 @@ func (caps *capabilities) isMultiQueueSupported() bool {
|
||||
func (caps *capabilities) setMultiQueueSupport() {
|
||||
caps.flags |= multiQueueSupport
|
||||
}
|
||||
|
||||
func (caps *capabilities) isFsSharingSupported() bool {
|
||||
return caps.flags&fsSharingUnsupported == 0
|
||||
}
|
||||
|
||||
func (caps *capabilities) setFsSharingUnsupported() {
|
||||
caps.flags |= fsSharingUnsupported
|
||||
}
|
||||
|
@ -34,3 +34,17 @@ func TestBlockDeviceHotplugCapability(t *testing.T) {
|
||||
t.Fatal()
|
||||
}
|
||||
}
|
||||
|
||||
func TestFsSharingCapability(t *testing.T) {
|
||||
var caps capabilities
|
||||
|
||||
if !caps.isFsSharingSupported() {
|
||||
t.Fatal()
|
||||
}
|
||||
|
||||
caps.setFsSharingUnsupported()
|
||||
|
||||
if caps.isFsSharingSupported() {
|
||||
t.Fatal()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user