block/iscsi: add .bdrv_get_info
Signed-off-by: Peter Lieven <pl@kamp.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
4ce786914b
commit
186d4f2b1d
@ -1506,6 +1506,14 @@ out:
|
|||||||
return ret;
|
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[] = {
|
static QEMUOptionParameter iscsi_create_options[] = {
|
||||||
{
|
{
|
||||||
.name = BLOCK_OPT_SIZE,
|
.name = BLOCK_OPT_SIZE,
|
||||||
@ -1527,6 +1535,7 @@ static BlockDriver bdrv_iscsi = {
|
|||||||
.create_options = iscsi_create_options,
|
.create_options = iscsi_create_options,
|
||||||
|
|
||||||
.bdrv_getlength = iscsi_getlength,
|
.bdrv_getlength = iscsi_getlength,
|
||||||
|
.bdrv_get_info = iscsi_get_info,
|
||||||
.bdrv_truncate = iscsi_truncate,
|
.bdrv_truncate = iscsi_truncate,
|
||||||
|
|
||||||
#if defined(LIBISCSI_FEATURE_IOVECTOR)
|
#if defined(LIBISCSI_FEATURE_IOVECTOR)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user