Commit ddb77017 authored by Thibault VINCENT's avatar Thibault VINCENT
Browse files

fix: reporting wrong memory amount for xen host

parent 49ae4517
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
# -*- 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