start_sect = (offset & ~(s->cluster_size - 1)) >> 9;
for(i = 0; i < s->cluster_sectors; i++) {
if (i < n_start || i >= n_end) {
- Error *err = NULL;
memset(s->cluster_data, 0x00, 512);
if (qcrypto_block_encrypt(s->crypto, start_sect + i,
s->cluster_data,
BDRV_SECTOR_SIZE,
- &err) < 0) {
- error_free(err);
+ NULL) < 0) {
errno = EIO;
return -1;
}
QEMUIOVector hd_qiov;
uint8_t *buf;
void *orig_buf;
- Error *err = NULL;
if (qiov->niov > 1) {
buf = orig_buf = qemu_try_blockalign(bs, qiov->size);
if (bs->encrypted) {
assert(s->crypto);
if (qcrypto_block_decrypt(s->crypto, sector_num, buf,
- n * BDRV_SECTOR_SIZE, &err) < 0) {
+ n * BDRV_SECTOR_SIZE, NULL) < 0) {
goto fail;
}
}
return ret;
fail:
- error_free(err);
ret = -EIO;
goto done;
}
break;
}
if (bs->encrypted) {
- Error *err = NULL;
assert(s->crypto);
if (qcrypto_block_encrypt(s->crypto, sector_num, buf,
- n * BDRV_SECTOR_SIZE, &err) < 0) {
- error_free(err);
+ n * BDRV_SECTOR_SIZE, NULL) < 0) {
ret = -EIO;
break;
}
assert(s->crypto);
assert((offset & (BDRV_SECTOR_SIZE - 1)) == 0);
assert((cur_bytes & (BDRV_SECTOR_SIZE - 1)) == 0);
- Error *err = NULL;
if (qcrypto_block_decrypt(s->crypto,
(s->crypt_physical_offset ?
cluster_offset + offset_in_cluster :
offset) >> BDRV_SECTOR_BITS,
cluster_data,
cur_bytes,
- &err) < 0) {
- error_free(err);
+ NULL) < 0) {
ret = -EIO;
goto fail;
}
qemu_iovec_concat(&hd_qiov, qiov, bytes_done, cur_bytes);
if (bs->encrypted) {
- Error *err = NULL;
assert(s->crypto);
if (!cluster_data) {
cluster_data = qemu_try_blockalign(bs->file->bs,
cluster_offset + offset_in_cluster :
offset) >> BDRV_SECTOR_BITS,
cluster_data,
- cur_bytes, &err) < 0) {
- error_free(err);
+ cur_bytes, NULL) < 0) {
ret = -EIO;
goto fail;
}