[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 04/38] curl: Store BDRVCURLState pointer in CURLSocket
From: |
Kevin Wolf |
Subject: |
[PULL 04/38] curl: Store BDRVCURLState pointer in CURLSocket |
Date: |
Thu, 11 Mar 2021 15:47:37 +0100 |
From: Max Reitz <mreitz@redhat.com>
A socket does not really belong to any specific state. We do not need
to store a pointer to "its" state in it, a pointer to the common
BDRVCURLState is sufficient.
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20210309130541.37540-2-mreitz@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/curl.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/block/curl.c b/block/curl.c
index 4ff895df8f..43c79bcf36 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -78,7 +78,7 @@ typedef struct CURLAIOCB {
typedef struct CURLSocket {
int fd;
- struct CURLState *state;
+ struct BDRVCURLState *s;
QLIST_ENTRY(CURLSocket) next;
} CURLSocket;
@@ -155,7 +155,7 @@ static int curl_sock_cb(CURL *curl, curl_socket_t fd, int
action,
if (!socket) {
socket = g_new0(CURLSocket, 1);
socket->fd = fd;
- socket->state = state;
+ socket->s = s;
QLIST_INSERT_HEAD(&state->sockets, socket, next);
}
@@ -385,7 +385,7 @@ static void curl_multi_check_completion(BDRVCURLState *s)
/* Called with s->mutex held. */
static void curl_multi_do_locked(CURLSocket *socket)
{
- BDRVCURLState *s = socket->state->s;
+ BDRVCURLState *s = socket->s;
int running;
int r;
@@ -401,7 +401,7 @@ static void curl_multi_do_locked(CURLSocket *socket)
static void curl_multi_do(void *arg)
{
CURLSocket *socket = arg;
- BDRVCURLState *s = socket->state->s;
+ BDRVCURLState *s = socket->s;
qemu_mutex_lock(&s->mutex);
curl_multi_do_locked(socket);
--
2.29.2
- [PULL 00/38] Block layer patches and object-add QAPIfication, Kevin Wolf, 2021/03/11
- [PULL 01/38] block: remove format defaults from QemuOpts in bdrv_create_file(), Kevin Wolf, 2021/03/11
- [PULL 02/38] storage-daemon: Call job_cancel_sync_all() on shutdown, Kevin Wolf, 2021/03/11
- [PULL 03/38] stream: Don't crash when node permission is denied, Kevin Wolf, 2021/03/11
- [PULL 04/38] curl: Store BDRVCURLState pointer in CURLSocket,
Kevin Wolf <=
- [PULL 06/38] block/export: disable VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD for now, Kevin Wolf, 2021/03/11
- [PULL 05/38] curl: Disconnect sockets from CURLState, Kevin Wolf, 2021/03/11
- [PULL 08/38] tests/qtest: add multi-queue test case to vhost-user-blk-test, Kevin Wolf, 2021/03/11
- [PULL 09/38] vhost-user-blk-test: test discard/write zeroes invalid inputs, Kevin Wolf, 2021/03/11
- [PULL 10/38] tests: Drop 'props' from object-add calls, Kevin Wolf, 2021/03/11
- [PULL 12/38] qapi/qom: Add ObjectOptions for iothread, Kevin Wolf, 2021/03/11
- [PULL 11/38] qapi/qom: Drop deprecated 'props' from object-add, Kevin Wolf, 2021/03/11
- [PULL 15/38] qapi/qom: Add ObjectOptions for dbus-vmstate, Kevin Wolf, 2021/03/11
- [PULL 13/38] qapi/qom: Add ObjectOptions for authz-*, Kevin Wolf, 2021/03/11
- [PULL 14/38] qapi/qom: Add ObjectOptions for cryptodev-*, Kevin Wolf, 2021/03/11