From 1dd04f288f04f1c7ae01d06b957f979d533e799e Mon Sep 17 00:00:00 2001 From: Ricardo Abreu Date: Wed, 6 Sep 2023 18:20:24 +0100 Subject: [PATCH] Revert "[daemon] Extract repeated argument derivation" This reverts commit f570fd99315a80a1a503ab07cd8cbde86c45e710, since one snapshot overview needs to be added per snapshot. --- src/daemon/daemon.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/daemon/daemon.cpp b/src/daemon/daemon.cpp index 9cdbf1de45..2b8e1cc92f 100644 --- a/src/daemon/daemon.cpp +++ b/src/daemon/daemon.cpp @@ -1746,7 +1746,6 @@ try // clang-format on const auto& it = instance_snapshots_map.find(name); const auto& [pick, all_or_none] = it == instance_snapshots_map.end() ? SnapshotPick{{}, true} : it->second; - auto overview = response.mutable_snapshot_overview()->add_overview(); try { @@ -1756,12 +1755,13 @@ try // clang-format on vm.get_snapshot(snapshot); // verify validity of any snapshot name requested separately for (const auto& snapshot : vm.view_snapshots()) - populate_snapshot_overview(name, snapshot, overview); + populate_snapshot_overview(name, snapshot, response.mutable_snapshot_overview()->add_overview()); } else { for (const auto& snapshot : pick) - populate_snapshot_overview(name, vm.get_snapshot(snapshot), overview); + populate_snapshot_overview(name, vm.get_snapshot(snapshot), + response.mutable_snapshot_overview()->add_overview()); } } catch (const NoSuchSnapshot& e)