mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-05-11 06:05:04 +00:00
dragonball: Fix mismatched_lifetime_syntaxes issue
Fix to`warning: hiding a lifetime that's elided elsewhere is confusing` Signed-off-by: stevenhorsman <steven@uk.ibm.com>
This commit is contained in:
@@ -207,7 +207,7 @@ impl<B: Bitmap> GuestMemoryRegion for GuestRegionHybrid<B> {
|
||||
&self,
|
||||
offset: MemoryRegionAddress,
|
||||
count: usize,
|
||||
) -> guest_memory::Result<VolatileSlice<BS<B>>> {
|
||||
) -> guest_memory::Result<VolatileSlice<'_, BS<'_, B>>> {
|
||||
match self {
|
||||
GuestRegionHybrid::Mmap(region) => region.get_slice(offset, count),
|
||||
GuestRegionHybrid::Raw(region) => region.get_slice(offset, count),
|
||||
@@ -359,7 +359,7 @@ impl<B: Bitmap + 'static> GuestMemory for GuestMemoryHybrid<B> {
|
||||
index.map(|x| self.regions[x].as_ref())
|
||||
}
|
||||
|
||||
fn iter(&self) -> Iter<B> {
|
||||
fn iter(&self) -> Iter<'_, B> {
|
||||
Iter(self.regions.iter())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ impl<B: Bitmap> GuestMemoryRegion for GuestRegionRaw<B> {
|
||||
&self,
|
||||
offset: MemoryRegionAddress,
|
||||
count: usize,
|
||||
) -> guest_memory::Result<VolatileSlice<BS<B>>> {
|
||||
) -> guest_memory::Result<VolatileSlice<'_, BS<'_, B>>> {
|
||||
let offset = offset.raw_value() as usize;
|
||||
let end = compute_offset(offset, count)?;
|
||||
if end > self.size {
|
||||
|
||||
@@ -1640,7 +1640,7 @@ impl<C: PciSystemContext> VfioPciDevice<C> {
|
||||
);
|
||||
let _ = state.unregister_regions(&self.vm_fd).map_err(|e| {
|
||||
// If unregistering regions goes wrong, the memory region in Dragonball will be in a mess,
|
||||
// so we panic here to avoid more serious problem.
|
||||
// so we panic here to avoid more serious problem.
|
||||
panic!("failed to rollback changes of VfioPciDevice::register_regions() because error {:?}", e);
|
||||
});
|
||||
}
|
||||
@@ -1656,7 +1656,7 @@ impl<C: PciSystemContext> VfioPciDevice<C> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn state(&self) -> MutexGuard<VfioPciDeviceState<C>> {
|
||||
pub fn state(&self) -> MutexGuard<'_, VfioPciDeviceState<C>> {
|
||||
// Don't expect poisoned lock
|
||||
self.state
|
||||
.lock()
|
||||
|
||||
@@ -669,7 +669,7 @@ where
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn device(&self) -> MutexGuard<Box<dyn VirtioDevice<AS, Q, R>>> {
|
||||
pub fn device(&self) -> MutexGuard<'_, Box<dyn VirtioDevice<AS, Q, R>>> {
|
||||
self.device.lock().expect("Poisoned lock of device")
|
||||
}
|
||||
|
||||
@@ -677,21 +677,21 @@ where
|
||||
self.device.clone()
|
||||
}
|
||||
|
||||
pub fn common_config(&self) -> MutexGuard<VirtioPciCommonConfig> {
|
||||
pub fn common_config(&self) -> MutexGuard<'_, VirtioPciCommonConfig> {
|
||||
self.common_config
|
||||
.lock()
|
||||
.expect("Poisoned lock of common_config")
|
||||
}
|
||||
|
||||
pub fn state(&self) -> MutexGuard<VirtioPciDeviceState<AS, Q>> {
|
||||
pub fn state(&self) -> MutexGuard<'_, VirtioPciDeviceState<AS, Q>> {
|
||||
self.state.lock().expect("Poisoned lock of state")
|
||||
}
|
||||
|
||||
pub fn msix_state(&self) -> MutexGuard<MsixState> {
|
||||
pub fn msix_state(&self) -> MutexGuard<'_, MsixState> {
|
||||
self.msix_state.lock().expect("Poisoned lock of msix_state")
|
||||
}
|
||||
|
||||
pub fn intr_mgr(&self) -> MutexGuard<DeviceInterruptManager<Arc<KvmIrqManager>>> {
|
||||
pub fn intr_mgr(&self) -> MutexGuard<'_, DeviceInterruptManager<Arc<KvmIrqManager>>> {
|
||||
// Safe to unwrap() because we don't expect poisoned lock here.
|
||||
self.intr_mgr.lock().expect("Poisoned lock of intr_mgr")
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ where
|
||||
}
|
||||
|
||||
/// Acquires the state while holding the lock.
|
||||
pub fn state(&self) -> MutexGuard<MmioV2DeviceState<AS, Q, R>> {
|
||||
pub fn state(&self) -> MutexGuard<'_, MmioV2DeviceState<AS, Q, R>> {
|
||||
// Safe to unwrap() because we don't expect poisoned lock here.
|
||||
self.state.lock().unwrap()
|
||||
}
|
||||
|
||||
@@ -444,7 +444,7 @@ where
|
||||
})
|
||||
}
|
||||
|
||||
fn device(&self) -> MutexGuard<VhostUserBlockDevice> {
|
||||
fn device(&self) -> MutexGuard<'_, VhostUserBlockDevice> {
|
||||
self.device.lock().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -560,7 +560,7 @@ impl<AS: GuestAddressSpace> VhostUserFs<AS> {
|
||||
self.device.clone()
|
||||
}
|
||||
|
||||
fn device(&self) -> MutexGuard<VhostUserFsDevice> {
|
||||
fn device(&self) -> MutexGuard<'_, VhostUserFsDevice> {
|
||||
// Do not expect poisoned lock.
|
||||
self.device.lock().unwrap()
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ impl VhostUserNetDevice {
|
||||
// recreate it again.
|
||||
let (master, avail_features) = self.listener.accept()?;
|
||||
if !avail_features & self.device_info.acked_features() != 0 {
|
||||
error!("{}: Virtio features changed when reconnecting, avail features: 0x{:X}, acked features: 0x{:X}.",
|
||||
error!("{}: Virtio features changed when reconnecting, avail features: 0x{:X}, acked features: 0x{:X}.",
|
||||
self.id, avail_features, self.device_info.acked_features());
|
||||
return Err(VhostError::VhostUserProtocol(VhostUserError::FeatureMismatch).into());
|
||||
}
|
||||
@@ -304,7 +304,7 @@ impl VhostUserNetDevice {
|
||||
// recreate it again.
|
||||
let (master, avail_features) = self.listener.accept()?;
|
||||
if !avail_features & self.device_info.acked_features() != 0 {
|
||||
error!("{}: Virtio features changed when reconnecting, avail features: 0x{:X}, acked features: 0x{:X}.",
|
||||
error!("{}: Virtio features changed when reconnecting, avail features: 0x{:X}, acked features: 0x{:X}.",
|
||||
self.id, avail_features, self.device_info.acked_features());
|
||||
return Err(VhostError::VhostUserProtocol(VhostUserError::FeatureMismatch).into());
|
||||
}
|
||||
@@ -360,7 +360,7 @@ where
|
||||
})
|
||||
}
|
||||
|
||||
fn device(&self) -> MutexGuard<VhostUserNetDevice> {
|
||||
fn device(&self) -> MutexGuard<'_, VhostUserNetDevice> {
|
||||
// Do not expect poisoned lock.
|
||||
self.device.lock().unwrap()
|
||||
}
|
||||
@@ -466,7 +466,7 @@ where
|
||||
Q: QueueT + Send + 'static,
|
||||
R: GuestMemoryRegion + Sync + Send + 'static,
|
||||
{
|
||||
fn device(&self) -> MutexGuard<VhostUserNetDevice> {
|
||||
fn device(&self) -> MutexGuard<'_, VhostUserNetDevice> {
|
||||
// Do not expect poisoned lock here
|
||||
self.device.lock().unwrap()
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ where
|
||||
}
|
||||
|
||||
/// Returns an immutable iterator over the config items
|
||||
pub fn iter(&self) -> ::std::slice::Iter<T> {
|
||||
pub fn iter(&self) -> ::std::slice::Iter<'_, T> {
|
||||
self.configs.iter()
|
||||
}
|
||||
|
||||
@@ -269,12 +269,12 @@ where
|
||||
}
|
||||
|
||||
/// Iterator for configuration information objects.
|
||||
pub fn iter(&self) -> std::slice::Iter<DeviceConfigInfo<T>> {
|
||||
pub fn iter(&self) -> std::slice::Iter<'_, DeviceConfigInfo<T>> {
|
||||
self.info_list.iter()
|
||||
}
|
||||
|
||||
/// Mutable iterator for configuration information objects.
|
||||
pub fn iter_mut(&mut self) -> std::slice::IterMut<DeviceConfigInfo<T>> {
|
||||
pub fn iter_mut(&mut self) -> std::slice::IterMut<'_, DeviceConfigInfo<T>> {
|
||||
self.info_list.iter_mut()
|
||||
}
|
||||
|
||||
|
||||
@@ -316,7 +316,7 @@ pub struct BlockDeviceMgr {
|
||||
|
||||
impl BlockDeviceMgr {
|
||||
/// returns a front-to-back iterator.
|
||||
pub fn iter(&self) -> vec_deque::Iter<BlockDeviceInfo> {
|
||||
pub fn iter(&self) -> vec_deque::Iter<'_, BlockDeviceInfo> {
|
||||
self.info_list.iter()
|
||||
}
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ impl Vm {
|
||||
}
|
||||
|
||||
/// Generate fdt information about devices
|
||||
fn get_fdt_device_info(&self) -> FdtDeviceInfo<MMIODeviceInfo> {
|
||||
fn get_fdt_device_info(&self) -> FdtDeviceInfo<'_, MMIODeviceInfo> {
|
||||
FdtDeviceInfo::new(
|
||||
self.device_manager().get_mmio_device_info(),
|
||||
self.get_irqchip(),
|
||||
|
||||
Reference in New Issue
Block a user