@@ -509,7 +509,7 @@ pub unsafe extern "C" fn krun_add_disk(
509
509
let cfg = ctx_cfg. get_mut ( ) ;
510
510
let block_device_config = BlockDeviceConfig {
511
511
block_id : block_id. to_string ( ) ,
512
- cache_type : CacheType :: Writeback ,
512
+ cache_type : CacheType :: auto ( disk_path ) ,
513
513
disk_image_path : disk_path. to_string ( ) ,
514
514
disk_image_format : ImageType :: Raw ,
515
515
is_disk_read_only : read_only,
@@ -556,7 +556,7 @@ pub unsafe extern "C" fn krun_add_disk2(
556
556
let cfg = ctx_cfg. get_mut ( ) ;
557
557
let block_device_config = BlockDeviceConfig {
558
558
block_id : block_id. to_string ( ) ,
559
- cache_type : CacheType :: Writeback ,
559
+ cache_type : CacheType :: auto ( disk_path ) ,
560
560
disk_image_path : disk_path. to_string ( ) ,
561
561
disk_image_format : format,
562
562
is_disk_read_only : read_only,
@@ -583,7 +583,7 @@ pub unsafe extern "C" fn krun_set_root_disk(ctx_id: u32, c_disk_path: *const c_c
583
583
let cfg = ctx_cfg. get_mut ( ) ;
584
584
let block_device_config = BlockDeviceConfig {
585
585
block_id : "root" . to_string ( ) ,
586
- cache_type : CacheType :: Writeback ,
586
+ cache_type : CacheType :: auto ( disk_path ) ,
587
587
disk_image_path : disk_path. to_string ( ) ,
588
588
disk_image_format : ImageType :: Raw ,
589
589
is_disk_read_only : false ,
@@ -610,7 +610,7 @@ pub unsafe extern "C" fn krun_set_data_disk(ctx_id: u32, c_disk_path: *const c_c
610
610
let cfg = ctx_cfg. get_mut ( ) ;
611
611
let block_device_config = BlockDeviceConfig {
612
612
block_id : "data" . to_string ( ) ,
613
- cache_type : CacheType :: Writeback ,
613
+ cache_type : CacheType :: auto ( disk_path ) ,
614
614
disk_image_path : disk_path. to_string ( ) ,
615
615
disk_image_format : ImageType :: Raw ,
616
616
is_disk_read_only : false ,
0 commit comments