[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v5 4/5] raw-posix: Use DPRINTF for DEBUG_FLOPPY
From: |
Dimitris Aragiorgis |
Subject: |
[Qemu-devel] [PATCH v5 4/5] raw-posix: Use DPRINTF for DEBUG_FLOPPY |
Date: |
Tue, 23 Jun 2015 13:44:59 +0300 |
Get rid of several #ifdef DEBUG_FLOPPY and substitute them with
DPRINTF.
Signed-off-by: Dimitris Aragiorgis <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
---
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 60b5ef7..69ae251 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
@@ -2170,16 +2168,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);
@@ -2188,14 +2182,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;
@@ -2463,9 +2453,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
- [Qemu-devel] [PATCH v5 0/5] Some fixes related to scsi-generic, Dimitris Aragiorgis, 2015/06/23
- [Qemu-devel] [PATCH v5 2/5] Fix migration in case of scsi-generic, Dimitris Aragiorgis, 2015/06/23
- [Qemu-devel] [PATCH v5 3/5] raw-posix: DPRINTF instead of DEBUG_BLOCK_PRINT, Dimitris Aragiorgis, 2015/06/23
- [Qemu-devel] [PATCH v5 4/5] raw-posix: Use DPRINTF for DEBUG_FLOPPY,
Dimitris Aragiorgis <=
- [Qemu-devel] [PATCH v5 1/5] block: Use bdrv_is_sg() everywhere, Dimitris Aragiorgis, 2015/06/23
- [Qemu-devel] [PATCH v5 5/5] raw-posix: Introduce hdev_is_sg(), Dimitris Aragiorgis, 2015/06/23
- Re: [Qemu-devel] [PATCH v5 0/5] Some fixes related to scsi-generic, Stefan Hajnoczi, 2015/06/23