[PATCH v4 0/2] Refactoring: expand usage of TFR() macro

Nikita Ivanov posted 2 patches 1 year, 6 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20221023090422.242617-1-nivanov@cloudlinux.com
Maintainers: Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Greg Kurz <groug@kaod.org>, Christian Schoenebeck <qemu_oss@crudebyte.com>, Jason Wang <jasowang@redhat.com>, Michael Roth <michael.roth@amd.com>, Konstantin Kostiuk <kkostiuk@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Thomas Huth <thuth@redhat.com>, Laurent Vivier <lvivier@redhat.com>
block/file-posix.c        | 37 ++++++++++++++++---------------------
chardev/char-fd.c         |  2 +-
chardev/char-pipe.c       |  8 +++++---
chardev/char-pty.c        |  4 +---
hw/9pfs/9p-local.c        |  8 ++------
include/qemu/osdep.h      |  8 +++++++-
net/l2tpv3.c              | 17 +++++------------
net/socket.c              | 16 +++++++---------
net/tap-bsd.c             |  6 +++---
net/tap-linux.c           |  2 +-
net/tap-solaris.c         |  8 ++++----
net/tap.c                 | 10 +++-------
os-posix.c                |  2 +-
qga/commands-posix.c      |  4 +---
semihosting/syscalls.c    |  4 +---
tests/qtest/libqtest.c    | 14 ++++++--------
tests/vhost-user-bridge.c |  4 +---
util/main-loop.c          |  4 +---
util/osdep.c              |  4 +---
util/vfio-helpers.c       | 12 ++++++------
20 files changed, 73 insertions(+), 101 deletions(-)
[PATCH v4 0/2] Refactoring: expand usage of TFR() macro
Posted by Nikita Ivanov 1 year, 6 months ago
At the moment, TFR() macro has a vague name and is not used
where it possibly could be. In order to make it more transparent
and useful, it was decided to refactor it to make it closer to
the similar one in glibc: TEMP_FAILURE_RETRY(). Now, macro
evaluates into an expression and is named RETRY_ON_EINTR(). All the
places where RETRY_ON_EINTR() macro code be applied were covered.

Nikita Ivanov (2):
  Refactoring: refactor TFR() macro to RETRY_ON_EINTR()
  error handling: Use RETRY_ON_EINTR() macro where applicable

 block/file-posix.c        | 37 ++++++++++++++++---------------------
 chardev/char-fd.c         |  2 +-
 chardev/char-pipe.c       |  8 +++++---
 chardev/char-pty.c        |  4 +---
 hw/9pfs/9p-local.c        |  8 ++------
 include/qemu/osdep.h      |  8 +++++++-
 net/l2tpv3.c              | 17 +++++------------
 net/socket.c              | 16 +++++++---------
 net/tap-bsd.c             |  6 +++---
 net/tap-linux.c           |  2 +-
 net/tap-solaris.c         |  8 ++++----
 net/tap.c                 | 10 +++-------
 os-posix.c                |  2 +-
 qga/commands-posix.c      |  4 +---
 semihosting/syscalls.c    |  4 +---
 tests/qtest/libqtest.c    | 14 ++++++--------
 tests/vhost-user-bridge.c |  4 +---
 util/main-loop.c          |  4 +---
 util/osdep.c              |  4 +---
 util/vfio-helpers.c       | 12 ++++++------
 20 files changed, 73 insertions(+), 101 deletions(-)

-- 
2.37.3
Re: [PATCH v4 0/2] Refactoring: expand usage of TFR() macro
Posted by Nikita Ivanov 1 year, 6 months ago
Hi!
Is there any update on this? I haven't received any comments.

On Sun, Oct 23, 2022 at 12:04 PM Nikita Ivanov <nivanov@cloudlinux.com>
wrote:

> At the moment, TFR() macro has a vague name and is not used
> where it possibly could be. In order to make it more transparent
> and useful, it was decided to refactor it to make it closer to
> the similar one in glibc: TEMP_FAILURE_RETRY(). Now, macro
> evaluates into an expression and is named RETRY_ON_EINTR(). All the
> places where RETRY_ON_EINTR() macro code be applied were covered.
>
> Nikita Ivanov (2):
>   Refactoring: refactor TFR() macro to RETRY_ON_EINTR()
>   error handling: Use RETRY_ON_EINTR() macro where applicable
>
>  block/file-posix.c        | 37 ++++++++++++++++---------------------
>  chardev/char-fd.c         |  2 +-
>  chardev/char-pipe.c       |  8 +++++---
>  chardev/char-pty.c        |  4 +---
>  hw/9pfs/9p-local.c        |  8 ++------
>  include/qemu/osdep.h      |  8 +++++++-
>  net/l2tpv3.c              | 17 +++++------------
>  net/socket.c              | 16 +++++++---------
>  net/tap-bsd.c             |  6 +++---
>  net/tap-linux.c           |  2 +-
>  net/tap-solaris.c         |  8 ++++----
>  net/tap.c                 | 10 +++-------
>  os-posix.c                |  2 +-
>  qga/commands-posix.c      |  4 +---
>  semihosting/syscalls.c    |  4 +---
>  tests/qtest/libqtest.c    | 14 ++++++--------
>  tests/vhost-user-bridge.c |  4 +---
>  util/main-loop.c          |  4 +---
>  util/osdep.c              |  4 +---
>  util/vfio-helpers.c       | 12 ++++++------
>  20 files changed, 73 insertions(+), 101 deletions(-)
>
> --
> 2.37.3
>
>

-- 
Best Regards,
*Nikita Ivanov* | C developer
*Telephone:* +79140870696
*Telephone:* +79015053149
Re: [PATCH v4 0/2] Refactoring: expand usage of TFR() macro
Posted by Thomas Huth 1 year, 3 months ago
On 02/11/2022 21.30, Nikita Ivanov wrote:
> Hi!
> Is there any update on this? I haven't received any comments.

Sorry, seems like this fell through the cracks since it was not quite clear 
which maintainer should pick it up. I'll take the patches for my next pull 
request.

  Thomas


> On Sun, Oct 23, 2022 at 12:04 PM Nikita Ivanov <nivanov@cloudlinux.com 
> <mailto:nivanov@cloudlinux.com>> wrote:
> 
>     At the moment, TFR() macro has a vague name and is not used
>     where it possibly could be. In order to make it more transparent
>     and useful, it was decided to refactor it to make it closer to
>     the similar one in glibc: TEMP_FAILURE_RETRY(). Now, macro
>     evaluates into an expression and is named RETRY_ON_EINTR(). All the
>     places where RETRY_ON_EINTR() macro code be applied were covered.
> 
>     Nikita Ivanov (2):
>        Refactoring: refactor TFR() macro to RETRY_ON_EINTR()
>        error handling: Use RETRY_ON_EINTR() macro where applicable
> 
>       block/file-posix.c        | 37 ++++++++++++++++---------------------
>       chardev/char-fd.c         |  2 +-
>       chardev/char-pipe.c       |  8 +++++---
>       chardev/char-pty.c        |  4 +---
>       hw/9pfs/9p-local.c        |  8 ++------
>       include/qemu/osdep.h      |  8 +++++++-
>       net/l2tpv3.c              | 17 +++++------------
>       net/socket.c              | 16 +++++++---------
>       net/tap-bsd.c             |  6 +++---
>       net/tap-linux.c           |  2 +-
>       net/tap-solaris.c         |  8 ++++----
>       net/tap.c                 | 10 +++-------
>       os-posix.c                |  2 +-
>       qga/commands-posix.c      |  4 +---
>       semihosting/syscalls.c    |  4 +---
>       tests/qtest/libqtest.c    | 14 ++++++--------
>       tests/vhost-user-bridge.c |  4 +---
>       util/main-loop.c          |  4 +---
>       util/osdep.c              |  4 +---
>       util/vfio-helpers.c       | 12 ++++++------
>       20 files changed, 73 insertions(+), 101 deletions(-)
> 
>     -- 
>     2.37.3
> 
> 
> 
> -- 
> Best Regards,
> *Nikita Ivanov* | C developer
> *Telephone:* +79140870696
> *Telephone:* +79015053149