GenServer representing a single active image on this node.
On start it resolves the image's layer chain, acquires each Layer.Server
(keeping the loop devices mounted), and assembles them into a single read-only
block device by stacking dm-snapshot targets (base at the bottom, each delta's
exception store layered on top). blk_path/1 returns that composed device.
Reference-counted via process monitors, like Layer.Server: holders acquire/1
it; when the last leaves it idle-reaps, removing its dm chain in terminate/2
and releasing its layers (which then unmount once nothing else holds them).
Summary
Functions
Take a reference on server on behalf of the calling process. The image stays
assembled until every holder releases (or dies). Idempotent per process.
The composed read-only block device path for the image managed by server.
Returns a specification to start this module under a supervisor.
The ordered layer ids that compose the image managed by server.
Drop the calling process's reference on server.
Start an image server for opts, registered by image id.
Functions
@spec acquire(GenServer.server()) :: :ok
Take a reference on server on behalf of the calling process. The image stays
assembled until every holder releases (or dies). Idempotent per process.
@spec blk_path(GenServer.server()) :: Path.t()
The composed read-only block device path for the image managed by server.
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec layers(GenServer.server()) :: [Hyper.Layer.id()]
The ordered layer ids that compose the image managed by server.
@spec release(GenServer.server()) :: :ok
Drop the calling process's reference on server.
@spec start_link(Hyper.Node.Img.Server.Opts.t()) :: GenServer.on_start()
Start an image server for opts, registered by image id.