libvirt_utils.py 文件源码

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

项目:daisy 作者: opnfv 项目源码 文件源码
def create_virtual_network(template):
    LI('Begin to create virtual network %s' % template)
    output = commands.getoutput('cat %s' % template)
    conn = libvirt.open('qemu:///system')
    network = conn.networkDefineXML(output)
    if network is None:
        err_exit('Failed to define a virtual network %s' % template)

    network.create()  # set the network active
    network.setAutostart(1)
    conn.close()
    LI('Virtual network %s is created' % network.name())
    return network.name()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号