Merge pull request #59 from sboeuf/fix_virtio-net-pci

qemu: Fix virtio-net-pci QMP command
This commit is contained in:
Sebastien Boeuf 2018-10-16 14:14:23 -07:00 committed by GitHub
commit e82e8498c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -912,15 +912,21 @@ func (q *QMP) ExecuteNetPCIDeviceAdd(ctx context.Context, netdevID, devID, macAd
args := map[string]interface{}{
"id": devID,
"driver": VirtioNetPCI,
"netdev": netdevID,
"mac": macAddr,
"addr": addr,
"romfile": romfile,
}
if bus != "" {
args["bus"] = bus
}
if addr != "" {
args["addr"] = addr
}
if macAddr != "" {
args["mac"] = macAddr
}
if netdevID != "" {
args["netdev"] = netdevID
}
if queues > 0 {
// (2N+2 vectors, N for tx queues, N for rx queues, 1 for config, and one for possible control vq)