Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[snapshots] Implement QEMU-specific part of snapshot deletion #3134

Merged
merged 1 commit into from
Jun 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/platform/backends/qemu/qemu_snapshot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ std::unique_ptr<mp::QemuImgProcessSpec> make_restore_spec(const QString& tag, co
/* src_img = */ "", image_path);
}

std::unique_ptr<mp::QemuImgProcessSpec> make_delete_spec(const QString& tag, const QString& image_path)
{
return std::make_unique<mp::QemuImgProcessSpec>(QStringList{"snapshot", "-d", tag, image_path},
/* src_img = */ "", image_path);
}

void checked_exec_qemu_img(std::unique_ptr<mp::QemuImgProcessSpec> spec)
{
auto process = mpp::make_process(std::move(spec));
Expand Down Expand Up @@ -81,9 +87,9 @@ void mp::QemuSnapshot::capture_impl()
checked_exec_qemu_img(make_capture_spec(tag, image_path));
}

void mp::QemuSnapshot::erase_impl() // TODO@snapshots
void mp::QemuSnapshot::erase_impl()
{
throw NotImplementedOnThisBackendException{"Snapshot erasing"};
checked_exec_qemu_img(make_delete_spec(derive_tag(), image_path));
}

void mp::QemuSnapshot::apply_impl()
Expand Down