Revision 178e08a5 block-qcow2.c
b/block-qcow2.c | ||
---|---|---|
2721 | 2721 |
#endif |
2722 | 2722 |
#endif |
2723 | 2723 |
|
2724 |
static int qcow_put_buffer(BlockDriverState *bs, const uint8_t *buf, |
|
2725 |
int64_t pos, int size) |
|
2726 |
{ |
|
2727 |
int growable = bs->growable; |
|
2728 |
|
|
2729 |
bs->growable = 1; |
|
2730 |
bdrv_pwrite(bs, pos, buf, size); |
|
2731 |
bs->growable = growable; |
|
2732 |
|
|
2733 |
return size; |
|
2734 |
} |
|
2735 |
|
|
2736 |
static int qcow_get_buffer(BlockDriverState *bs, uint8_t *buf, |
|
2737 |
int64_t pos, int size) |
|
2738 |
{ |
|
2739 |
int growable = bs->growable; |
|
2740 |
int ret; |
|
2741 |
|
|
2742 |
bs->growable = 1; |
|
2743 |
ret = bdrv_pread(bs, pos, buf, size); |
|
2744 |
bs->growable = growable; |
|
2745 |
|
|
2746 |
return ret; |
|
2747 |
} |
|
2748 |
|
|
2724 | 2749 |
BlockDriver bdrv_qcow2 = { |
2725 | 2750 |
.format_name = "qcow2", |
2726 | 2751 |
.instance_size = sizeof(BDRVQcowState), |
... | ... | |
2745 | 2770 |
.bdrv_snapshot_list = qcow_snapshot_list, |
2746 | 2771 |
.bdrv_get_info = qcow_get_info, |
2747 | 2772 |
|
2773 |
.bdrv_put_buffer = qcow_put_buffer, |
|
2774 |
.bdrv_get_buffer = qcow_get_buffer, |
|
2775 |
|
|
2748 | 2776 |
.bdrv_create2 = qcow_create2, |
2749 | 2777 |
}; |
Also available in: Unified diff