Skip to content
Snippets Groups Projects
Commit ddb77017 authored by Thibault VINCENT's avatar Thibault VINCENT
Browse files

fix: reporting wrong memory amount for xen host

parent 49ae4517
No related branches found
No related tags found
No related merge requests found
# -*- coding: utf-8 -*-
from libvirtwrapper import LibvirtHypervisor
from libvirtwrapper import LibvirtHypervisor, MEGABYTE_DIV
class XenHypervisor(LibvirtHypervisor):
......@@ -30,13 +30,11 @@ class XenHypervisor(LibvirtHypervisor):
def get_mem(self):
'''
'''
# real machine memory is the max allocatable size of the Dom0
mem = None
try:
dom0 = self._lvcon_handle.lookupByID(0)
data = dom0.info()[1]
data = self._lvcon_handle.getInfo()[1]
if data:
mem = data
mem = data * MEGABYTE_DIV
except:
pass
return mem
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment