mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-10 05:08:54 +00:00
Merge pull request #34 from devimc/topic/addrBusVsock
qemu/qmp: add addr and bus to hotplug vsock devices
This commit is contained in:
@@ -956,12 +956,17 @@ func (q *QMP) ExecHotplugMemory(ctx context.Context, qomtype, id, mempath string
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ExecutePCIVSockAdd adds a vhost-vsock-pci bus
|
// ExecutePCIVSockAdd adds a vhost-vsock-pci bus
|
||||||
func (q *QMP) ExecutePCIVSockAdd(ctx context.Context, id, guestCID, vhostfd string, disableModern bool) error {
|
func (q *QMP) ExecutePCIVSockAdd(ctx context.Context, id, guestCID, vhostfd, addr, bus string, disableModern bool) error {
|
||||||
args := map[string]interface{}{
|
args := map[string]interface{}{
|
||||||
"driver": VHostVSockPCI,
|
"driver": VHostVSockPCI,
|
||||||
"id": id,
|
"id": id,
|
||||||
"guest-cid": guestCID,
|
"guest-cid": guestCID,
|
||||||
"vhostfd": vhostfd,
|
"vhostfd": vhostfd,
|
||||||
|
"addr": addr,
|
||||||
|
}
|
||||||
|
|
||||||
|
if bus != "" {
|
||||||
|
args["bus"] = bus
|
||||||
}
|
}
|
||||||
|
|
||||||
if disableModern {
|
if disableModern {
|
||||||
|
@@ -1038,7 +1038,7 @@ func TestExecutePCIVSockAdd(t *testing.T) {
|
|||||||
cfg := QMPConfig{Logger: qmpTestLogger{}}
|
cfg := QMPConfig{Logger: qmpTestLogger{}}
|
||||||
q := startQMPLoop(buf, cfg, connectedCh, disconnectedCh)
|
q := startQMPLoop(buf, cfg, connectedCh, disconnectedCh)
|
||||||
checkVersion(t, connectedCh)
|
checkVersion(t, connectedCh)
|
||||||
err := q.ExecutePCIVSockAdd(context.Background(), "vsock-pci0", "3", "1", true)
|
err := q.ExecutePCIVSockAdd(context.Background(), "vsock-pci0", "3", "1", "1", "1", true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Unexpected error %v", err)
|
t.Fatalf("Unexpected error %v", err)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user