[pve-devel] [PATCH 2/7] implement phase2_cleanup

Alexandre Derumier aderumier at odiso.com
Thu Aug 16 07:25:22 CEST 2012


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/QemuMigrate.pm |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
index 18b7fee..83bd9c9 100644
--- a/PVE/QemuMigrate.pm
+++ b/PVE/QemuMigrate.pm
@@ -369,6 +369,23 @@ sub phase2 {
     }
 }
 
+sub phase2_cleanup {
+    my ($self, $vmid, $err) = @_;
+
+    $self->log('info', "aborting phase 2 - cleanup resources");
+
+    my $conf = $self->{vmconf};
+    delete $conf->{lock};
+    eval { PVE::QemuServer::update_config_nolock($vmid, $conf, 1) };
+    if (my $err = $@) {
+        $self->log('err', $err);
+    }
+
+    ## fixme : vm_stop_cleanup on target vm
+
+
+}
+
 sub phase3 {
     my ($self, $vmid) = @_;
     
-- 
1.7.2.5




More information about the pve-devel mailing list