diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2022-04-14 19:57:56 +0200 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2022-04-26 13:16:42 -0500 |
commit | 620c5cb5da57dc97f655e6218e7ca9bc896394a2 (patch) | |
tree | 31772b17286a6eae7ceba269db731127b674f474 /block | |
parent | a80a9a1c7397382fc4c4e6feaa8242b25cadb519 (diff) |
nbd: document what is protected by the CoMutexes
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20220414175756.671165-10-pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Lukas Straub <lukasstraub2@web.de>
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/nbd.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/block/nbd.c b/block/nbd.c index 3bfcf4d97c..6085ab1d2c 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 */ |