summaryrefslogtreecommitdiffstats
path: root/block.c
diff options
context:
space:
mode:
Diffstat (limited to 'block.c')
-rw-r--r--block.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/block.c b/block.c
index 3c70399..1cb943b 100644
--- a/block.c
+++ b/block.c
@@ -21,7 +21,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+#ifdef QEMU_IMG
+#include "qemu-common.h"
+#else
#include "vl.h"
+#endif
#include "block_int.h"
#ifdef _BSD
@@ -53,7 +57,7 @@ static int bdrv_read_em(BlockDriverState *bs, int64_t sector_num,
static int bdrv_write_em(BlockDriverState *bs, int64_t sector_num,
const uint8_t *buf, int nb_sectors);
-static BlockDriverState *bdrv_first;
+BlockDriverState *bdrv_first;
static BlockDriver *first_drv;
int path_is_absolute(const char *path)
@@ -859,6 +863,7 @@ void bdrv_flush(BlockDriverState *bs)
bdrv_flush(bs->backing_hd);
}
+#ifndef QEMU_IMG
void bdrv_info(void)
{
BlockDriverState *bs;
@@ -898,6 +903,7 @@ void bdrv_info(void)
term_printf("\n");
}
}
+#endif
void bdrv_get_backing_filename(BlockDriverState *bs,
char *filename, int filename_size)
@@ -1102,7 +1108,7 @@ void bdrv_aio_cancel(BlockDriverAIOCB *acb)
/**************************************************************/
/* async block device emulation */
-#ifdef QEMU_TOOL
+#ifdef QEMU_IMG
static BlockDriverAIOCB *bdrv_aio_read_em(BlockDriverState *bs,
int64_t sector_num, uint8_t *buf, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque)
@@ -1172,7 +1178,7 @@ static void bdrv_aio_cancel_em(BlockDriverAIOCB *blockacb)
qemu_bh_cancel(acb->bh);
qemu_aio_release(acb);
}
-#endif /* !QEMU_TOOL */
+#endif /* !QEMU_IMG */
/**************************************************************/
/* sync block device emulation */
OpenPOWER on IntegriCloud