[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/4] util: Remove unused functions

From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH 3/4] util: Remove unused functions
Date: Tue, 17 Feb 2015 09:55:33 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Thomas Huth <address@hidden> 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 <address@hidden>

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; }))

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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]