The ItemLock API allows for taking shared and exclusive locks on all
items.
For virtcontainers, this is specialized into taking locks on the Lock
item, and will be used for sandbox locking.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
The Raw API creates a raw item, i.e. an item that must be handled
directly by the caller. A raw item is one that's not defined by the
store.Item enum, i.e. it is a custom, caller defined one.
The caller gets a URL back and is responsible for handling the item
directly from this URL.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This is basically a Store dispatcher, for storing items into their right
Store (either configuration or state).
There's very little logic here, except for finding out which store an
item belongs to in the virtcontainers context.
vc.go also provides virtcontainers specific utilities.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
When a component creates a new store from a given root path, we add it
to the store manager and return it back when another component asks for
it.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Each virtcontainers module/component should be able to get a handler on
a Store for loading component specific items. The Store manager is an
internal Store layer for tracking all created Stores.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Store is a replacement for the current resource storage virtcontainers
implementation and the Manager is the front-end for it. The back-ends
will provide actual storage capabilities and the first one will be the
filesystem one, for storing virtcontainers Items on a local filesystem.
The main design goals for Store are the following ones:
- Simplicity: The API should be short and simple.
- Transparency: The core virtcontainers code should not care about
the storage backend details.
- Extensibility: It should be easily extensible to add non local and in
memory backends.
Manger provides a very short and simple API for the rest of the virtcontainers
code base to consume:
New: Creates a new Store, if needed.
Load: Loads an Item from a Store
Store: Stores an Item into a Store.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>