|
7 | 7 | //
|
8 | 8 | // SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause
|
9 | 9 |
|
10 |
| -use std::any::Any; |
11 | 10 | use std::cmp;
|
12 | 11 | use std::collections::HashMap;
|
13 | 12 | use std::fmt::{Debug, Formatter};
|
@@ -870,7 +869,7 @@ impl PciDevice for VirtioPciDevice {
|
870 | 869 | &mut self,
|
871 | 870 | mmio32_allocator: &mut AddressAllocator,
|
872 | 871 | mmio64_allocator: &mut AddressAllocator,
|
873 |
| - ) -> std::result::Result<Vec<PciBarConfiguration>, PciDeviceError> { |
| 872 | + ) -> std::result::Result<(), PciDeviceError> { |
874 | 873 | let device_clone = self.device.clone();
|
875 | 874 | let device = device_clone.lock().unwrap();
|
876 | 875 |
|
@@ -905,25 +904,6 @@ impl PciDevice for VirtioPciDevice {
|
905 | 904 | self.add_pci_capabilities()?;
|
906 | 905 | self.bar_region = bar;
|
907 | 906 |
|
908 |
| - Ok(vec![bar]) |
909 |
| - } |
910 |
| - |
911 |
| - fn free_bars( |
912 |
| - &mut self, |
913 |
| - mmio32_allocator: &mut AddressAllocator, |
914 |
| - mmio64_allocator: &mut AddressAllocator, |
915 |
| - ) -> std::result::Result<(), PciDeviceError> { |
916 |
| - assert_eq!( |
917 |
| - self.bar_region.region_type, |
918 |
| - PciBarRegionType::Memory64BitRegion |
919 |
| - ); |
920 |
| - |
921 |
| - let range = RangeInclusive::new( |
922 |
| - self.bar_region.addr, |
923 |
| - self.bar_region.addr + self.bar_region.size, |
924 |
| - ) |
925 |
| - .unwrap(); |
926 |
| - mmio64_allocator.free(&range); |
927 | 907 | Ok(())
|
928 | 908 | }
|
929 | 909 |
|
@@ -1083,14 +1063,6 @@ impl PciDevice for VirtioPciDevice {
|
1083 | 1063 |
|
1084 | 1064 | None
|
1085 | 1065 | }
|
1086 |
| - |
1087 |
| - fn id(&self) -> Option<String> { |
1088 |
| - Some(self.id.clone()) |
1089 |
| - } |
1090 |
| - |
1091 |
| - fn as_any_mut(&mut self) -> &mut dyn Any { |
1092 |
| - self |
1093 |
| - } |
1094 | 1066 | }
|
1095 | 1067 |
|
1096 | 1068 | impl BusDevice for VirtioPciDevice {
|
|
0 commit comments