From: Kevin Wolf <kwolf@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Anthony Liguori" <aliguori@us.ibm.com>,
patches@linaro.org, "Alexander Graf" <agraf@suse.de>,
qemu-devel@nongnu.org, "Andreas Färber" <andreas.faerber@web.de>,
qemu-ppc@nongnu.org, "Stefan Hajnoczi" <stefanha@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
morita.kazutaka@lab.ntt.co.jp,
"Richard Henderson" <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH 1/4] block/sheepdog: Rename 'dprintf' to 'DPRINTF'
Date: Mon, 29 Jul 2013 14:44:16 +0200 [thread overview]
Message-ID: <20130729124416.GC10467@dhcp-200-207.str.redhat.com> (raw)
In-Reply-To: <1375100199-13934-2-git-send-email-peter.maydell@linaro.org>
Am 29.07.2013 um 14:16 hat Peter Maydell geschrieben:
> 'dprintf' is the name of a POSIX standard function so we should not be
> stealing it for our debug macro. Rename to 'DPRINTF' (in line with
> a number of other source files.)
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Kevin Wolf <kwolf@redhat.com>
(CCed Kazutaka in case he has any objections, unexpectedly)
> ---
> block/sheepdog.c | 30 +++++++++++++++---------------
> 1 file changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/block/sheepdog.c b/block/sheepdog.c
> index 6a41ad9..a506137 100644
> --- a/block/sheepdog.c
> +++ b/block/sheepdog.c
> @@ -242,14 +242,14 @@ static inline bool is_snapshot(struct SheepdogInode *inode)
> return !!inode->snap_ctime;
> }
>
> -#undef dprintf
> +#undef DPRINTF
> #ifdef DEBUG_SDOG
> -#define dprintf(fmt, args...) \
> +#define DPRINTF(fmt, args...) \
> do { \
> fprintf(stdout, "%s %d: " fmt, __func__, __LINE__, ##args); \
> } while (0)
> #else
> -#define dprintf(fmt, args...)
> +#define DPRINTF(fmt, args...)
> #endif
>
> typedef struct SheepdogAIOCB SheepdogAIOCB;
> @@ -729,7 +729,7 @@ static void coroutine_fn aio_read_response(void *opaque)
> break;
> case AIOCB_FLUSH_CACHE:
> if (rsp.result == SD_RES_INVALID_PARMS) {
> - dprintf("disable cache since the server doesn't support it\n");
> + DPRINTF("disable cache since the server doesn't support it\n");
> s->cache_flags = SD_FLAG_CMD_DIRECT;
> rsp.result = SD_RES_SUCCESS;
> }
> @@ -1229,7 +1229,7 @@ static int coroutine_fn resend_aioreq(BDRVSheepdogState *s, AIOReq *aio_req)
> * the same object */
> QLIST_FOREACH(areq, &s->inflight_aio_head, aio_siblings) {
> if (areq != aio_req && areq->oid == aio_req->oid) {
> - dprintf("simultaneous CoW to %" PRIx64 "\n", aio_req->oid);
> + DPRINTF("simultaneous CoW to %" PRIx64 "\n", aio_req->oid);
> QLIST_REMOVE(aio_req, aio_siblings);
> QLIST_INSERT_HEAD(&s->pending_aio_head, aio_req, aio_siblings);
> return SD_RES_SUCCESS;
> @@ -1319,7 +1319,7 @@ static int sd_open(BlockDriverState *bs, QDict *options, int flags)
> s->discard_supported = true;
>
> if (snapid || tag[0] != '\0') {
> - dprintf("%" PRIx32 " snapshot inode was open.\n", vid);
> + DPRINTF("%" PRIx32 " snapshot inode was open.\n", vid);
> s->is_snapshot = true;
> }
>
> @@ -1554,7 +1554,7 @@ static void sd_close(BlockDriverState *bs)
> unsigned int wlen, rlen = 0;
> int fd, ret;
>
> - dprintf("%s\n", s->name);
> + DPRINTF("%s\n", s->name);
>
> fd = connect_to_sdog(s);
> if (fd < 0) {
> @@ -1714,7 +1714,7 @@ static int sd_create_branch(BDRVSheepdogState *s)
> char *buf;
> bool deleted;
>
> - dprintf("%" PRIx32 " is snapshot.\n", s->inode.vdi_id);
> + DPRINTF("%" PRIx32 " is snapshot.\n", s->inode.vdi_id);
>
> buf = g_malloc(SD_INODE_SIZE);
>
> @@ -1730,7 +1730,7 @@ static int sd_create_branch(BDRVSheepdogState *s)
> goto out;
> }
>
> - dprintf("%" PRIx32 " is created.\n", vid);
> + DPRINTF("%" PRIx32 " is created.\n", vid);
>
> fd = connect_to_sdog(s);
> if (fd < 0) {
> @@ -1751,7 +1751,7 @@ static int sd_create_branch(BDRVSheepdogState *s)
>
> s->is_snapshot = false;
> ret = 0;
> - dprintf("%" PRIx32 " was newly created.\n", s->inode.vdi_id);
> + DPRINTF("%" PRIx32 " was newly created.\n", s->inode.vdi_id);
>
> out:
> g_free(buf);
> @@ -1841,11 +1841,11 @@ static int coroutine_fn sd_co_rw_vector(void *p)
> }
>
> if (create) {
> - dprintf("update ino (%" PRIu32 ") %" PRIu64 " %" PRIu64 " %ld\n",
> + DPRINTF("update ino (%" PRIu32 ") %" PRIu64 " %" PRIu64 " %ld\n",
> inode->vdi_id, oid,
> vid_to_data_oid(inode->data_vdi_id[idx], idx), idx);
> oid = vid_to_data_oid(inode->vdi_id, idx);
> - dprintf("new oid %" PRIx64 "\n", oid);
> + DPRINTF("new oid %" PRIx64 "\n", oid);
> }
>
> aio_req = alloc_aio_req(s, acb, oid, len, offset, flags, old_oid, done);
> @@ -1978,7 +1978,7 @@ static int sd_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
> SheepdogInode *inode;
> unsigned int datalen;
>
> - dprintf("sn_info: name %s id_str %s s: name %s vm_state_size %" PRId64 " "
> + DPRINTF("sn_info: name %s id_str %s s: name %s vm_state_size %" PRId64 " "
> "is_snapshot %d\n", sn_info->name, sn_info->id_str,
> s->name, sn_info->vm_state_size, s->is_snapshot);
>
> @@ -1989,7 +1989,7 @@ static int sd_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
> return -EINVAL;
> }
>
> - dprintf("%s %s\n", sn_info->name, sn_info->id_str);
> + DPRINTF("%s %s\n", sn_info->name, sn_info->id_str);
>
> s->inode.vm_state_size = sn_info->vm_state_size;
> s->inode.vm_clock_nsec = sn_info->vm_clock_nsec;
> @@ -2033,7 +2033,7 @@ static int sd_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
> }
>
> memcpy(&s->inode, inode, datalen);
> - dprintf("s->inode: name %s snap_id %x oid %x\n",
> + DPRINTF("s->inode: name %s snap_id %x oid %x\n",
> s->inode.name, s->inode.snap_id, s->inode.vdi_id);
>
> cleanup:
> --
> 1.7.9.5
>
next prev parent reply other threads:[~2013-07-29 12:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-29 12:16 [Qemu-devel] [PATCH 0/4] Rename all 'dprintf' macros to 'DPRINTF' Peter Maydell
2013-07-29 12:16 ` [Qemu-devel] [PATCH 1/4] block/sheepdog: Rename 'dprintf' " Peter Maydell
2013-07-29 12:44 ` Kevin Wolf [this message]
2013-07-29 23:39 ` MORITA Kazutaka
2013-07-29 12:16 ` [Qemu-devel] [PATCH 2/4] s390x: " Peter Maydell
2013-07-29 12:16 ` [Qemu-devel] [PATCH 3/4] target-ppc/kvm.c: " Peter Maydell
2013-07-29 12:16 ` [Qemu-devel] [PATCH 4/4] spapr: " Peter Maydell
2013-07-29 16:38 ` [Qemu-devel] [PATCH 0/4] Rename all 'dprintf' macros " Richard Henderson
2013-07-29 17:34 ` Andreas Färber
2013-08-02 12:35 ` Anthony Liguori
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=20130729124416.GC10467@dhcp-200-207.str.redhat.com \
--to=kwolf@redhat.com \
--cc=agraf@suse.de \
--cc=aliguori@us.ibm.com \
--cc=andreas.faerber@web.de \
--cc=morita.kazutaka@lab.ntt.co.jp \
--cc=patches@linaro.org \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=rth@twiddle.net \
--cc=stefanha@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).