[libvirt] [RFC] Unify KVM kernel-space and user-space code into a single project

Antoine Martin antoine at nagafix.co.uk
Fri Apr 9 19:52:04 UTC 2010

>> I was thinking of something like:
>> domain.get_attribute("vncdisplay")
>> Because it's a shame to have to use virsh as a wrapper (or XML file
>> parsing) and re-do all the work that was done to get to the domain
>> object when all your really want is just an attribute..
> You can already do that very simply in python using lxml
>    from lxml import etree
>    tree = etree.parse(domain.XMLDesc())
>    r = tree.xpath('/domain/devices/graphics[@type='vnc']/@port')
Hmmm, cant seem to get that to work:
libvirt_server_util.py", line 159, in detect_session_vncdisplay
    tree = etree.parse(domain.XMLDesc(0))
File "lxml.etree.pyx", line 2692, in lxml.etree.parse
File "parser.pxi", line 1500, in lxml.etree._parseDocument
File "parser.pxi", line 1529, in lxml.etree._parseDocumentFromURL
File "parser.pxi", line 1429, in lxml.etree._parseDocFromFile
File "parser.pxi", line 975, in lxml.etree._BaseParser._parseDocFromFile
File "parser.pxi", line 539, in
File "parser.pxi", line 625, in lxml.etree._handleParseResult
File "parser.pxi", line 563, in lxml.etree._raiseParseError
IOError: Error reading file '<domain type='qemu' id='1'>


': failed to load external entity "<domain type='qemu' id='1'>



More information about the libvir-list mailing list