@@ -509,7 +509,7 @@ pub unsafe extern "C" fn krun_add_disk(
509509 let cfg = ctx_cfg. get_mut ( ) ;
510510 let block_device_config = BlockDeviceConfig {
511511 block_id : block_id. to_string ( ) ,
512- cache_type : CacheType :: Writeback ,
512+ cache_type : CacheType :: auto ( disk_path ) ,
513513 disk_image_path : disk_path. to_string ( ) ,
514514 disk_image_format : ImageType :: Raw ,
515515 is_disk_read_only : read_only,
@@ -556,7 +556,7 @@ pub unsafe extern "C" fn krun_add_disk2(
556556 let cfg = ctx_cfg. get_mut ( ) ;
557557 let block_device_config = BlockDeviceConfig {
558558 block_id : block_id. to_string ( ) ,
559- cache_type : CacheType :: Writeback ,
559+ cache_type : CacheType :: auto ( disk_path ) ,
560560 disk_image_path : disk_path. to_string ( ) ,
561561 disk_image_format : format,
562562 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
583583 let cfg = ctx_cfg. get_mut ( ) ;
584584 let block_device_config = BlockDeviceConfig {
585585 block_id : "root" . to_string ( ) ,
586- cache_type : CacheType :: Writeback ,
586+ cache_type : CacheType :: auto ( disk_path ) ,
587587 disk_image_path : disk_path. to_string ( ) ,
588588 disk_image_format : ImageType :: Raw ,
589589 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
610610 let cfg = ctx_cfg. get_mut ( ) ;
611611 let block_device_config = BlockDeviceConfig {
612612 block_id : "data" . to_string ( ) ,
613- cache_type : CacheType :: Writeback ,
613+ cache_type : CacheType :: auto ( disk_path ) ,
614614 disk_image_path : disk_path. to_string ( ) ,
615615 disk_image_format : ImageType :: Raw ,
616616 is_disk_read_only : false ,
0 commit comments