More fixes for QEMU 2.x :)
parent
a453db9c8e
commit
5fe3a40416
|
@ -312,7 +312,7 @@ static int vitastor_probe_blocksizes(BlockDriverState *bs, BlockSizes *bsz)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if QEMU_VERSION_MAJOR >= 3
|
#if QEMU_VERSION_MAJOR >= 3 || QEMU_VERSION_MAJOR == 2 && QEMU_VERSION_MINOR >= 12
|
||||||
static int coroutine_fn vitastor_co_create_opts(
|
static int coroutine_fn vitastor_co_create_opts(
|
||||||
#if QEMU_VERSION_MAJOR >= 4
|
#if QEMU_VERSION_MAJOR >= 4
|
||||||
BlockDriver *drv,
|
BlockDriver *drv,
|
||||||
|
@ -467,7 +467,7 @@ static int coroutine_fn vitastor_co_pwritev(BlockDriverState *bs, uint64_t offse
|
||||||
return task.ret;
|
return task.ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QEMU_VERSION_MAJOR < 3
|
#if !( QEMU_VERSION_MAJOR >= 3 || QEMU_VERSION_MAJOR == 2 && QEMU_VERSION_MINOR >= 7 )
|
||||||
static int coroutine_fn vitastor_co_readv(BlockDriverState *bs, int64_t sector_num, int nb_sectors, QEMUIOVector *iov)
|
static int coroutine_fn vitastor_co_readv(BlockDriverState *bs, int64_t sector_num, int nb_sectors, QEMUIOVector *iov)
|
||||||
{
|
{
|
||||||
return vitastor_co_preadv(bs, sector_num*BDRV_SECTOR_SIZE, nb_sectors*BDRV_SECTOR_SIZE, iov, 0);
|
return vitastor_co_preadv(bs, sector_num*BDRV_SECTOR_SIZE, nb_sectors*BDRV_SECTOR_SIZE, iov, 0);
|
||||||
|
@ -521,6 +521,7 @@ static QEMUOptionParameter vitastor_create_opts[] = {
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if QEMU_VERSION_MAJOR >= 4
|
||||||
static const char *vitastor_strong_runtime_opts[] = {
|
static const char *vitastor_strong_runtime_opts[] = {
|
||||||
"inode",
|
"inode",
|
||||||
"pool",
|
"pool",
|
||||||
|
@ -530,6 +531,7 @@ static const char *vitastor_strong_runtime_opts[] = {
|
||||||
|
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
static BlockDriver bdrv_vitastor = {
|
static BlockDriver bdrv_vitastor = {
|
||||||
.format_name = "vitastor",
|
.format_name = "vitastor",
|
||||||
|
@ -563,12 +565,16 @@ static BlockDriver bdrv_vitastor = {
|
||||||
// Requires patching QAPI IDL, thus unimplemented
|
// Requires patching QAPI IDL, thus unimplemented
|
||||||
//.bdrv_co_create = vitastor_co_create,
|
//.bdrv_co_create = vitastor_co_create,
|
||||||
|
|
||||||
#if QEMU_VERSION_MAJOR >= 3
|
#if QEMU_VERSION_MAJOR >= 3 || QEMU_VERSION_MAJOR == 2 && QEMU_VERSION_MINOR >= 12
|
||||||
// For bdrv_create(), used by qemu-img
|
// For bdrv_create(), used by qemu-img
|
||||||
.bdrv_co_create_opts = vitastor_co_create_opts,
|
.bdrv_co_create_opts = vitastor_co_create_opts,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if QEMU_VERSION_MAJOR >= 3
|
||||||
.bdrv_co_truncate = vitastor_co_truncate,
|
.bdrv_co_truncate = vitastor_co_truncate,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if QEMU_VERSION_MAJOR >= 3 || QEMU_VERSION_MAJOR == 2 && QEMU_VERSION_MINOR >= 7
|
||||||
.bdrv_co_preadv = vitastor_co_preadv,
|
.bdrv_co_preadv = vitastor_co_preadv,
|
||||||
.bdrv_co_pwritev = vitastor_co_pwritev,
|
.bdrv_co_pwritev = vitastor_co_pwritev,
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in New Issue