[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 2/6] qapi: Introduce add-fd, remove-fd, query
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v6 2/6] qapi: Introduce add-fd, remove-fd, query-fdsets |
Date: |
Wed, 8 Aug 2012 09:52:20 +0100 |
On Tue, Aug 7, 2012 at 8:59 PM, Corey Bryant <address@hidden> wrote:
>
>
> On 08/07/2012 02:16 PM, Stefan Hajnoczi wrote:
>>
>> On Fri, Aug 3, 2012 at 6:28 PM, Corey Bryant <address@hidden>
>> wrote:
>>> + snprintf(fd_str, sizeof(fd_str), "%ld", fd);
>>> + qerror_report(QERR_FD_NOT_FOUND, fd_str);
>>
>>
>> Why use an fd_str instead of passing an int64_t into the error
>> message? This also assumed sizeof(long) == 8, which isn't true on
>> 32-bit hosts, so %ld should be %"PRId64".
>
>
> Can I pass an int64_t into the message if it takes a string?
>
> I thought int64_t was a long long in 32-bit mode, but perhaps that's not
> always the case?
The PRId64 format specifier macro from the C standard hides this so
you can pass int64_t values to printf()-style functions in a portable
way.
Stefan
- [Qemu-devel] [PATCH v6 3/6] monitor: Clean up fd sets on monitor disconnect, (continued)
- [Qemu-devel] [PATCH v6 3/6] monitor: Clean up fd sets on monitor disconnect, Corey Bryant, 2012/08/03
- [Qemu-devel] [PATCH v6 5/6] block: Convert close calls to qemu_close, Corey Bryant, 2012/08/03
- [Qemu-devel] [PATCH v6 6/6] block: Enable qemu_open/close to work with fd sets, Corey Bryant, 2012/08/03
- [Qemu-devel] [PATCH v6 1/6] qemu-char: Add MSG_CMSG_CLOEXEC flag to recvmsg, Corey Bryant, 2012/08/03
- [Qemu-devel] [PATCH v6 2/6] qapi: Introduce add-fd, remove-fd, query-fdsets, Corey Bryant, 2012/08/03
- Re: [Qemu-devel] [PATCH v6 2/6] qapi: Introduce add-fd, remove-fd, query-fdsets, Stefan Hajnoczi, 2012/08/07
- Re: [Qemu-devel] [PATCH v6 2/6] qapi: Introduce add-fd, remove-fd, query-fdsets, Corey Bryant, 2012/08/07
- Re: [Qemu-devel] [PATCH v6 2/6] qapi: Introduce add-fd, remove-fd, query-fdsets,
Stefan Hajnoczi <=
- Re: [Qemu-devel] [PATCH v6 2/6] qapi: Introduce add-fd, remove-fd, query-fdsets, Corey Bryant, 2012/08/08
[Qemu-devel] [PATCH v6 4/6] block: Convert open calls to qemu_open, Corey Bryant, 2012/08/03