All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: elena.ufimtseva@oracle.com,  jag.raman@oracle.com
Cc: "Dr. David Alan Gilbert" <dave@treblig.org>,  qemu-devel@nongnu.org
Subject: Re: [PATCH 12/14] error: Use error_setg_errno() for simplicity and consistency
Date: Fri, 21 Nov 2025 08:42:02 +0100	[thread overview]
Message-ID: <873467q1bp.fsf@pond.sub.org> (raw)
In-Reply-To: <87jyzkq6mx.fsf@pond.sub.org> (Markus Armbruster's message of "Fri, 21 Nov 2025 06:47:18 +0100")

Cc: trimmed

Markus Armbruster <armbru@redhat.com> writes:

> "Dr. David Alan Gilbert" <dave@treblig.org> writes:
>
>> * Markus Armbruster (armbru@redhat.com) wrote:
>>> Use error_setg_errno() instead of passing the value of strerror() or
>>> g_strerror() to error_setg().
>>> 
>>> The separator between the error message proper and the value of
>>> strerror() changes from " : ", "", " - ", "- " to ": " in places.
>>> 
>>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>>
>>> @@ -792,9 +792,9 @@ static void vfu_object_init_ctx(VfuObject *o, Error **errp)
>>>                             VFU_REGION_FLAG_RW | VFU_REGION_FLAG_ALWAYS_CB,
>>>                             NULL, 0, -1, 0);
>>>      if (ret < 0) {
>>> -        error_setg(errp,
>>> -                   "vfu: Failed to setup config space handlers for %s- %s",
>>> -                   o->device, strerror(errno));
>>> +        error_setg_errno(errp,
>>> +                         "vfu: Failed to setup config space handlers for %s",
>>> +                         o->device);
>>
>> missing errno.
>
> Yes.
>
>>>          goto fail;
>>>      }
>>>  
>>> @@ -822,8 +822,8 @@ static void vfu_object_init_ctx(VfuObject *o, Error **errp)
>>>  
>>>      ret = vfu_realize_ctx(o->vfu_ctx);
>>>      if (ret < 0) {
>>> -        error_setg(errp, "vfu: Failed to realize device %s- %s",
>>> -                   o->device, strerror(errno));
>>> +        error_setg_errno(errp, "vfu: Failed to realize device %s",
>>> +                         o->device);
>>
>> missing errno.
>
> Yes.  Another file my build tree doesn't compile anymore.  Will fix,
> thanks!
>
> [...]

To include it in the build, I need to pass --enable-vfio-user-server to
configure, then install the libaries configure asked for.

Build then fails for me:

    FAILED: subprojects/libvfio-user/test/unit_tests.p/unit-tests.c.o 
    cc -m64 -Isubprojects/libvfio-user/test/unit_tests.p -Isubprojects/libvfio-user/test -I../subprojects/libvfio-user/test -Isubprojects/libvfio-user/include -I../subprojects/libvfio-user/include -Isubprojects/libvfio-user/lib -I../subprojects/libvfio-user/lib -I/usr/include/json-c -fdiagnostics-color=auto -Wall -Winvalid-pch -Wextra -Werror -std=gnu99 -O2 -g -DSTAP_SDT_V2 -mcx16 -msse2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fno-common -fwrapv -ftrivial-auto-var-init=zero -fzero-call-used-regs=used-gpr -fPIE -DUNIT_TEST -DWITH_TRAN_PIPE -D_GNU_SOURCE -Werror -DDEBUG -Wno-missing-field-initializers -Wmissing-declarations -Wwrite-strings -MD -MQ subprojects/libvfio-user/test/unit_tests.p/unit-tests.c.o -MF subprojects/libvfio-user/test/unit_tests.p/unit-tests.c.o.d -o subprojects/libvfio-user/test/unit_tests.p/unit-tests.c.o -c ../subprojects/libvfio-user/test/unit-tests.c
    ../subprojects/libvfio-user/test/unit-tests.c: In function ‘test_device_is_stopped_and_copying’:
    ../subprojects/libvfio-user/test/unit-tests.c:585:23: error: storing the address of local variable ‘migration’ in ‘vfu_ctx.migration’ [-Werror=dangling-pointer=]
      585 |     vfu_ctx.migration = &migration;
          |     ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
    ../subprojects/libvfio-user/test/unit-tests.c:584:22: note: ‘migration’ declared here
      584 |     struct migration migration;
          |                      ^~~~~~~~~
    ../subprojects/libvfio-user/test/unit-tests.c:62:18: note: ‘vfu_ctx’ declared here
       62 | static vfu_ctx_t vfu_ctx;
          |                  ^~~~~~~
    cc1: all warnings being treated as errors

and

    FAILED: subprojects/libvfio-user/lib/libvfio-user.so.0.0.1.p/libvfio-user.c.o 
    cc -m64 -Isubprojects/libvfio-user/lib/libvfio-user.so.0.0.1.p -Isubprojects/libvfio-user/lib -I../subprojects/libvfio-user/lib -Isubprojects/libvfio-user/include -I../subprojects/libvfio-user/include -I/usr/include/json-c -fvisibility=hidden -fdiagnostics-color=auto -Wall -Winvalid-pch -Wextra -Werror -std=gnu99 -O2 -g -DSTAP_SDT_V2 -mcx16 -msse2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fno-common -fwrapv -ftrivial-auto-var-init=zero -fzero-call-used-regs=used-gpr -fPIC -D_GNU_SOURCE -Werror -DDEBUG -Wno-missing-field-initializers -Wmissing-declarations -Wwrite-strings -MD -MQ subprojects/libvfio-user/lib/libvfio-user.so.0.0.1.p/libvfio-user.c.o -MF subprojects/libvfio-user/lib/libvfio-user.so.0.0.1.p/libvfio-user.c.o.d -o subprojects/libvfio-user/lib/libvfio-user.so.0.0.1.p/libvfio-user.c.o -c ../subprojects/libvfio-user/lib/libvfio-user.c
    ../subprojects/libvfio-user/lib/libvfio-user.c: In function ‘handle_device_get_region_io_fds’:
    ../subprojects/libvfio-user/lib/libvfio-user.c:617:38: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
      617 |         msg->out.fds = calloc(sizeof(int), max_sent_sub_regions);
          |                                      ^~~
    ../subprojects/libvfio-user/lib/libvfio-user.c:617:38: note: earlier argument should specify number of elements, later size of each element
    cc1: all warnings being treated as errors



  reply	other threads:[~2025-11-21  7:42 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-20 19:13 [PATCH 00/14] Error message improvements Markus Armbruster
2025-11-20 19:13 ` [PATCH 01/14] error: Strip trailing '\n' from error string arguments (again) Markus Armbruster
2025-11-20 19:13 ` [PATCH 02/14] hw/usb: Use error_setg_file_open() for a better error message Markus Armbruster
2025-11-21  0:42   ` Dr. David Alan Gilbert
2025-11-21  5:28     ` Markus Armbruster
2025-11-20 19:13 ` [PATCH 03/14] tap-solaris: Use error_setg_file_open() for better error messages Markus Armbruster
2025-11-21  0:24   ` Dr. David Alan Gilbert
2025-11-21  5:35     ` Markus Armbruster
2025-11-20 19:13 ` [PATCH 04/14] qga: " Markus Armbruster
2025-11-21  1:12   ` Dr. David Alan Gilbert
2025-11-21  7:39   ` Kostiantyn Kostiuk
2025-11-20 19:13 ` [PATCH 05/14] hw/scsi: Use error_setg_file_open() for a better error message Markus Armbruster
2025-11-21  2:05   ` Dr. David Alan Gilbert
2025-11-20 19:13 ` [PATCH 06/14] hw/virtio: " Markus Armbruster
2025-11-20 19:13 ` [PATCH 07/14] net/tap: " Markus Armbruster
2025-11-20 19:13 ` [PATCH 08/14] blkdebug: " Markus Armbruster
2025-11-20 19:13 ` [PATCH 09/14] error: Use error_setg_file_open() for simplicity and consistency Markus Armbruster
2025-11-20 23:57   ` Dr. David Alan Gilbert
2025-11-21  5:45     ` Markus Armbruster
2025-11-21 17:45       ` Dr. David Alan Gilbert
2025-11-22  7:36         ` Markus Armbruster
2025-11-22 11:53           ` BALATON Zoltan
2025-11-22 13:58             ` Dr. David Alan Gilbert
2025-11-20 19:13 ` [PATCH 10/14] net/slirp: Improve file open error message Markus Armbruster
2025-11-20 19:13 ` [PATCH 11/14] error: Use error_setg_errno() to improve error messages Markus Armbruster
2025-11-21  0:10   ` Dr. David Alan Gilbert
2025-11-21  5:46     ` Markus Armbruster
2025-11-21  7:37       ` Markus Armbruster
2025-11-20 19:13 ` [PATCH 12/14] error: Use error_setg_errno() for simplicity and consistency Markus Armbruster
2025-11-21  0:15   ` Dr. David Alan Gilbert
2025-11-21  5:47     ` Markus Armbruster
2025-11-21  7:42       ` Markus Armbruster [this message]
2025-11-20 19:13 ` [PATCH 13/14] qga/commands-win32: Use error_setg_win32() for better error messages Markus Armbruster
2025-11-21  7:43   ` Kostiantyn Kostiuk
2025-11-20 19:13 ` [PATCH 14/14] block/file-win32: Improve an error message Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=873467q1bp.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=dave@treblig.org \
    --cc=elena.ufimtseva@oracle.com \
    --cc=jag.raman@oracle.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.