aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorDimitris Aragiorgis <dimara@arrikto.com>2015-06-23 13:44:56 +0300
committerStefan Hajnoczi <stefanha@redhat.com>2015-06-23 15:08:52 +0100
commitb192af8acc597a6e8068873434e56e0c7de1b7d3 (patch)
treeea6db802f2133fce46ec4c06e204bb4894ee54b4 /block.c
parent25940fa7e57ffce9d495b4c2aadc39790535856d (diff)
block: Use bdrv_is_sg() everywhere
Instead of checking bs->sg use bdrv_is_sg() consistently throughout the code. Signed-off-by: Dimitris Aragiorgis <dimara@arrikto.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1435056300-14924-2-git-send-email-dimara@arrikto.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/block.c b/block.c
index 7168575909..81233beaab 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;