From: Paolo Bonzini Date: Thu, 14 Apr 2022 17:57:56 +0000 (+0200) Subject: nbd: document what is protected by the CoMutexes X-Git-Tag: v7.1.0-rc0~127^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=620c5cb5da57dc97f655e6218e7ca9bc896394a2;p=thirdparty%2Fqemu.git nbd: document what is protected by the CoMutexes Signed-off-by: Paolo Bonzini Message-Id: <20220414175756.671165-10-pbonzini@redhat.com> Reviewed-by: Eric Blake Reviewed-by: Lukas Straub Signed-off-by: Eric Blake --- diff --git a/block/nbd.c b/block/nbd.c index 3bfcf4d97c4..6085ab1d2c1 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -81,12 +81,18 @@ typedef struct BDRVNBDState { NBDClientRequest requests[MAX_NBD_REQUESTS]; QEMUTimer *reconnect_delay_timer; + /* Protects sending data on the socket. */ CoMutex send_mutex; + + /* + * Protects receiving reply headers from the socket, as well as the + * fields reply and requests[].receiving + */ CoMutex receive_mutex; + NBDReply reply; QEMUTimer *open_timer; - NBDReply reply; BlockDriverState *bs; /* Connection parameters */