diff --git a/crates/vhost/src/vhost_kern/vdpa.rs b/crates/vhost/src/vhost_kern/vdpa.rs index 65e01231..ecdd4bef 100644 --- a/crates/vhost/src/vhost_kern/vdpa.rs +++ b/crates/vhost/src/vhost_kern/vdpa.rs @@ -91,6 +91,25 @@ impl VhostKernVdpa { } } +//impl VhostBackend for T { +// impl VhostBackend for VhostKernVdpa { +// fn get_status(&self) -> Result { +// let mut status: u8 = 0; + +// // SAFETY: This ioctl is called on a valid vhost-vdpa fd and has its +// // return value checked. +// let ret = unsafe { ioctl_with_mut_ref(self, VHOST_VDPA_GET_STATUS(), &mut status) }; +// ioctl_result(ret, status) +// } + +// fn set_status(&self, status: u8) -> Result<()> { +// // SAFETY: This ioctl is called on a valid vhost-vdpa fd and has its +// // return value checked. +// let ret = unsafe { ioctl_with_ref(self, VHOST_VDPA_SET_STATUS(), &status) }; +// ioctl_result(ret, ()) +// } +// } + impl VhostVdpa for VhostKernVdpa { fn get_device_id(&self) -> Result { let mut device_id: u32 = 0; @@ -101,22 +120,6 @@ impl VhostVdpa for VhostKernVdpa { ioctl_result(ret, device_id) } - fn get_status(&self) -> Result { - let mut status: u8 = 0; - - // SAFETY: This ioctl is called on a valid vhost-vdpa fd and has its - // return value checked. - let ret = unsafe { ioctl_with_mut_ref(self, VHOST_VDPA_GET_STATUS(), &mut status) }; - ioctl_result(ret, status) - } - - fn set_status(&self, status: u8) -> Result<()> { - // SAFETY: This ioctl is called on a valid vhost-vdpa fd and has its - // return value checked. - let ret = unsafe { ioctl_with_ref(self, VHOST_VDPA_SET_STATUS(), &status) }; - ioctl_result(ret, ()) - } - fn get_config(&self, offset: u32, buffer: &mut [u8]) -> Result<()> { let mut config = VhostVdpaConfig::new(buffer.len()) .map_err(|_| Error::IoctlError(IOError::from_raw_os_error(libc::ENOMEM)))?;