@@ -512,7 +512,7 @@ pub unsafe extern "C" fn krun_add_disk(
512
512
let cfg = ctx_cfg. get_mut ( ) ;
513
513
let block_device_config = BlockDeviceConfig {
514
514
block_id : block_id. to_string ( ) ,
515
- cache_type : CacheType :: Writeback ,
515
+ cache_type : CacheType :: auto ( disk_path ) ,
516
516
disk_image_path : disk_path. to_string ( ) ,
517
517
disk_image_format : ImageType :: Raw ,
518
518
is_disk_read_only : read_only,
@@ -559,7 +559,7 @@ pub unsafe extern "C" fn krun_add_disk2(
559
559
let cfg = ctx_cfg. get_mut ( ) ;
560
560
let block_device_config = BlockDeviceConfig {
561
561
block_id : block_id. to_string ( ) ,
562
- cache_type : CacheType :: Writeback ,
562
+ cache_type : CacheType :: auto ( disk_path ) ,
563
563
disk_image_path : disk_path. to_string ( ) ,
564
564
disk_image_format : format,
565
565
is_disk_read_only : read_only,
@@ -586,7 +586,7 @@ pub unsafe extern "C" fn krun_set_root_disk(ctx_id: u32, c_disk_path: *const c_c
586
586
let cfg = ctx_cfg. get_mut ( ) ;
587
587
let block_device_config = BlockDeviceConfig {
588
588
block_id : "root" . to_string ( ) ,
589
- cache_type : CacheType :: Writeback ,
589
+ cache_type : CacheType :: auto ( disk_path ) ,
590
590
disk_image_path : disk_path. to_string ( ) ,
591
591
disk_image_format : ImageType :: Raw ,
592
592
is_disk_read_only : false ,
@@ -613,7 +613,7 @@ pub unsafe extern "C" fn krun_set_data_disk(ctx_id: u32, c_disk_path: *const c_c
613
613
let cfg = ctx_cfg. get_mut ( ) ;
614
614
let block_device_config = BlockDeviceConfig {
615
615
block_id : "data" . to_string ( ) ,
616
- cache_type : CacheType :: Writeback ,
616
+ cache_type : CacheType :: auto ( disk_path ) ,
617
617
disk_image_path : disk_path. to_string ( ) ,
618
618
disk_image_format : ImageType :: Raw ,
619
619
is_disk_read_only : false ,
0 commit comments