我目前正在尝试获取mac地址,但我有点困惑 . 当我尝试
import libvirt # To connect to the hypervisor
# Connect to your local hypervisor. See https://libvirt.org/uri.html
conn = libvirt.open('qemu+ssh://%s/system' % servidor.ubicacion_ip) # Open the hypervisor in read-only mode
# conn = libvirt.open(None) # Open the default hypervisor in read-write mode (require
if conn == None:
raise Exception('Failed to open connection to the hypervisor')
dom = conn.lookupByName('userid_%s_servidor_%s.qcow2' % (user.id, servidor.id))
但当我检查客人python api commands in libvirt但c api commands似乎表明它应该有办法获得mac地址?
1 回答
好的,所以我找到了一种方法,使用libvirt输出的xml解析 .