mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-15 22:53:43 +00:00
runtime: qemu: Add Independent IOThread support for virtio-blk
Make hotplug virtio-blk device attach to Independent IOThread 0 as default when enabled the EnableIOThreads and IndepIOThreads. Signed-off-by: zhangchen.kidd <zhangchen.kidd@jd.com>
This commit is contained in:
parent
1d273895b8
commit
6e677794ed
@ -1744,7 +1744,13 @@ func (q *qemu) hotplugAddBlockDevice(ctx context.Context, drive *config.BlockDri
|
|||||||
|
|
||||||
queues := int(q.config.NumVCPUs())
|
queues := int(q.config.NumVCPUs())
|
||||||
|
|
||||||
if err = q.qmpMonitorCh.qmp.ExecutePCIDeviceAdd(q.qmpMonitorCh.ctx, drive.ID, devID, driver, addr, bridge.ID, romFile, queues, true, defaultDisableModern, ""); err != nil {
|
// Make Independent IOThread 0 as the virtio-blk default.
|
||||||
|
var iothreadID string
|
||||||
|
if q.config.EnableIOThreads && q.config.IndepIOThreads > 0 {
|
||||||
|
iothreadID = fmt.Sprintf("%s_%d", indepIOThreadsPrefix, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err = q.qmpMonitorCh.qmp.ExecutePCIDeviceAdd(q.qmpMonitorCh.ctx, drive.ID, devID, driver, addr, bridge.ID, romFile, queues, true, defaultDisableModern, iothreadID); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
case q.config.BlockDeviceDriver == config.VirtioBlockCCW:
|
case q.config.BlockDeviceDriver == config.VirtioBlockCCW:
|
||||||
|
Loading…
Reference in New Issue
Block a user