aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
Diffstat (limited to 'block.c')
-rw-r--r--block.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/block.c b/block.c
index 4da3bcba16..dd40b565c8 100644
--- a/block.c
+++ b/block.c
@@ -1146,6 +1146,26 @@ int bdrv_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
return drv->bdrv_get_info(bs, bdi);
}
+int bdrv_put_buffer(BlockDriverState *bs, const uint8_t *buf, int64_t pos, int size)
+{
+ BlockDriver *drv = bs->drv;
+ if (!drv)
+ return -ENOMEDIUM;
+ if (!drv->bdrv_put_buffer)
+ return -ENOTSUP;
+ return drv->bdrv_put_buffer(bs, buf, pos, size);
+}
+
+int bdrv_get_buffer(BlockDriverState *bs, uint8_t *buf, int64_t pos, int size)
+{
+ BlockDriver *drv = bs->drv;
+ if (!drv)
+ return -ENOMEDIUM;
+ if (!drv->bdrv_get_buffer)
+ return -ENOTSUP;
+ return drv->bdrv_get_buffer(bs, buf, pos, size);
+}
+
/**************************************************************/
/* handling of snapshots */