mirror of
				https://github.com/kata-containers/kata-containers.git
				synced 2025-10-31 09:26:52 +00:00 
			
		
		
		
	clh: Direct IO support for block devices
Clh suports direct i/o for disks. It doesn't offer any support for noflush, removed passing of option to cloud-hypervisor internal config Fixes: #7798 Signed-off-by: Alexandru Matei <alexandru.matei@uipath.com>
This commit is contained in:
		| @@ -176,6 +176,15 @@ virtio_fs_cache = "@DEFVIRTIOFSCACHE@" | |||||||
| # rootfs is backed by a block device. This is virtio-blk. | # rootfs is backed by a block device. This is virtio-blk. | ||||||
| block_device_driver = "virtio-blk" | block_device_driver = "virtio-blk" | ||||||
|  |  | ||||||
|  | # Specifies cache-related options will be set to block devices or not. | ||||||
|  | # Default false | ||||||
|  | #block_device_cache_set = true | ||||||
|  |  | ||||||
|  | # Specifies cache-related options for block devices. | ||||||
|  | # Denotes whether use of O_DIRECT (bypass the host page cache) is enabled. | ||||||
|  | # Default false | ||||||
|  | #block_device_cache_direct = true | ||||||
|  |  | ||||||
| # Enable huge pages for VM RAM, default false | # Enable huge pages for VM RAM, default false | ||||||
| # Enabling this will result in the VM memory | # Enabling this will result in the VM memory | ||||||
| # being allocated using huge pages. | # being allocated using huge pages. | ||||||
|   | |||||||
| @@ -1082,7 +1082,6 @@ func newClhHypervisorConfig(h hypervisor) (vc.HypervisorConfig, error) { | |||||||
| 		BlockDeviceDriver:              blockDriver, | 		BlockDeviceDriver:              blockDriver, | ||||||
| 		BlockDeviceCacheSet:            h.BlockDeviceCacheSet, | 		BlockDeviceCacheSet:            h.BlockDeviceCacheSet, | ||||||
| 		BlockDeviceCacheDirect:         h.BlockDeviceCacheDirect, | 		BlockDeviceCacheDirect:         h.BlockDeviceCacheDirect, | ||||||
| 		BlockDeviceCacheNoflush:        h.BlockDeviceCacheNoflush, |  | ||||||
| 		EnableIOThreads:                h.EnableIOThreads, | 		EnableIOThreads:                h.EnableIOThreads, | ||||||
| 		Msize9p:                        h.msize9p(), | 		Msize9p:                        h.msize9p(), | ||||||
| 		ColdPlugVFIO:                   h.coldPlugVFIO(), | 		ColdPlugVFIO:                   h.coldPlugVFIO(), | ||||||
|   | |||||||
| @@ -851,6 +851,9 @@ func (clh *cloudHypervisor) hotplugAddBlockDevice(drive *config.BlockDrive) erro | |||||||
| 	clhDisk := *chclient.NewDiskConfig(drive.File) | 	clhDisk := *chclient.NewDiskConfig(drive.File) | ||||||
| 	clhDisk.Readonly = &drive.ReadOnly | 	clhDisk.Readonly = &drive.ReadOnly | ||||||
| 	clhDisk.VhostUser = func(b bool) *bool { return &b }(false) | 	clhDisk.VhostUser = func(b bool) *bool { return &b }(false) | ||||||
|  | 	if clh.config.BlockDeviceCacheSet { | ||||||
|  | 		clhDisk.Direct = &clh.config.BlockDeviceCacheDirect | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	queues := int32(clh.config.NumVCPUs) | 	queues := int32(clh.config.NumVCPUs) | ||||||
| 	queueSize := int32(1024) | 	queueSize := int32(1024) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user