libvirtxml中的Interface结构体中哪个是网卡类型的属性请用golang给个示例Interface结构体中现在没有Model字段了是为啥那是哪个字段属性
Interface结构体中的type属性是网卡类型的属性。以下是一个示例:
import (
"github.com/libvirt/libvirt-go-xml"
)
func main() {
iface := &libvirtxml.Interface{
Type: "ethernet",
// other fields omitted for brevity
}
// use iface in your code
}
关于Model字段,根据libvirt的官方文档,该字段已经被废弃,因为它只适用于旧版的QEMU。现在可以使用driver字段来指定网卡的模型。
原文地址: https://www.cveoy.top/t/topic/hpcY 著作权归作者所有。请勿转载和采集!