mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-10 21:29:01 +00:00
clh: vsock: Supply the right VsockConfig to Vmconfig
With the new HTTP API from CLH, it removes the support of multiple virtio-vsock devices, as the Linux kernel does not support it. Signed-off-by: Bo Chen <chen.bo@intel.com> Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
@@ -1076,7 +1076,7 @@ func (clh *cloudHypervisor) addVSock(cid int64, path string) {
|
|||||||
"cid": cid,
|
"cid": cid,
|
||||||
}).Info("Adding HybridVSock")
|
}).Info("Adding HybridVSock")
|
||||||
|
|
||||||
clh.vmconfig.Vsock = append(clh.vmconfig.Vsock, chclient.VsockConfig{Cid: cid, Sock: path})
|
clh.vmconfig.Vsock = chclient.VsockConfig{Cid: cid, Sock: path}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (clh *cloudHypervisor) addNet(e Endpoint) error {
|
func (clh *cloudHypervisor) addNet(e Endpoint) error {
|
||||||
|
@@ -103,12 +103,8 @@ func TestCloudHypervisorAddVSock(t *testing.T) {
|
|||||||
clh := cloudHypervisor{}
|
clh := cloudHypervisor{}
|
||||||
|
|
||||||
clh.addVSock(1, "path")
|
clh.addVSock(1, "path")
|
||||||
assert.Equal(clh.vmconfig.Vsock[0].Cid, int64(1))
|
assert.Equal(clh.vmconfig.Vsock.Cid, int64(1))
|
||||||
assert.Equal(clh.vmconfig.Vsock[0].Sock, "path")
|
assert.Equal(clh.vmconfig.Vsock.Sock, "path")
|
||||||
|
|
||||||
clh.addVSock(2, "path2")
|
|
||||||
assert.Equal(clh.vmconfig.Vsock[1].Cid, int64(2))
|
|
||||||
assert.Equal(clh.vmconfig.Vsock[1].Sock, "path2")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check addNet appends to the network config list new configurations.
|
// Check addNet appends to the network config list new configurations.
|
||||||
|
Reference in New Issue
Block a user