diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2010-06-03 14:55:49 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-06-03 14:55:49 -0500 |
commit | 358c360feb346dff8f911e2d1dbcdd6319393f1d (patch) | |
tree | a9d2e040f3127901ffb583ca18527511ce7283f6 /block.c | |
parent | 41ef56e61153d7bd27d34a634633bb51b1c5988d (diff) | |
parent | 1a396859105c4c27fdec08180be26288b8a629a3 (diff) | |
download | qemu-358c360feb346dff8f911e2d1dbcdd6319393f1d.zip qemu-358c360feb346dff8f911e2d1dbcdd6319393f1d.tar.gz qemu-358c360feb346dff8f911e2d1dbcdd6319393f1d.tar.bz2 |
Merge remote branch 'kwolf/for-anthony' into staging
Diffstat (limited to 'block.c')
-rw-r--r-- | block.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -56,7 +56,6 @@ static int bdrv_read_em(BlockDriverState *bs, int64_t sector_num, uint8_t *buf, int nb_sectors); static int bdrv_write_em(BlockDriverState *bs, int64_t sector_num, const uint8_t *buf, int nb_sectors); -static BlockDriver *find_protocol(const char *filename); static QTAILQ_HEAD(, BlockDriverState) bdrv_states = QTAILQ_HEAD_INITIALIZER(bdrv_states); @@ -210,7 +209,7 @@ int bdrv_create_file(const char* filename, QEMUOptionParameter *options) { BlockDriver *drv; - drv = find_protocol(filename); + drv = bdrv_find_protocol(filename); if (drv == NULL) { drv = bdrv_find_format("file"); } @@ -283,7 +282,7 @@ static BlockDriver *find_hdev_driver(const char *filename) return drv; } -static BlockDriver *find_protocol(const char *filename) +BlockDriver *bdrv_find_protocol(const char *filename) { BlockDriver *drv1; char protocol[128]; @@ -333,8 +332,10 @@ static BlockDriver *find_image_format(const char *filename) return NULL; /* Return the raw BlockDriver * to scsi-generic devices */ - if (bs->sg) + if (bs->sg) { + bdrv_delete(bs); return bdrv_find_format("raw"); + } ret = bdrv_pread(bs, 0, buf, sizeof(buf)); bdrv_delete(bs); @@ -478,7 +479,7 @@ int bdrv_file_open(BlockDriverState **pbs, const char *filename, int flags) BlockDriver *drv; int ret; - drv = find_protocol(filename); + drv = bdrv_find_protocol(filename); if (!drv) { return -ENOENT; } @@ -1950,7 +1951,7 @@ static int multiwrite_merge(BlockDriverState *bs, BlockRequest *reqs, // Add the second request qemu_iovec_concat(qiov, reqs[i].qiov, reqs[i].qiov->size); - reqs[outidx].nb_sectors += reqs[i].nb_sectors; + reqs[outidx].nb_sectors = qiov->size >> 9; reqs[outidx].qiov = qiov; mcb->callbacks[i].free_qiov = reqs[outidx].qiov; |