[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 08/15] block: Use bdrv_is_sg() everywhere
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL 08/15] block: Use bdrv_is_sg() everywhere |
Date: |
Wed, 24 Jun 2015 16:27:59 +0100 |
From: Dimitris Aragiorgis <address@hidden>
Instead of checking bs->sg use bdrv_is_sg() consistently throughout
the code.
Signed-off-by: Dimitris Aragiorgis <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
block.c | 6 +++---
block/iscsi.c | 2 +-
block/raw-posix.c | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/block.c b/block.c
index 7168575..81233be 100644
--- a/block.c
+++ b/block.c
@@ -585,7 +585,7 @@ static int find_image_format(BlockDriverState *bs, const
char *filename,
int ret = 0;
/* Return the raw BlockDriver * to scsi-generic devices or empty drives */
- if (bs->sg || !bdrv_is_inserted(bs) || bdrv_getlength(bs) == 0) {
+ if (bdrv_is_sg(bs) || !bdrv_is_inserted(bs) || bdrv_getlength(bs) == 0) {
*pdrv = &bdrv_raw;
return ret;
}
@@ -617,7 +617,7 @@ static int refresh_total_sectors(BlockDriverState *bs,
int64_t hint)
BlockDriver *drv = bs->drv;
/* Do not attempt drv->bdrv_getlength() on scsi-generic devices */
- if (bs->sg)
+ if (bdrv_is_sg(bs))
return 0;
/* query actual device if possible, otherwise just trust the hint */
@@ -948,7 +948,7 @@ static int bdrv_open_common(BlockDriverState *bs,
BlockDriverState *file,
assert(bdrv_opt_mem_align(bs) != 0);
assert(bdrv_min_mem_align(bs) != 0);
- assert((bs->request_alignment != 0) || bs->sg);
+ assert((bs->request_alignment != 0) || bdrv_is_sg(bs));
qemu_opts_del(opts);
return 0;
diff --git a/block/iscsi.c b/block/iscsi.c
index 5f7b60c..aff8198 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -628,7 +628,7 @@ static int coroutine_fn iscsi_co_flush(BlockDriverState *bs)
IscsiLun *iscsilun = bs->opaque;
struct IscsiTask iTask;
- if (bs->sg) {
+ if (bdrv_is_sg(bs)) {
return 0;
}
diff --git a/block/raw-posix.c b/block/raw-posix.c
index a967464..b2097fc 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -305,9 +305,9 @@ static void raw_probe_alignment(BlockDriverState *bs, int
fd, Error **errp)
char *buf;
size_t max_align = MAX(MAX_BLOCKSIZE, getpagesize());
- /* For /dev/sg devices the alignment is not really used.
+ /* For SCSI generic devices the alignment is not really used.
With buffered I/O, we don't have any restrictions. */
- if (bs->sg || !s->needs_alignment) {
+ if (bdrv_is_sg(bs) || !s->needs_alignment) {
bs->request_alignment = 1;
s->buf_align = 1;
return;
--
2.4.3
- [Qemu-devel] [PULL 00/15] Block patches, Stefan Hajnoczi, 2015/06/24
- [Qemu-devel] [PULL 02/15] throttle: Check current timers before updating any_timer_armed[], Stefan Hajnoczi, 2015/06/24
- [Qemu-devel] [PULL 01/15] block: Let bdrv_drain_all() to call aio_poll() for each AioContext, Stefan Hajnoczi, 2015/06/24
- [Qemu-devel] [PULL 03/15] block-backend: Introduce blk_drain(), Stefan Hajnoczi, 2015/06/24
- [Qemu-devel] [PULL 04/15] virtio-blk: Use blk_drain() to drain IO requests, Stefan Hajnoczi, 2015/06/24
- [Qemu-devel] [PULL 05/15] util/hbitmap: Add an API to reset all set bits in hbitmap, Stefan Hajnoczi, 2015/06/24
- [Qemu-devel] [PULL 07/15] nvme: Fix memleak in nvme_dma_read_prp, Stefan Hajnoczi, 2015/06/24
- [Qemu-devel] [PULL 06/15] vvfat: add a label option, Stefan Hajnoczi, 2015/06/24
- [Qemu-devel] [PULL 08/15] block: Use bdrv_is_sg() everywhere,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL 09/15] Fix migration in case of scsi-generic, Stefan Hajnoczi, 2015/06/24
- [Qemu-devel] [PULL 10/15] raw-posix: DPRINTF instead of DEBUG_BLOCK_PRINT, Stefan Hajnoczi, 2015/06/24
- [Qemu-devel] [PULL 11/15] raw-posix: Use DPRINTF for DEBUG_FLOPPY, Stefan Hajnoczi, 2015/06/24
- [Qemu-devel] [PULL 13/15] iov: don't touch iov in iov_send_recv(), Stefan Hajnoczi, 2015/06/24
- [Qemu-devel] [PULL 12/15] raw-posix: Introduce hdev_is_sg(), Stefan Hajnoczi, 2015/06/24
- [Qemu-devel] [PULL 14/15] qemu-iotests: fix 051.out after qdev error message change, Stefan Hajnoczi, 2015/06/24
- [Qemu-devel] [PULL 15/15] virito-blk: drop duplicate check, Stefan Hajnoczi, 2015/06/24
- Re: [Qemu-devel] [PULL 00/15] Block patches, Peter Maydell, 2015/06/25