aboutsummaryrefslogtreecommitdiff
path: root/include/qemu-io.h
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2015-02-05 13:58:22 -0500
committerStefan Hajnoczi <stefanha@redhat.com>2015-02-16 15:07:19 +0000
commit4c7b7e9b94b4e81aa85de7c13e209017fc7f61dc (patch)
treeb307324fa332dbd899f122ea832e1ff3af34710c /include/qemu-io.h
parent10d9d75ce4cfb568b4845d8c4d0e65968f740edf (diff)
qemu-io: Use BlockBackend
qemu-io should behave like a guest, therefore it should use BlockBackend to access the block layer. There are a couple of places where that is infeasible: First, the bdrv_debug_* functions could theoretically be mirrored in the BlockBackend, but since these are functions internal to the block layer, they should not be visible externally (qemu-io as a test tool is exempt from this). Second, bdrv_get_info() and bdrv_get_specific_info() work on a single BDS alone, therefore they should stay BDS-specific. Third, bdrv_is_allocated() mainly works on a single BDS as well. Some data may be passed through from the BDS's file (if sectors which are apparently allocated in the file are not really allocated there but just zero). [Fixed conflicts around block_acct_start() usage from Fam Zheng's "qemu-io: Account IO by aio_read and aio_write" commit. Use BlockBackend and blk_get_stats() instead of BlockDriverState. --Stefan] Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1423162705-32065-14-git-send-email-mreitz@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'include/qemu-io.h')
-rw-r--r--include/qemu-io.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/qemu-io.h b/include/qemu-io.h
index 5d6006f73b..4d402b9b01 100644
--- a/include/qemu-io.h
+++ b/include/qemu-io.h
@@ -22,7 +22,7 @@
#define CMD_FLAG_GLOBAL ((int)0x80000000) /* don't iterate "args" */
-typedef int (*cfunc_t)(BlockDriverState *bs, int argc, char **argv);
+typedef int (*cfunc_t)(BlockBackend *blk, int argc, char **argv);
typedef void (*helpfunc_t)(void);
typedef struct cmdinfo {
@@ -40,7 +40,7 @@ typedef struct cmdinfo {
extern bool qemuio_misalign;
-bool qemuio_command(BlockDriverState *bs, const char *cmd);
+bool qemuio_command(BlockBackend *blk, const char *cmd);
void qemuio_add_command(const cmdinfo_t *ci);
int qemuio_command_usage(const cmdinfo_t *ci);