mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-01 17:35:19 +00:00
pci: rename as_any to as_any_mut
That trait function returns a mutable reference. Rename it to follow Rust's convention. Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
parent
44c9ce598d
commit
d99f294281
@ -708,7 +708,7 @@ impl PciDevice for PvmemcontrolPciDevice {
|
|||||||
self.configuration.read_config_register(reg_idx)
|
self.configuration.read_config_register(reg_idx)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn as_any(&mut self) -> &mut dyn std::any::Any {
|
fn as_any_mut(&mut self) -> &mut dyn std::any::Any {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,7 +237,7 @@ impl PciDevice for PvPanicDevice {
|
|||||||
data[0] = self.events;
|
data[0] = self.events;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn as_any(&mut self) -> &mut dyn Any {
|
fn as_any_mut(&mut self) -> &mut dyn Any {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ impl PciDevice for PciRoot {
|
|||||||
self.config.read_reg(reg_idx)
|
self.config.read_reg(reg_idx)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn as_any(&mut self) -> &mut dyn Any {
|
fn as_any_mut(&mut self) -> &mut dyn Any {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ pub trait PciDevice: Send {
|
|||||||
}
|
}
|
||||||
/// Provides a mutable reference to the Any trait. This is useful to let
|
/// Provides a mutable reference to the Any trait. This is useful to let
|
||||||
/// the caller have access to the underlying type behind the trait.
|
/// the caller have access to the underlying type behind the trait.
|
||||||
fn as_any(&mut self) -> &mut dyn Any;
|
fn as_any_mut(&mut self) -> &mut dyn Any;
|
||||||
|
|
||||||
/// Optionally returns a unique identifier.
|
/// Optionally returns a unique identifier.
|
||||||
fn id(&self) -> Option<String>;
|
fn id(&self) -> Option<String>;
|
||||||
|
@ -1893,7 +1893,7 @@ impl PciDevice for VfioPciDevice {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn as_any(&mut self) -> &mut dyn Any {
|
fn as_any_mut(&mut self) -> &mut dyn Any {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -422,7 +422,7 @@ impl PciDevice for VfioUserPciDevice {
|
|||||||
.free_bars(allocator, mmio32_allocator, mmio64_allocator)
|
.free_bars(allocator, mmio32_allocator, mmio64_allocator)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn as_any(&mut self) -> &mut dyn Any {
|
fn as_any_mut(&mut self) -> &mut dyn Any {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1249,7 +1249,7 @@ impl PciDevice for VirtioPciDevice {
|
|||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
fn as_any(&mut self) -> &mut dyn Any {
|
fn as_any_mut(&mut self) -> &mut dyn Any {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -644,7 +644,7 @@ impl DeviceRelocation for AddressManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let any_dev = pci_dev.as_any();
|
let any_dev = pci_dev.as_any_mut();
|
||||||
if let Some(virtio_pci_dev) = any_dev.downcast_ref::<VirtioPciDevice>() {
|
if let Some(virtio_pci_dev) = any_dev.downcast_ref::<VirtioPciDevice>() {
|
||||||
let bar_addr = virtio_pci_dev.config_bar_addr();
|
let bar_addr = virtio_pci_dev.config_bar_addr();
|
||||||
if bar_addr == new_base {
|
if bar_addr == new_base {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user