Change in vdsm[master]: virt: Pass effective guest agent API version during migration

vfeenstr at redhat.com vfeenstr at redhat.com
Mon Feb 15 12:35:31 UTC 2016


Vinzenz Feenstra has uploaded a new change for review.

Change subject: virt: Pass effective guest agent API version during migration
......................................................................

virt: Pass effective guest agent API version during migration

Currently we're not passing the effective guest agent API version
during migrations, since VDSM and the guest agent can negotiate this
version.

For the feature of lifecycle events for the guest it is needed that
VDSM already knows the negotiated API version right from the moment
of the migration completion so we can notify the guest about the
completion of the migration.
This will save VDSM from having to re-negotiate the API version,
and allow us to send the guest agent the required information right
away.

Change-Id: I0e8625ad33f62852baa17cad377ab12065a52dec
Bug-Url: https://bugzilla.redhat.com/1298120
Signed-off-by: Vinzenz Feenstra <vfeenstr at redhat.com>
---
M vdsm/virt/guestagent.py
M vdsm/virt/migration.py
M vdsm/virt/vm.py
3 files changed, 6 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/23/53523/1

diff --git a/vdsm/virt/guestagent.py b/vdsm/virt/guestagent.py
index 6066e30..922daec 100644
--- a/vdsm/virt/guestagent.py
+++ b/vdsm/virt/guestagent.py
@@ -116,8 +116,8 @@
     MAX_MESSAGE_SIZE = 2 ** 20  # 1 MiB for now
 
     def __init__(self, socketName, channelListener, log, onStatusChange,
-                 user='Unknown', ips=''):
-        self.effectiveApiVersion = _IMPLICIT_API_VERSION_ZERO
+                 use_api_version=None, user='Unknown', ips=''):
+        self.effectiveApiVersion = use_api_version or _IMPLICIT_API_VERSION_ZERO
         self._onStatusChange = onStatusChange
         self.log = log
         self._socketName = socketName
diff --git a/vdsm/virt/migration.py b/vdsm/virt/migration.py
index 7947f75..9ca5975 100644
--- a/vdsm/virt/migration.py
+++ b/vdsm/virt/migration.py
@@ -184,6 +184,8 @@
             self._machineParams['guestIPs'] = vmStats['guestIPs']
         if 'guestFQDN' in vmStats:
             self._machineParams['guestFQDN'] = vmStats['guestFQDN']
+        self._machineParams['guestAgentAPIVersion'] = \
+            self._vm.guestAgent.effectiveApiVersion
         for k in ('_migrationParams', 'pid'):
             if k in self._machineParams:
                 del self._machineParams[k]
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 0839006..8e71f15 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -287,7 +287,8 @@
             vmchannels.QEMU_GA_DEVICE_NAME)
         self.guestAgent = guestagent.GuestAgent(
             self._guestSocketFile, self.cif.channelListener, self.log,
-            self._onGuestStatusChange)
+            self._onGuestStatusChange,
+            self.conf.pop('guestAgentAPIVersion', None))
         self._domain = DomainDescriptor.from_id(self.id)
         self._released = False
         self._releaseLock = threading.Lock()


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0e8625ad33f62852baa17cad377ab12065a52dec
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr at redhat.com>


More information about the vdsm-patches mailing list