mirror of https://github.com/xqemu/xqemu.git
raw-posix: Use DPRINTF for DEBUG_FLOPPY
Get rid of several #ifdef DEBUG_FLOPPY and substitute them with DPRINTF. Signed-off-by: Dimitris Aragiorgis <dimara@arrikto.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1435056300-14924-5-git-send-email-dimara@arrikto.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
bcb225550d
commit
a93a3982a6
|
@ -96,8 +96,6 @@
|
||||||
#include <xfs/xfs.h>
|
#include <xfs/xfs.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#define DEBUG_FLOPPY
|
|
||||||
|
|
||||||
//#define DEBUG_BLOCK
|
//#define DEBUG_BLOCK
|
||||||
|
|
||||||
#ifdef 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_clock_get_ns(QEMU_CLOCK_REALTIME) - s->fd_open_time) >= FD_OPEN_TIMEOUT) {
|
||||||
qemu_close(s->fd);
|
qemu_close(s->fd);
|
||||||
s->fd = -1;
|
s->fd = -1;
|
||||||
#ifdef DEBUG_FLOPPY
|
DPRINTF("Floppy closed\n");
|
||||||
printf("Floppy closed\n");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
if (s->fd < 0) {
|
if (s->fd < 0) {
|
||||||
if (s->fd_got_error &&
|
if (s->fd_got_error &&
|
||||||
(qemu_clock_get_ns(QEMU_CLOCK_REALTIME) - s->fd_error_time) < FD_OPEN_TIMEOUT) {
|
(qemu_clock_get_ns(QEMU_CLOCK_REALTIME) - s->fd_error_time) < FD_OPEN_TIMEOUT) {
|
||||||
#ifdef DEBUG_FLOPPY
|
DPRINTF("No floppy (open delayed)\n");
|
||||||
printf("No floppy (open delayed)\n");
|
|
||||||
#endif
|
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
s->fd = qemu_open(bs->filename, s->open_flags & ~O_NONBLOCK);
|
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;
|
s->fd_got_error = 1;
|
||||||
if (last_media_present)
|
if (last_media_present)
|
||||||
s->fd_media_changed = 1;
|
s->fd_media_changed = 1;
|
||||||
#ifdef DEBUG_FLOPPY
|
DPRINTF("No floppy\n");
|
||||||
printf("No floppy\n");
|
|
||||||
#endif
|
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
#ifdef DEBUG_FLOPPY
|
DPRINTF("Floppy opened\n");
|
||||||
printf("Floppy opened\n");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
if (!last_media_present)
|
if (!last_media_present)
|
||||||
s->fd_media_changed = 1;
|
s->fd_media_changed = 1;
|
||||||
|
@ -2465,9 +2455,7 @@ static int floppy_media_changed(BlockDriverState *bs)
|
||||||
fd_open(bs);
|
fd_open(bs);
|
||||||
ret = s->fd_media_changed;
|
ret = s->fd_media_changed;
|
||||||
s->fd_media_changed = 0;
|
s->fd_media_changed = 0;
|
||||||
#ifdef DEBUG_FLOPPY
|
DPRINTF("Floppy changed=%d\n", ret);
|
||||||
printf("Floppy changed=%d\n", ret);
|
|
||||||
#endif
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue