qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Dimitris Aragiorgis <dimara@arrikto.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, pbonzini@redhat.com, stefanha@redhat.com,
	qemu-block@nongnu.org
Subject: [Qemu-devel] [PATCH v4 4/5] raw-posix: Use DPRINTF for DEBUG_FLOPPY
Date: Wed, 20 May 2015 12:57:38 +0300	[thread overview]
Message-ID: <1432115859-11413-5-git-send-email-dimara@arrikto.com> (raw)
In-Reply-To: <1432115859-11413-1-git-send-email-dimara@arrikto.com>

Get rid of several #ifdef DEBUG_FLOPPY and substitute them with
DPRINTF.

Signed-off-by: Dimitris Aragiorgis <dimara@arrikto.com>
---
 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 438bf0b..ace228f 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -94,8 +94,6 @@
 #include <xfs/xfs.h>
 #endif
 
-//#define DEBUG_FLOPPY
-
 //#define DEBUG_BLOCK
 
 #ifdef DEBUG_BLOCK
@@ -2167,16 +2165,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);
@@ -2185,14 +2179,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;
@@ -2460,9 +2450,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;
 }
 
-- 
1.7.10.4

  parent reply	other threads:[~2015-05-20  9:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-20  9:57 [Qemu-devel] [PATCH v4 0/5] Some fixes related to scsi-generic Dimitris Aragiorgis
2015-05-20  9:57 ` [Qemu-devel] [PATCH v4 1/5] block: Use bdrv_is_sg() everywhere Dimitris Aragiorgis
2015-06-19 12:18   ` Stefan Hajnoczi
2015-05-20  9:57 ` [Qemu-devel] [PATCH v4 2/5] Fix migration in case of scsi-generic Dimitris Aragiorgis
2015-06-19 12:23   ` Stefan Hajnoczi
2015-05-20  9:57 ` [Qemu-devel] [PATCH v4 3/5] raw-posix: DPRINTF instead of DEBUG_BLOCK_PRINT Dimitris Aragiorgis
2015-06-18 20:05   ` Eric Blake
2015-06-19 12:25   ` Stefan Hajnoczi
2015-05-20  9:57 ` Dimitris Aragiorgis [this message]
2015-06-18 20:14   ` [Qemu-devel] [PATCH v4 4/5] raw-posix: Use DPRINTF for DEBUG_FLOPPY Eric Blake
2015-06-19 12:25   ` Stefan Hajnoczi
2015-05-20  9:57 ` [Qemu-devel] [PATCH v4 5/5] raw-posix: Introduce hdev_is_sg() Dimitris Aragiorgis
2015-06-18 20:16   ` Eric Blake
2015-06-19 12:33   ` Stefan Hajnoczi
2015-06-22 10:18     ` Dimitris Aragiorgis
2015-06-22 12:33       ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2015-05-29  5:15 ` [Qemu-devel] [PATCH v4 0/5] Some fixes related to scsi-generic Dimitris Aragiorgis
2015-06-18 11:07   ` Dimitris Aragiorgis

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=1432115859-11413-5-git-send-email-dimara@arrikto.com \
    --to=dimara@arrikto.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --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).