@@ -91,6 +91,25 @@ impl<AS: GuestAddressSpace> VhostKernVdpa<AS> {
91
91
}
92
92
}
93
93
94
+ //impl<T: VhostKernBackend> VhostBackend for T {
95
+ // impl<AS: GuestAddressSpace> VhostBackend for VhostKernVdpa<AS> {
96
+ // fn get_status(&self) -> Result<u8> {
97
+ // let mut status: u8 = 0;
98
+
99
+ // // SAFETY: This ioctl is called on a valid vhost-vdpa fd and has its
100
+ // // return value checked.
101
+ // let ret = unsafe { ioctl_with_mut_ref(self, VHOST_VDPA_GET_STATUS(), &mut status) };
102
+ // ioctl_result(ret, status)
103
+ // }
104
+
105
+ // fn set_status(&self, status: u8) -> Result<()> {
106
+ // // SAFETY: This ioctl is called on a valid vhost-vdpa fd and has its
107
+ // // return value checked.
108
+ // let ret = unsafe { ioctl_with_ref(self, VHOST_VDPA_SET_STATUS(), &status) };
109
+ // ioctl_result(ret, ())
110
+ // }
111
+ // }
112
+
94
113
impl < AS : GuestAddressSpace > VhostVdpa for VhostKernVdpa < AS > {
95
114
fn get_device_id ( & self ) -> Result < u32 > {
96
115
let mut device_id: u32 = 0 ;
@@ -101,22 +120,6 @@ impl<AS: GuestAddressSpace> VhostVdpa for VhostKernVdpa<AS> {
101
120
ioctl_result ( ret, device_id)
102
121
}
103
122
104
- fn get_status ( & self ) -> Result < u8 > {
105
- let mut status: u8 = 0 ;
106
-
107
- // SAFETY: This ioctl is called on a valid vhost-vdpa fd and has its
108
- // return value checked.
109
- let ret = unsafe { ioctl_with_mut_ref ( self , VHOST_VDPA_GET_STATUS ( ) , & mut status) } ;
110
- ioctl_result ( ret, status)
111
- }
112
-
113
- fn set_status ( & self , status : u8 ) -> Result < ( ) > {
114
- // SAFETY: This ioctl is called on a valid vhost-vdpa fd and has its
115
- // return value checked.
116
- let ret = unsafe { ioctl_with_ref ( self , VHOST_VDPA_SET_STATUS ( ) , & status) } ;
117
- ioctl_result ( ret, ( ) )
118
- }
119
-
120
123
fn get_config ( & self , offset : u32 , buffer : & mut [ u8 ] ) -> Result < ( ) > {
121
124
let mut config = VhostVdpaConfig :: new ( buffer. len ( ) )
122
125
. map_err ( |_| Error :: IoctlError ( IOError :: from_raw_os_error ( libc:: ENOMEM ) ) ) ?;
0 commit comments