Dan Kenigsberg has submitted this change and it was merged.

Change subject: Fix exception in _getUserCpuTuneInfo and _getCpuCount
......................................................................


Fix exception in _getUserCpuTuneInfo and _getCpuCount

If the cpu tune metadata is not present in a VM's domain xml then
_getUserCpuTuneInfo will fail with the following exception:

Traceback (most recent call last):
  File "/usr/share/vdsm/virt/vm.py", line 2846, in _getRunningVmStats
    decStats = self._vmStats.get()
  File "/usr/share/vdsm/virt/vm.py", line 571, in get
    self._getUserCpuTuneInfo(stats)
  File "/usr/share/vdsm/virt/vm.py", line 421, in _getUserCpuTuneInfo
    if eInfo['vcpuLimit']:
KeyError: 'vcpuLimit'

This aborts the rest of VM stats collection and causes lots of problems
for other flows which depend on VM stats (such as Live Merge).

The same applies to _getCpuCount where the value can be empty in case
libvirt has issuess accessing the cgroup controllers (currently this
happens on Fedora 20).

Fixed by fist checking the availability of the key.

Change-Id: Ifd5fa19f7985adab6959d6011d1eaf467454d925
Signed-off-by: Adam Litke <[email protected]>
Reviewed-on: http://gerrit.ovirt.org/28966
Tested-by: Martin Sivák <[email protected]>
Reviewed-by: Francesco Romani <[email protected]>
Reviewed-by: Dan Kenigsberg <[email protected]>
---
M vdsm/virt/vm.py
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Martin Sivák: Verified
  Dan Kenigsberg: Looks good to me, approved
  Francesco Romani: Looks good to me, but someone else must approve



-- 
To view, visit http://gerrit.ovirt.org/28966
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifd5fa19f7985adab6959d6011d1eaf467454d925
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <[email protected]>
Gerrit-Reviewer: Adam Litke <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Francesco Romani <[email protected]>
Gerrit-Reviewer: Kobi Ianko <[email protected]>
Gerrit-Reviewer: Martin Sivák <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to