@@ -526,7 +526,7 @@ impl Vmm {
526526 path_on_host : String ,
527527 ) -> Result < ( ) , VmmError > {
528528 self . device_manager
529- . try_with_virtio_device_with_id ( drive_id, |block : & mut Block | {
529+ . with_virtio_device ( drive_id, |block : & mut Block | {
530530 block. update_disk_image ( path_on_host)
531531 } )
532532 . map_err ( VmmError :: FindDeviceError ) ??;
@@ -541,7 +541,7 @@ impl Vmm {
541541 rl_ops : BucketUpdate ,
542542 ) -> Result < ( ) , VmmError > {
543543 self . device_manager
544- . try_with_virtio_device_with_id ( drive_id, |block : & mut Block | {
544+ . with_virtio_device ( drive_id, |block : & mut Block | {
545545 block. update_rate_limiter ( rl_bytes, rl_ops)
546546 } )
547547 . map_err ( VmmError :: FindDeviceError ) ??;
@@ -551,7 +551,7 @@ impl Vmm {
551551 /// Updates the rate limiter parameters for block device with `drive_id` id.
552552 pub fn update_vhost_user_block_config ( & mut self , drive_id : & str ) -> Result < ( ) , VmmError > {
553553 self . device_manager
554- . try_with_virtio_device_with_id ( drive_id, |block : & mut Block | block. update_config ( ) )
554+ . with_virtio_device ( drive_id, |block : & mut Block | block. update_config ( ) )
555555 . map_err ( VmmError :: FindDeviceError ) ??;
556556 Ok ( ( ) )
557557 }
@@ -566,7 +566,7 @@ impl Vmm {
566566 tx_ops : BucketUpdate ,
567567 ) -> Result < ( ) , VmmError > {
568568 self . device_manager
569- . with_virtio_device_with_id ( net_id, |net : & mut Net | {
569+ . with_virtio_device ( net_id, |net : & mut Net | {
570570 net. patch_rate_limiters ( rx_bytes, rx_ops, tx_bytes, tx_ops)
571571 } )
572572 . map_err ( VmmError :: FindDeviceError )
@@ -575,23 +575,23 @@ impl Vmm {
575575 /// Returns a reference to the balloon device if present.
576576 pub fn balloon_config ( & self ) -> Result < BalloonConfig , VmmError > {
577577 self . device_manager
578- . with_virtio_device_with_id ( BALLOON_DEV_ID , |dev : & mut Balloon | dev. config ( ) )
578+ . with_virtio_device ( BALLOON_DEV_ID , |dev : & mut Balloon | dev. config ( ) )
579579 . map_err ( VmmError :: FindDeviceError )
580580 }
581581
582582 /// Returns the latest balloon statistics if they are enabled.
583583 pub fn latest_balloon_stats ( & self ) -> Result < BalloonStats , VmmError > {
584584 let stats = self
585585 . device_manager
586- . try_with_virtio_device_with_id ( BALLOON_DEV_ID , |dev : & mut Balloon | dev. latest_stats ( ) )
586+ . with_virtio_device ( BALLOON_DEV_ID , |dev : & mut Balloon | dev. latest_stats ( ) )
587587 . map_err ( VmmError :: FindDeviceError ) ??;
588588 Ok ( stats)
589589 }
590590
591591 /// Updates configuration for the balloon device target size.
592592 pub fn update_balloon_config ( & mut self , amount_mib : u32 ) -> Result < ( ) , VmmError > {
593593 self . device_manager
594- . try_with_virtio_device_with_id ( BALLOON_DEV_ID , |dev : & mut Balloon | {
594+ . with_virtio_device ( BALLOON_DEV_ID , |dev : & mut Balloon | {
595595 dev. update_size ( amount_mib)
596596 } )
597597 . map_err ( VmmError :: FindDeviceError ) ??;
@@ -604,7 +604,7 @@ impl Vmm {
604604 stats_polling_interval_s : u16 ,
605605 ) -> Result < ( ) , VmmError > {
606606 self . device_manager
607- . try_with_virtio_device_with_id ( BALLOON_DEV_ID , |dev : & mut Balloon | {
607+ . with_virtio_device ( BALLOON_DEV_ID , |dev : & mut Balloon | {
608608 dev. update_stats_polling_interval ( stats_polling_interval_s)
609609 } )
610610 . map_err ( VmmError :: FindDeviceError ) ??;
0 commit comments