From b192af8acc597a6e8068873434e56e0c7de1b7d3 Mon Sep 17 00:00:00 2001 From: Dimitris Aragiorgis Date: Tue, 23 Jun 2015 13:44:56 +0300 Subject: block: Use bdrv_is_sg() everywhere Instead of checking bs->sg use bdrv_is_sg() consistently throughout the code. Signed-off-by: Dimitris Aragiorgis Reviewed-by: Paolo Bonzini Reviewed-by: Stefan Hajnoczi Message-id: 1435056300-14924-2-git-send-email-dimara@arrikto.com Signed-off-by: Stefan Hajnoczi --- block/iscsi.c | 2 +- block/raw-posix.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'block') diff --git a/block/iscsi.c b/block/iscsi.c index 5f7b60c99b..aff8198d3f 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 a967464000..b2097fc796 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; -- cgit v1.2.3