[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v7 8/8] tpm: Added support for TPM emulator
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v7 8/8] tpm: Added support for TPM emulator |
Date: |
Tue, 26 Sep 2017 08:59:33 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 09/26/2017 07:05 AM, Valluri, Amarnath wrote:
>>> +
>>> +#define DPRINT(fmt, ...) do { \
>>> + if (DEBUG_TPM) { \
>>> + fprintf(stderr, fmt, ## __VA_ARGS__); \
>>> + } \
>>> +} while (0);
Do not include the trailing ';' directly in the macro definition. The
whole point of wrapping things in a do{}while(0) is so that you can do:
if (foo)
DPRINT(...);
else
...
(of course, that violates our coding style, as we require {} everywhere,
but it makes your macro appropriate for copying and pasting to other
projects that have different styles).
>>> + ret = qio_channel_read(tpm_pt->data_ioc, (char *)out, out_len,
>>> &err);
>>> + if (ret < 0 || err) {
>> read_all() ?
> The issue with read_all() is it does not return the no of bytes it
> read, so i would like to stict to _read()
But you KNOW the number of bytes read if read_all() succeeded - it read
as many bytes as you requested!
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v7 6/8] tpm-backend: Move realloc_buffer() implementation to tpm-tis model, (continued)
- [Qemu-devel] [PATCH v7 6/8] tpm-backend: Move realloc_buffer() implementation to tpm-tis model, Amarnath Valluri, 2017/09/22
- [Qemu-devel] [PATCH v7 7/8] tpm-passthrough: move reusable code to utils, Amarnath Valluri, 2017/09/22
- [Qemu-devel] [PATCH v7 8/8] tpm: Added support for TPM emulator, Amarnath Valluri, 2017/09/22
- Re: [Qemu-devel] [PATCH v7 8/8] tpm: Added support for TPM emulator, Stefan Berger, 2017/09/22
- Re: [Qemu-devel] [PATCH v7 8/8] tpm: Added support for TPM emulator, Marc-André Lureau, 2017/09/24
- Re: [Qemu-devel] [PATCH v7 8/8] tpm: Added support for TPM emulator, Stefan Berger, 2017/09/24
- Re: [Qemu-devel] [PATCH v7 8/8] tpm: Added support for TPM emulator, Valluri, Amarnath, 2017/09/26
- Re: [Qemu-devel] [PATCH v7 8/8] tpm: Added support for TPM emulator, Marc-André Lureau, 2017/09/26
- Re: [Qemu-devel] [PATCH v7 8/8] tpm: Added support for TPM emulator, Valluri, Amarnath, 2017/09/26
- Re: [Qemu-devel] [PATCH v7 8/8] tpm: Added support for TPM emulator, Marc-André Lureau, 2017/09/26
- Re: [Qemu-devel] [PATCH v7 8/8] tpm: Added support for TPM emulator,
Eric Blake <=
- [Qemu-devel] [PATCH v8 8/8] tpm: Added support for TPM emulator, Amarnath Valluri, 2017/09/27
- Re: [Qemu-devel] [PATCH v8 8/8] tpm: Added support for TPM emulator, Marc-André Lureau, 2017/09/27