

def set_memory(self, name, size):
    (dom, host) = self.get_active_domain(x)
    if (not dom):
        dom = self.get_inactive_domain(name)
        host = dom['host']
    for x in self.hosts:
        if (host == x['name']):
            conn = x['conn']
    dom = conn.lookupByName(name)
    desc = fromstring(dom.XMLDesc(libvirt.VIR_DOMAIN_XML_SECURE))
    desc.find('.//memory').text = str(size)
    desc.find('.//currentMemory').text = str(size)
    conn.defineXML(tostring(desc))
    if dom.isActive():
        dom.setMemory(int(size))
    return True

dataset/ETHPy150Open mizzy/maglica/maglica/virt.py Virt.set_memory/VarMisuse@24/28 `name`->`x`