2 * Copyright (c) 2010-2011 IBM
5 * Chunqiang Tang <ctang@us.ibm.com>
7 * This work is licensed under the terms of the GNU GPL, version 2.
8 * See the COPYING file in the top-level directory.
11 /*=============================================================================
12 * A short description: this header file contains functions of the FVD block
13 * device driver that are used by other external modules. These functions are
14 * mainly for testing and debugging urposes.
15 *============================================================================*/
17 #ifndef __fvd_debug_h__
18 #define __fvd_debug_h__
22 int fvd_get_copy_on_read (BlockDriverState
*bs
);
23 void fvd_set_copy_on_read (BlockDriverState
*bs
, int copy_on_read
);
24 void fvd_check_memory_usage (void);
25 void fvd_init_prefetch(void * bs
);
26 void fvd_enable_host_crash_test (void);
36 # define QDEBUG(format,...) do {} while (0)
37 # define ASSERT(x) do {} while (0)
38 # define FVD_DEBUG_ACB(...) do {} while (0)
39 # define QPAUSE(...) do {} while (0)
43 extern FILE *__fvd_debug_fp
;
44 void init_fvd_debug_fp (void);
45 void FVD_DEBUG_ACB (void *p
);
46 # define QDEBUG(format,...) \
48 if (__fvd_debug_fp==NULL) init_fvd_debug_fp(); \
49 fprintf (__fvd_debug_fp, format, ##__VA_ARGS__); \
50 fflush(__fvd_debug_fp); \
56 fprintf (stderr, "Assertion failed in process %d at %s:%d. " \
57 "Waiting for debugging...\n", getpid(),__FILE__, __LINE__); \
58 fgetc (stdin); exit (1); \
62 # define QPAUSE(format,...) \
64 printf (format, ##__VA_ARGS__); \
65 printf (" Pause process %d for debugging...\n", getpid()); \