From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7mbL-0004oV-FO for qemu-devel@nongnu.org; Wed, 24 Jun 2015 11:28:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7mbH-0006Qm-FG for qemu-devel@nongnu.org; Wed, 24 Jun 2015 11:28:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33537) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7mbH-0006Qg-Aj for qemu-devel@nongnu.org; Wed, 24 Jun 2015 11:28:31 -0400 From: Stefan Hajnoczi Date: Wed, 24 Jun 2015 16:28:02 +0100 Message-Id: <1435159686-14817-12-git-send-email-stefanha@redhat.com> In-Reply-To: <1435159686-14817-1-git-send-email-stefanha@redhat.com> References: <1435159686-14817-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PULL 11/15] raw-posix: Use DPRINTF for DEBUG_FLOPPY List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Peter Maydell , Dimitris Aragiorgis , Stefan Hajnoczi From: Dimitris Aragiorgis Get rid of several #ifdef DEBUG_FLOPPY and substitute them with DPRINTF. Signed-off-by: Dimitris Aragiorgis Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Message-id: 1435056300-14924-5-git-send-email-dimara@arrikto.com Signed-off-by: Stefan Hajnoczi --- block/raw-posix.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/block/raw-posix.c b/block/raw-posix.c index 23c4577..57a243f 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c @@ -96,8 +96,6 @@ #include #endif -//#define DEBUG_FLOPPY - //#define DEBUG_BLOCK #ifdef DEBUG_BLOCK @@ -2172,16 +2170,12 @@ static int fd_open(BlockDriverState *bs) (qemu_clock_get_ns(QEMU_CLOCK_REALTIME) - s->fd_open_time) >= FD_OPEN_TIMEOUT) { qemu_close(s->fd); s->fd = -1; -#ifdef DEBUG_FLOPPY - printf("Floppy closed\n"); -#endif + DPRINTF("Floppy closed\n"); } if (s->fd < 0) { if (s->fd_got_error && (qemu_clock_get_ns(QEMU_CLOCK_REALTIME) - s->fd_error_time) < FD_OPEN_TIMEOUT) { -#ifdef DEBUG_FLOPPY - printf("No floppy (open delayed)\n"); -#endif + DPRINTF("No floppy (open delayed)\n"); return -EIO; } s->fd = qemu_open(bs->filename, s->open_flags & ~O_NONBLOCK); @@ -2190,14 +2184,10 @@ static int fd_open(BlockDriverState *bs) s->fd_got_error = 1; if (last_media_present) s->fd_media_changed = 1; -#ifdef DEBUG_FLOPPY - printf("No floppy\n"); -#endif + DPRINTF("No floppy\n"); return -EIO; } -#ifdef DEBUG_FLOPPY - printf("Floppy opened\n"); -#endif + DPRINTF("Floppy opened\n"); } if (!last_media_present) s->fd_media_changed = 1; @@ -2465,9 +2455,7 @@ static int floppy_media_changed(BlockDriverState *bs) fd_open(bs); ret = s->fd_media_changed; s->fd_media_changed = 0; -#ifdef DEBUG_FLOPPY - printf("Floppy changed=%d\n", ret); -#endif + DPRINTF("Floppy changed=%d\n", ret); return ret; } -- 2.4.3