virtio-devices: fix broken vsock doc comments

These need to be //! comments, because they apply to the module as a
whole, not to whatever directly follows the comment.  Using ///
comments here resulted in documentation being attached to the wrong
thing, or not rendered at all.

I've also checked the Markdown formatting of these comments as
rendered by rustdoc, and fixed it where appropriate.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
This commit is contained in:
Alyssa Ross
2023-04-04 16:19:39 +00:00
committed by Bo Chen
parent 95f83320b1
commit f6236087d8
7 changed files with 118 additions and 110 deletions
+13 -13
View File
@@ -2,19 +2,19 @@
// SPDX-License-Identifier: Apache-2.0
//
/// `VsockPacket` provides a thin wrapper over the buffers exchanged via virtio queues.
/// There are two components to a vsock packet, each using its own descriptor in a
/// virtio queue:
/// - the packet header; and
/// - the packet data/buffer.
/// There is a 1:1 relation between descriptor chains and packets: the first (chain head) holds
/// the header, and an optional second descriptor holds the data. The second descriptor is only
/// present for data packets (VSOCK_OP_RW).
///
/// `VsockPacket` wraps these two buffers and provides direct access to the data stored
/// in guest memory. This is done to avoid unnecessarily copying data from guest memory
/// to temporary buffers, before passing it on to the vsock backend.
///
//! `VsockPacket` provides a thin wrapper over the buffers exchanged via virtio queues.
//! There are two components to a vsock packet, each using its own descriptor in a
//! virtio queue:
//! - the packet header; and
//! - the packet data/buffer.
//! There is a 1:1 relation between descriptor chains and packets: the first (chain head) holds
//! the header, and an optional second descriptor holds the data. The second descriptor is only
//! present for data packets (VSOCK_OP_RW).
//!
//! `VsockPacket` wraps these two buffers and provides direct access to the data stored
//! in guest memory. This is done to avoid unnecessarily copying data from guest memory
//! to temporary buffers, before passing it on to the vsock backend.
use byteorder::{ByteOrder, LittleEndian};
use std::ops::Deref;
use std::sync::Arc;