Conversation
This commit introduces a live snapshot feature for overlaybd with the following key capabilities: - Add HTTP API server (/snapshot endpoint) for creating snapshots on demand - Implement create_snapshot() to dynamically restack RW layers - Add device ID tracking system for image file management - Support config_path;dev_id format in configuration strings - Extend LSMT layer management with restack(), index manipulation, and file operations - Add comprehensive tests for restacking, device registration, and snapshot creation Co-authored-by: Xun Chen <xunchen@hust.edu.cn> Co-authored-by: Yifan Yuan <tuji.yyf@alibaba-inc.com> Signed-off-by: Yifan Yuan <tuji.yyf@alibaba-inc.com>
Add documentation for the live snapshot feature including: - serviceConfig configuration options - Device ID format and usage - HTTP API endpoint (/snapshot) - New config format requirements - Usage examples and notes Signed-off-by: Yifan Yuan <tuji.yyf@alibaba-inc.com>
Member Author
| @WaberZhuang @liulanzheng PTAL |
WaberZhuang suggested changes Feb 10, 2026
src/api_server.cpp Outdated
| auto pos = target.find('?'); | ||
| if (pos != std::string_view::npos) { | ||
| query = target.substr(pos + 1); | ||
| } |
Contributor
There was a problem hiding this comment.
Use req.query() instead.
There was a problem hiding this comment.
req.query()returns empty。。。I don't know why so I choose req.target()
Contributor
There was a problem hiding this comment.
Never mind, the Request received by the server does indeed have this issue. Use req.target() is ok.
src/image_file.cpp Outdated
| } | ||
| | ||
| auto upper = new_cfg.upper(); | ||
| auto lowers = new_cfg.lowers(); |
liulanzheng reviewed Feb 11, 2026
src/overlaybd/lsmt/index.cpp Outdated
| virtual int front_index(const IMemoryIndex0 *fi) override { | ||
| if (!fi) { | ||
| errno = EINVAL; | ||
| LOG_ERROR("Invalid index!"); |
liulanzheng reviewed Feb 11, 2026
| } | ||
| if (m_ownership && m_index0 != nullptr) { // !!! | ||
| delete m_index0; | ||
| m_index0 = nullptr; |
…after creating snapshot per review Signed-off-by: Xun Chen <xunchen@hust.edu.cn>
refactor: move ApiServer&ApiHandler to cpp file and overwrite config …
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Add online snapshot functionality to overlaybd.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes #
Please check the following list: