Skip to content

Commit 68cb7c7

Browse files
uran0sHepilys
authored andcommitted
virtio-queue: remove enable_notification()'s comments
The doc comment and the example are already written at the beginning of the file. So we can remove it here. Signed-off-by: Wenyu Huang <huangwenyuu@outlook.com>
1 parent 3e51e2d commit 68cb7c7

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

virtio-queue/src/queue.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -484,26 +484,6 @@ impl QueueT for Queue {
484484
.map_err(Error::GuestMemory)
485485
}
486486

487-
// TODO: Turn this into a doc comment/example.
488-
// With the current implementation, a common way of consuming entries from the available ring
489-
// while also leveraging notification suppression is to use a loop, for example:
490-
//
491-
// loop {
492-
// // We have to explicitly disable notifications if `VIRTIO_F_EVENT_IDX` has not been
493-
// // negotiated.
494-
// self.disable_notification()?;
495-
//
496-
// for chain in self.iter()? {
497-
// // Do something with each chain ...
498-
// // Let's assume we process all available chains here.
499-
// }
500-
//
501-
// // If `enable_notification` returns `true`, the driver has added more entries to the
502-
// // available ring.
503-
// if !self.enable_notification()? {
504-
// break;
505-
// }
506-
// }
507487
fn enable_notification<M: GuestMemory>(&mut self, mem: &M) -> Result<bool, Error> {
508488
self.set_notification(mem, true)?;
509489
// Ensures the following read is not reordered before any previous write operation.

0 commit comments

Comments
 (0)