Milan Zamazal has uploaded a new change for review.

Change subject: virt: Stop guest agent before switching to post-copy
......................................................................

virt: Stop guest agent before switching to post-copy

Post-copy migration pauses the VM on the source.  We don't want to get
spurious log messages from the guest agent about not being able to talk
to the VM or being disconnected from the communication socket.  So we
stop the guest agent before switching to post-copy mode.

If switching to post-copy fails (which should rarely happen), we start
the agent again.  Starting the agent may fail, e.g. in case the VM got
destroyed in the meantime.  So we catch the contingent exception.

Change-Id: Ibd855ee36847b293009ac35d8d03b01521aaace8
Signed-off-by: Milan Zamazal <mzama...@redhat.com>
Bug-Url: https://bugzilla.redhat.com/1354343
---
M vdsm/virt/migration.py
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/45/64145/7

diff --git a/vdsm/virt/migration.py b/vdsm/virt/migration.py
index 2c73375..522a4fc 100644
--- a/vdsm/virt/migration.py
+++ b/vdsm/virt/migration.py
@@ -807,6 +807,7 @@
             vm._dom.migrateSetMaxDowntime(downtime, 0)
         elif action == CONVERGENCE_SCHEDULE_POST_COPY:
             vm.log.info('Switching to post-copy migration')
+            vm.guestAgent.stop()
             ret = vm.switch_migration_to_post_copy()
             if ret >= 0:
                 self._post_copy_initiated = True
@@ -814,6 +815,12 @@
                 # Do nothing for now; the next action will be invoked after
                 # a while
                 vm.log.warn('Failed to switch to post-copy migration')
+                try:
+                    vm.guestAgent.start()
+                except:
+                    self.log.exception("Failed to start guest agent after "
+                                       "unsuccessful switch to post-copy "
+                                       "migration")
         elif action == CONVERGENCE_SCHEDULE_SET_ABORT:
             vm.log.warn('Aborting migration')
             vm._dom.abortJob()


-- 
To view, visit https://gerrit.ovirt.org/64145
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibd855ee36847b293009ac35d8d03b01521aaace8
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Milan Zamazal <mzama...@redhat.com>
Gerrit-Reviewer: Francesco Romani <from...@redhat.com>
Gerrit-Reviewer: Milan Zamazal <mzama...@redhat.com>
Gerrit-Reviewer: gerrit-hooks <automat...@ovirt.org>
_______________________________________________
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org

Reply via email to