Commit 8b380d45 authored by Thibault VINCENT's avatar Thibault VINCENT
Browse files

fix: xen domains memory was wrong

parent b543374b
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -26,3 +26,27 @@ class XenHypervisor(LibvirtHypervisor):
            cls._instance = super(XenHypervisor, cls).__new__(cls, *args,
                                                                    **kwargs)
        return cls._instance
    
    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]
            if data:
                mem = data
        except:
            pass
        return mem
    
    def get_mem_free(self):
        '''
        '''
        return None
    
    def get_mem_used(self):
        '''
        '''
        return None