summaryrefslogtreecommitdiffstats
path: root/block/qcow2-cluster.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2009-06-26 19:51:24 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-06-29 14:18:07 -0500
commit22afa7b5b67bb8bc58939d100363ee6753a50467 (patch)
treecbbefa1f0c01e4450fe74a66afb0e383647d6236 /block/qcow2-cluster.c
parentae95ade0cd5edc55fdfee1f6ba532dfa5b994555 (diff)
downloadhqemu-22afa7b5b67bb8bc58939d100363ee6753a50467.zip
hqemu-22afa7b5b67bb8bc58939d100363ee6753a50467.tar.gz
block-raw: Allow pread beyond the end of growable images
When using O_DIRECT, qcow2 snapshots didn't work any more for me. In the process of creating the snapshot, qcow2 tries to pwrite some new information (e.g. new L1 table) which will often end up being after the old end of the image file. Now pwrite tries to align things and reads the old contents of the file, read returns 0 because there is nothing to read after the end of file and pwrite is stuck in an endless loop. This patch allows to pread beyond the end of an image file. Whenever the given offset is after the end of the image file, the read succeeds and fills the buffer with zeros. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'block/qcow2-cluster.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud