@@ -10,16 +10,7 @@ pub mod mmio;
1010pub mod net;
1111#[ cfg( feature = "pci" ) ]
1212pub mod pci;
13- #[ cfg( any(
14- all(
15- not( all( target_arch = "riscv64" , feature = "gem-net" , not( feature = "pci" ) ) ) ,
16- not( feature = "rtl8139" ) ,
17- feature = "virtio-net" ,
18- ) ,
19- feature = "fuse" ,
20- feature = "vsock" ,
21- feature = "console" ,
22- ) ) ]
13+ #[ cfg( feature = "virtio" ) ]
2314pub mod virtio;
2415#[ cfg( feature = "vsock" ) ]
2516pub mod vsock;
@@ -38,51 +29,27 @@ pub(crate) type InterruptHandlerQueue = VecDeque<fn()>;
3829/// passed on to higher layers.
3930pub mod error {
4031 #[ cfg( any(
32+ feature = "virtio" ,
4133 all( target_arch = "riscv64" , feature = "gem-net" , not( feature = "pci" ) ) ,
4234 feature = "rtl8139" ,
43- feature = "virtio-net" ,
44- feature = "fuse" ,
45- feature = "vsock" ,
46- feature = "console" ,
4735 ) ) ]
4836 use thiserror:: Error ;
4937
5038 #[ cfg( all( target_arch = "riscv64" , feature = "gem-net" , not( feature = "pci" ) ) ) ]
5139 use crate :: drivers:: net:: gem:: GEMError ;
5240 #[ cfg( feature = "rtl8139" ) ]
5341 use crate :: drivers:: net:: rtl8139:: RTL8139Error ;
54- #[ cfg( any(
55- all(
56- not( all( target_arch = "riscv64" , feature = "gem-net" , not( feature = "pci" ) ) ) ,
57- not( feature = "rtl8139" ) ,
58- feature = "virtio-net" ,
59- ) ,
60- feature = "fuse" ,
61- feature = "vsock" ,
62- feature = "console" ,
63- ) ) ]
42+ #[ cfg( feature = "virtio" ) ]
6443 use crate :: drivers:: virtio:: error:: VirtioError ;
6544
6645 #[ cfg( any(
46+ feature = "virtio" ,
6747 all( target_arch = "riscv64" , feature = "gem-net" , not( feature = "pci" ) ) ,
6848 feature = "rtl8139" ,
69- feature = "virtio-net" ,
70- feature = "fuse" ,
71- feature = "vsock" ,
72- feature = "console" ,
7349 ) ) ]
7450 #[ derive( Error , Debug ) ]
7551 pub enum DriverError {
76- #[ cfg( any(
77- all(
78- not( all( target_arch = "riscv64" , feature = "gem-net" , not( feature = "pci" ) ) ) ,
79- not( feature = "rtl8139" ) ,
80- feature = "virtio-net" ,
81- ) ,
82- feature = "fuse" ,
83- feature = "vsock" ,
84- feature = "console" ,
85- ) ) ]
52+ #[ cfg( feature = "virtio" ) ]
8653 #[ error( "Virtio driver failed: {0:?}" ) ]
8754 InitVirtioDevFail ( #[ from] VirtioError ) ,
8855
0 commit comments