diff options
author | Peter Lieven <pl@kamp.de> | 2013-10-24 12:06:55 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2013-11-28 10:30:51 +0100 |
commit | 186d4f2b1deaae5c404798959bfbdb781e762045 (patch) | |
tree | 04ff6d2b10a058fc679b2ecae15731184a3ec59e /block | |
parent | 4ce786914b745a144a9eda1ea33f3ff98328c527 (diff) |
block/iscsi: add .bdrv_get_info
Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/iscsi.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/block/iscsi.c b/block/iscsi.c index a2d578c0a7..3095887a27 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -1506,6 +1506,14 @@ out: return ret; } +static int iscsi_get_info(BlockDriverState *bs, BlockDriverInfo *bdi) +{ + IscsiLun *iscsilun = bs->opaque; + bdi->unallocated_blocks_are_zero = !!iscsilun->lbprz; + bdi->can_write_zeroes_with_unmap = iscsilun->lbprz && iscsilun->lbp.lbpws; + return 0; +} + static QEMUOptionParameter iscsi_create_options[] = { { .name = BLOCK_OPT_SIZE, @@ -1527,6 +1535,7 @@ static BlockDriver bdrv_iscsi = { .create_options = iscsi_create_options, .bdrv_getlength = iscsi_getlength, + .bdrv_get_info = iscsi_get_info, .bdrv_truncate = iscsi_truncate, #if defined(LIBISCSI_FEATURE_IOVECTOR) |