Example #1
0
    def getDevices(self, renew = False):
        if self.devices and not renew: return self.devices

        if self._model and not renew:
            self.devices = self._model.getDevices()
        else:
            con = self.getConnection()
            xml = self.getXML()
            model, self.devices = parse.parseDomainXML(xml)
        #endif

        return self.devices
Example #2
0
    def getModel(self, renew = False):
        if self._model and not renew: return self._model

        con = self.getConnection()
        xml = self.getXML()

        self._model, self.devices = parse.parseDomainXML(xml)

        # XEN in dumpxml gives bad data about memory for Domain-0
        # so set max memory to host memory
        if con.ID() == 0 and self._model.hypervisor_type == "xen":
            node = self.getNode()
            info = node.getInfo()
            self._model.memory = info["memory"] * 1024
        #endif

        return self._model