File tree 5 files changed +10
-11
lines changed
propolis-server/src/lib/vm
5 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -865,7 +865,7 @@ impl VmController {
865
865
& self ,
866
866
name : & String ,
867
867
) -> Option < Arc < dyn propolis:: common:: Lifecycle > > {
868
- self . vm_objects . devices . get ( name) . map ( Arc :: clone )
868
+ self . vm_objects . devices . get ( name) . cloned ( )
869
869
}
870
870
}
871
871
Original file line number Diff line number Diff line change @@ -78,6 +78,9 @@ impl From<propolis::exits::Suspend> for InstEvent {
78
78
}
79
79
80
80
#[ derive( Clone , Debug ) ]
81
+ // Silence the lint about detail fields being unused, since rustc ignores the
82
+ // derived Debug impl which does read those bits.
83
+ #[ allow( dead_code) ]
81
84
enum EventCtx {
82
85
Vcpu ( i32 ) ,
83
86
Pin ( String ) ,
Original file line number Diff line number Diff line change @@ -285,21 +285,15 @@ impl NvmeCtrl {
285
285
if ( cqid as usize ) >= MAX_NUM_QUEUES {
286
286
return Err ( NvmeError :: InvalidCompQueue ( cqid) ) ;
287
287
}
288
- self . cqs [ cqid as usize ]
289
- . as_ref ( )
290
- . map ( Arc :: clone)
291
- . ok_or ( NvmeError :: InvalidCompQueue ( cqid) )
288
+ self . cqs [ cqid as usize ] . clone ( ) . ok_or ( NvmeError :: InvalidCompQueue ( cqid) )
292
289
}
293
290
294
291
/// Returns a reference to the [`SubQueue`] which corresponds to the given submission queue id (`cqid`).
295
292
fn get_sq ( & self , sqid : QueueId ) -> Result < Arc < SubQueue > , NvmeError > {
296
293
if ( sqid as usize ) >= MAX_NUM_QUEUES {
297
294
return Err ( NvmeError :: InvalidSubQueue ( sqid) ) ;
298
295
}
299
- self . sqs [ sqid as usize ]
300
- . as_ref ( )
301
- . map ( Arc :: clone)
302
- . ok_or ( NvmeError :: InvalidSubQueue ( sqid) )
296
+ self . sqs [ sqid as usize ] . clone ( ) . ok_or ( NvmeError :: InvalidSubQueue ( sqid) )
303
297
}
304
298
305
299
/// Returns a reference to the Admin [`CompQueue`].
Original file line number Diff line number Diff line change @@ -162,8 +162,7 @@ impl Inner {
162
162
fn device_at ( & self , location : BusLocation ) -> Option < Arc < dyn Endpoint > > {
163
163
let res = self . slots [ location. dev . get ( ) as usize ] . funcs
164
164
[ location. func . get ( ) as usize ]
165
- . as_ref ( )
166
- . map ( Arc :: clone) ;
165
+ . clone ( ) ;
167
166
res
168
167
}
169
168
fn attach (
Original file line number Diff line number Diff line change @@ -344,6 +344,9 @@ unsafe impl Send for Mapping {}
344
344
unsafe impl Sync for Mapping { }
345
345
346
346
#[ derive( Debug ) ]
347
+ // Backing resources (Mapping or SubMapping) must remain held, even though we do
348
+ // not reference them directly as a field.
349
+ #[ allow( dead_code) ]
347
350
enum Backing < ' a > {
348
351
Base ( Arc < Mapping > ) ,
349
352
Sub ( & ' a SubMapping < ' a > ) ,
You can’t perform that action at this time.
0 commit comments