mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-29 04:04:45 +00:00
hotplugAddBlockDevice: Use ExecuteBlockdevAddWithDriverCache with swap
Use ExecuteBlockdevAddWithDriverCache with swap in hotplugAddBlockDevice to handle swap file cannot work OK with ExecuteBlockdevAddWithCache issue. Fixes: #2548 Signed-off-by: Hui Zhu <teawater@antfin.com>
This commit is contained in:
parent
bd85da0461
commit
bcc9fa3b35
@ -1230,7 +1230,7 @@ func (q *qemu) hotplugAddBlockDevice(ctx context.Context, drive *config.BlockDri
|
||||
}
|
||||
|
||||
if drive.Swap {
|
||||
err = q.qmpMonitorCh.qmp.ExecuteBlockdevAddWithCache(q.qmpMonitorCh.ctx, drive.File, drive.ID, false, false, false)
|
||||
err = q.qmpMonitorCh.qmp.ExecuteBlockdevAddWithDriverCache(q.qmpMonitorCh.ctx, "file", drive.File, drive.ID, false, false, false)
|
||||
} else if q.config.BlockDeviceCacheSet {
|
||||
err = q.qmpMonitorCh.qmp.ExecuteBlockdevAddWithCache(q.qmpMonitorCh.ctx, drive.File, drive.ID, q.config.BlockDeviceCacheDirect, q.config.BlockDeviceCacheNoflush, drive.ReadOnly)
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user