Revision c309d05f

b/lib/hypervisor/hv_kvm/monitor.py
195 195
  _ERROR_DESC_KEY = "desc"
196 196
  _EXECUTE_KEY = "execute"
197 197
  _ARGUMENTS_KEY = "arguments"
198
  _VERSION_KEY = "version"
199
  _PACKAGE_KEY = "package"
200
  _QEMU_KEY = "qemu"
198 201
  _CAPABILITIES_COMMAND = "qmp_capabilities"
199 202
  _QUERY_COMMANDS = "query-commands"
200 203
  _MESSAGE_END_TOKEN = "\r\n"
......
223 226
      raise errors.HypervisorError("kvm: QMP communication error (wrong"
224 227
                                   " server greeting")
225 228

  
229
    # Extract the version info from the greeting and make it available to users
230
    # of the monitor.
231
    version_info = greeting[self._FIRST_MESSAGE_KEY][self._VERSION_KEY]
232

  
233
    self.version = (version_info[self._QEMU_KEY]["major"],
234
                    version_info[self._QEMU_KEY]["minor"],
235
                    version_info[self._QEMU_KEY]["micro"])
236
    self.package = version_info[self._PACKAGE_KEY].strip()
237

  
226 238
    # This is needed because QMP can return more than one greetings
227 239
    # see https://groups.google.com/d/msg/ganeti-devel/gZYcvHKDooU/SnukC8dgS5AJ
228 240
    self._buf = ""

Also available in: Unified diff