mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-29 12:14:48 +00:00
qemu: Fix virtio-net-pci QMP command
This patch fixes the wrong behavior of specifying a netdev, MAC address or PCI address entry when those were empty. Instead, it does not provide those entries if the content is empty. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
b1635d5dcb
commit
9c819db5a3
12
qemu/qmp.go
12
qemu/qmp.go
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user