From nobody Sat Dec 21 12:14:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=treblig.org ARC-Seal: i=1; a=rsa-sha256; t=1726704098; cv=none; d=zohomail.com; s=zohoarc; b=gD6YB4ZQz3zkgaJIcsyTj4drh1iMT8P8KKHNBNMrNeQ1PTLyeENRe1NddRXHDjtyHLrGOowwpVwGW/5miMBafm1j2DxJLPT/Z17XHove31nGbkC0imfWi8RMM/VRAMecEN70V73u95DjeHkomCT3Dcbo8AU54ANULQkVaBBTBgQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1726704098; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kOKUXySs4KdiNi+Z17+VJGaI7YhOtS5E1WabpUoRFZE=; b=Oe3rs2BNLqnGkddTsqQQJRDJ/YPTDkY7mm8vS+ZHMs/dvpEZ1GOVPgEjAGtGgYivCDh/DzrL6pORuQG0jSOnMhgMj2LJF/NcOOOhApozp75mAP+IT6zuscxda8D+BOQxPyk/pzp4hMB3IQ/B6UyaYTNkomcD3M0KW/F4p2t+g0M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1726704098705838.4432190497859; Wed, 18 Sep 2024 17:01:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sr4bG-0007rT-MN; Wed, 18 Sep 2024 20:00:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sr4bD-0007qJ-PS for qemu-devel@nongnu.org; Wed, 18 Sep 2024 20:00:44 -0400 Received: from mx.treblig.org ([2a00:1098:5b::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sr4bB-0004I3-7b for qemu-devel@nongnu.org; Wed, 18 Sep 2024 20:00:43 -0400 Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1sr4b8-006M4N-0q; Thu, 19 Sep 2024 00:00:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=kOKUXySs4KdiNi+Z17+VJGaI7YhOtS5E1WabpUoRFZE=; b=jSFUk5JdfWKJMFgO IikdpJ4DTjUYntMlXxuw5+EPGOyimLW9W4C9sy1t6oH7QNSekOHLnkLnpZpT00x4zGhpImvSDDwQZ L3KPBUTHu/Q6zj5s3TVgM0d7rrR88sj/JD0ZFRkPiSalVGTfZ2mY3cLHKN5AFgOCRxFl8/kV3Y8nq hx2Y5sppCCUgR+8AprFOM3zcwsibqtWPhT/YYuP6p/gjNHdj6QZAspw/txpYyBVmqOD0DDE8zqu31 j7SA+jnGOBwiPu1uEG5jB0kBeTUKWnlZhxttbpGAsRXpGXBMAmRiDj+EW1+hgo4I+AE2YHrKLi0XY r/KApxvDNAIAF/d3zA==; From: dave@treblig.org To: berrange@redhat.com, qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" Subject: [PATCH] io/channel-socket: Remove unused qio_channel_socket_dgram_async Date: Thu, 19 Sep 2024 01:00:34 +0100 Message-ID: <20240919000034.485744-1-dave@treblig.org> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1098:5b::1; envelope-from=dave@treblig.org; helo=mx.treblig.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @treblig.org) X-ZM-MESSAGEID: 1726704099836116600 Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" qio_channel_socket_dgram_async has been unused since it was originally added in 2015. Remove it. Signed-off-by: Dr. David Alan Gilbert --- include/io/channel-socket.h | 29 -------------------- io/channel-socket.c | 54 ------------------------------------- io/trace-events | 1 - 3 files changed, 84 deletions(-) diff --git a/include/io/channel-socket.h b/include/io/channel-socket.h index ab15577d38..6c858cc6b5 100644 --- a/include/io/channel-socket.h +++ b/include/io/channel-socket.h @@ -182,35 +182,6 @@ int qio_channel_socket_dgram_sync(QIOChannelSocket *io= c, SocketAddress *remoteAddr, Error **errp); =20 -/** - * qio_channel_socket_dgram_async: - * @ioc: the socket channel object - * @localAddr: the address to local bind address - * @remoteAddr: the address to remote peer address - * @callback: the function to invoke on completion - * @opaque: user data to pass to @callback - * @destroy: the function to free @opaque - * @context: the context to run the async task. If %NULL, the default - * context will be used. - * - * Attempt to initialize a datagram socket bound to - * @localAddr and communicating with peer @remoteAddr. - * This method will run in the background so the caller - * will regain execution control immediately. The function - * @callback will be invoked on completion or failure. - * The @localAddr and @remoteAddr parameters will be copied, - * so may be freed as soon as this function returns without - * waiting for completion. - */ -void qio_channel_socket_dgram_async(QIOChannelSocket *ioc, - SocketAddress *localAddr, - SocketAddress *remoteAddr, - QIOTaskFunc callback, - gpointer opaque, - GDestroyNotify destroy, - GMainContext *context); - - /** * qio_channel_socket_get_local_address: * @ioc: the socket channel object diff --git a/io/channel-socket.c b/io/channel-socket.c index 608bcf066e..2282e7a549 100644 --- a/io/channel-socket.c +++ b/io/channel-socket.c @@ -319,60 +319,6 @@ int qio_channel_socket_dgram_sync(QIOChannelSocket *io= c, } =20 =20 -struct QIOChannelSocketDGramWorkerData { - SocketAddress *localAddr; - SocketAddress *remoteAddr; -}; - - -static void qio_channel_socket_dgram_worker_free(gpointer opaque) -{ - struct QIOChannelSocketDGramWorkerData *data =3D opaque; - qapi_free_SocketAddress(data->localAddr); - qapi_free_SocketAddress(data->remoteAddr); - g_free(data); -} - -static void qio_channel_socket_dgram_worker(QIOTask *task, - gpointer opaque) -{ - QIOChannelSocket *ioc =3D QIO_CHANNEL_SOCKET(qio_task_get_source(task)= ); - struct QIOChannelSocketDGramWorkerData *data =3D opaque; - Error *err =3D NULL; - - /* socket_dgram() blocks in DNS lookups, so we must use a thread */ - qio_channel_socket_dgram_sync(ioc, data->localAddr, - data->remoteAddr, &err); - - qio_task_set_error(task, err); -} - - -void qio_channel_socket_dgram_async(QIOChannelSocket *ioc, - SocketAddress *localAddr, - SocketAddress *remoteAddr, - QIOTaskFunc callback, - gpointer opaque, - GDestroyNotify destroy, - GMainContext *context) -{ - QIOTask *task =3D qio_task_new( - OBJECT(ioc), callback, opaque, destroy); - struct QIOChannelSocketDGramWorkerData *data =3D g_new0( - struct QIOChannelSocketDGramWorkerData, 1); - - data->localAddr =3D QAPI_CLONE(SocketAddress, localAddr); - data->remoteAddr =3D QAPI_CLONE(SocketAddress, remoteAddr); - - trace_qio_channel_socket_dgram_async(ioc, localAddr, remoteAddr); - qio_task_run_in_thread(task, - qio_channel_socket_dgram_worker, - data, - qio_channel_socket_dgram_worker_free, - context); -} - - QIOChannelSocket * qio_channel_socket_accept(QIOChannelSocket *ioc, Error **errp) diff --git a/io/trace-events b/io/trace-events index d4c0f84a9a..5d0d4358db 100644 --- a/io/trace-events +++ b/io/trace-events @@ -25,7 +25,6 @@ qio_channel_socket_listen_async(void *ioc, void *addr, in= t num) "Socket listen a qio_channel_socket_listen_fail(void *ioc) "Socket listen fail ioc=3D%p" qio_channel_socket_listen_complete(void *ioc, int fd) "Socket listen compl= ete ioc=3D%p fd=3D%d" qio_channel_socket_dgram_sync(void *ioc, void *localAddr, void *remoteAddr= ) "Socket dgram sync ioc=3D%p localAddr=3D%p remoteAddr=3D%p" -qio_channel_socket_dgram_async(void *ioc, void *localAddr, void *remoteAdd= r) "Socket dgram async ioc=3D%p localAddr=3D%p remoteAddr=3D%p" qio_channel_socket_dgram_fail(void *ioc) "Socket dgram fail ioc=3D%p" qio_channel_socket_dgram_complete(void *ioc, int fd) "Socket dgram complet= e ioc=3D%p fd=3D%d" qio_channel_socket_accept(void *ioc) "Socket accept start ioc=3D%p" --=20 2.46.0