From 956af4f8a9019a5bf1b4781b9a481806b18a14a1 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Mon, 12 Dec 2022 10:51:01 +0100 Subject: [PATCH] M #-: Reset VM backups if the current active backup image is deleted --- src/image/ImageManagerProtocol.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/image/ImageManagerProtocol.cc b/src/image/ImageManagerProtocol.cc index 0ccdf8588f..31ad196acd 100644 --- a/src/image/ImageManagerProtocol.cc +++ b/src/image/ImageManagerProtocol.cc @@ -524,6 +524,14 @@ void ImageManager::_rm(unique_ptr msg) { vm->backups().del(img_id); + //Reset increment pointers when removing active backup + if (stoi(vm->backups().last_backup_id()) == img_id) + { + vm->backups().last_increment_id(-1); + + vm->backups().incremental_backup_id(-1); + } + vmpool->update(vm.get()); }