mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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:
@@ -1,28 +1,28 @@
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
/// The main job of `VsockConnection` is to forward data traffic, back and forth, between a
|
||||
/// guest-side AF_VSOCK socket and a host-side generic `Read + Write + AsRawFd` stream, while
|
||||
/// also managing its internal state.
|
||||
/// To that end, `VsockConnection` implements:
|
||||
/// - `VsockChannel` for:
|
||||
/// - moving data from the host stream to a guest-provided RX buffer, via `recv_pkt()`; and
|
||||
/// - moving data from a guest-provided TX buffer to the host stream, via `send_pkt()`; and
|
||||
/// - updating its internal state, by absorbing control packets (anything other than
|
||||
/// VSOCK_OP_RW).
|
||||
/// - `VsockEpollListener` for getting notified about the availability of data or free buffer
|
||||
/// space at the host stream.
|
||||
///
|
||||
/// Note: there is a certain asymmetry to the RX and TX data flows:
|
||||
/// - RX transfers do not need any data buffering, since data is read straight from the
|
||||
/// host stream and into the guest-provided RX buffer;
|
||||
/// - TX transfers may require some data to be buffered by `VsockConnection`, if the host
|
||||
/// peer can't keep up with reading the data that we're writing. This is because, once
|
||||
/// the guest driver provides some data in a virtio TX buffer, the vsock device must
|
||||
/// consume it. If that data can't be forwarded straight to the host stream, we'll
|
||||
/// have to store it in a buffer (and flush it at a later time). Vsock flow control
|
||||
/// ensures that our TX buffer doesn't overflow.
|
||||
///
|
||||
//! The main job of `VsockConnection` is to forward data traffic, back and forth, between a
|
||||
//! guest-side AF_VSOCK socket and a host-side generic `Read + Write + AsRawFd` stream, while
|
||||
//! also managing its internal state.
|
||||
//! To that end, `VsockConnection` implements:
|
||||
//! - `VsockChannel` for:
|
||||
//! - moving data from the host stream to a guest-provided RX buffer, via `recv_pkt()`; and
|
||||
//! - moving data from a guest-provided TX buffer to the host stream, via `send_pkt()`; and
|
||||
//! - updating its internal state, by absorbing control packets (anything other than
|
||||
//! VSOCK_OP_RW).
|
||||
//! - `VsockEpollListener` for getting notified about the availability of data or free buffer
|
||||
//! space at the host stream.
|
||||
//!
|
||||
//! Note: there is a certain asymmetry to the RX and TX data flows:
|
||||
//! - RX transfers do not need any data buffering, since data is read straight from the
|
||||
//! host stream and into the guest-provided RX buffer;
|
||||
//! - TX transfers may require some data to be buffered by `VsockConnection`, if the host
|
||||
//! peer can't keep up with reading the data that we're writing. This is because, once
|
||||
//! the guest driver provides some data in a virtio TX buffer, the vsock device must
|
||||
//! consume it. If that data can't be forwarded straight to the host stream, we'll
|
||||
//! have to store it in a buffer (and flush it at a later time). Vsock flow control
|
||||
//! ensures that our TX buffer doesn't overflow.
|
||||
//
|
||||
// The code in this file is best read with a fresh memory of the vsock protocol inner-workings.
|
||||
// To help with that, here is a
|
||||
//
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
/// This module implements our vsock connection state machine. The heavy lifting is done by
|
||||
/// `connection::VsockConnection`, while this file only defines some constants and helper structs.
|
||||
///
|
||||
//! This module implements our vsock connection state machine. The heavy lifting is done by
|
||||
//! `connection::VsockConnection`, while this file only defines some constants and helper structs.
|
||||
|
||||
mod connection;
|
||||
mod txbuf;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user