[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 for-7.1 9/9] nbd: document what is protected by the CoMutexes
From: |
Paolo Bonzini |
Subject: |
[PATCH v2 for-7.1 9/9] nbd: document what is protected by the CoMutexes |
Date: |
Thu, 14 Apr 2022 19:57:56 +0200 |
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
block/nbd.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/block/nbd.c b/block/nbd.c
index 31c684772e..d0d94b40bd 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 */
--
2.35.1
- Re: [PATCH v2 for-7.1 5/9] nbd: use a QemuMutex to synchronize yanking, reconnection and coroutines, (continued)