Received: from eggs.gnu.org ([2001:4830:134:3::10]:48578) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNdwU-0007RF-9c for qemu-devel@nongnu.org; Tue, 17 Feb 2015 03:55:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNdwQ-0006bf-DE for qemu-devel@nongnu.org; Tue, 17 Feb 2015 03:55:42 -0500 From: Markus Armbruster References: <1424122891-9390-1-git-send-email-thuth@linux.vnet.ibm.com> <1424122891-9390-4-git-send-email-thuth@linux.vnet.ibm.com> Date: Tue, 17 Feb 2015 09:55:33 +0100 In-Reply-To: <1424122891-9390-4-git-send-email-thuth@linux.vnet.ibm.com> (Thomas Huth's message of "Mon, 16 Feb 2015 22:41:30 +0100") Message-ID: <87twyknchm.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 3/4] util: Remove unused functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org Thomas Huth writes: > Delete the unused functions qemu_opt_get_number_del(), > qemu_signalfd_available(), qemu_send_full() and qemu_recv_full(). > > Signed-off-by: Thomas Huth qemu_opt_get_number_del() was added in commit 782730b along with qemu_opt_get_del(), qemu_opt_get_bool_del() and qemu_opt_get_size_del(). It hasn't been used so far, but removing it makes the interface irregular. I'd rather not. Covering all four in tests/test-qemu-opts.c would be nice. qemu_send_full() and qemu_recv_full() complement qemu_write_full(). On the other hand, there's no qemu_read_full(). I don't think keeping the two unused ones hurts, but I don't object to dropping them, either. For what it's worth, glibc provides a macro to solve this problem once and for all: /* Evaluate EXPRESSION, and repeat as long as it returns -1 with `errno' set to EINTR. */ # define TEMP_FAILURE_RETRY(expression) \ (__extension__ \ ({ long int __result; \ do __result = (long int) (expression); \ while (__result == -1L && errno == EINTR); \ __result; })) #endif More elegant than writing the same old boring wrapper around everything that can fail with EINTR. qemu_signalfd_available() is unused since commit 6d32717. It's also the only user of CONFIG_SIGNALFD. If we want to drop it, I recommend dropping CONFIG_SIGNALFD as well.