import_libvirt.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:nitro 作者: KVM-VMI 项目源码 文件源码
def prepare_domain_xml(domain_name, qemu_bin_path, nitro_image_path, open_vnc):
    with open('template_domain.xml') as templ:
        domain_xml = templ.read()
        domain_xml = domain_xml.format(domain_name, qemu_bin_path,
                                       nitro_image_path)
        root = tree.fromstring(domain_xml)
        if open_vnc:
            # search for graphics element
            graphics_elem = root.findall("./devices/graphics")[0]
            graphics_elem.attrib['listen'] = '0.0.0.0'
        domain_xml = tree.tostring(root).decode()
        return domain_xml
    return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号