Skip to content

Commit

Permalink
block/iscsi: add .bdrv_get_info
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
  • Loading branch information
plieven authored and kevmw committed Nov 28, 2013
1 parent 4ce7869 commit 186d4f2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions block/iscsi.c
Expand Up @@ -1506,6 +1506,14 @@ static int iscsi_create(const char *filename, QEMUOptionParameter *options,
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,
Expand All @@ -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)
Expand Down

0 comments on commit 186d4f2

Please sign in to comment.