mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-25 15:02:45 +00:00
qemu: use govmm vhost user device types directly
For one thing, we should not make kata's internal device type exactly as govmm string by string. For another thing, latest govmm changes the device driver strings and it breaks kata in such a way but the fault is on kata side IMHO. Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
parent
46392945c6
commit
171eb70564
@ -624,16 +624,19 @@ func (q *qemuArchBase) appendVhostUserDevice(devices []govmmQemu.Device, attr co
|
||||
case config.VhostUserNet:
|
||||
qemuVhostUserDevice.TypeDevID = utils.MakeNameID("net", attr.DevID, maxDevIDSize)
|
||||
qemuVhostUserDevice.Address = attr.MacAddress
|
||||
qemuVhostUserDevice.VhostUserType = govmmQemu.VhostUserNet
|
||||
case config.VhostUserSCSI:
|
||||
qemuVhostUserDevice.TypeDevID = utils.MakeNameID("scsi", attr.DevID, maxDevIDSize)
|
||||
qemuVhostUserDevice.VhostUserType = govmmQemu.VhostUserSCSI
|
||||
case config.VhostUserBlk:
|
||||
qemuVhostUserDevice.VhostUserType = govmmQemu.VhostUserBlk
|
||||
case config.VhostUserFS:
|
||||
qemuVhostUserDevice.TypeDevID = utils.MakeNameID("fs", attr.DevID, maxDevIDSize)
|
||||
qemuVhostUserDevice.Tag = attr.Tag
|
||||
qemuVhostUserDevice.CacheSize = attr.CacheSize
|
||||
qemuVhostUserDevice.VhostUserType = govmmQemu.VhostUserFS
|
||||
}
|
||||
|
||||
qemuVhostUserDevice.VhostUserType = govmmQemu.DeviceDriver(attr.Type)
|
||||
qemuVhostUserDevice.SocketPath = attr.SocketPath
|
||||
qemuVhostUserDevice.CharDevID = utils.MakeNameID("char", attr.DevID, maxDevIDSize)
|
||||
|
||||
|
@ -427,7 +427,7 @@ func TestQemuArchBaseAppendVhostUserDevice(t *testing.T) {
|
||||
CharDevID: fmt.Sprintf("char-%s", id),
|
||||
TypeDevID: fmt.Sprintf("net-%s", id),
|
||||
Address: macAddress,
|
||||
VhostUserType: config.VhostUserNet,
|
||||
VhostUserType: govmmQemu.VhostUserNet,
|
||||
},
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user