aboutsummaryrefslogtreecommitdiff
path: root/block/qed.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2012-09-06 11:31:27 +0300
committerAvi Kivity <avi@redhat.com>2012-09-06 11:31:27 +0300
commit4c3e02beed9878a5f760eeceb6cd42c475cf0127 (patch)
treeb99d39a241a5db9981d1c89dd87d2512a16e4630 /block/qed.c
parent1cc707b10567b0ebf2670e39f4a3c01da664fd6a (diff)
parent8db972cfa469b4e4afd9c65e54e796b83b5ce3a2 (diff)
Merge tag 'v1.2.0'qemu-kvm-1.2.0
Tag for 1.2.0 * tag 'v1.2.0': Update version for 1.2.0 console: bounds check whenever changing the cursor due to an escape code qemu-timer: properly arm alarm timer for timers set by device initialization target-xtensa: return ENOSYS for unimplemented simcalls Update version to 1.2.0-rc3 console: Fix warning from clang (and potential crash) uas: move transfer kickoff ehci: Fix interrupt endpoints no longer working ehci: handle TD deactivation of inflight packets ehci: add ehci_cancel_queue() ehci: simplify ehci_state_executing ehci: Remove unnecessary ehci_flush_qh call ehci: Schedule async-bh when IAAD bit gets set ehci: Fix NULL ptr deref when unplugging an USB dev with an iso stream active usb: unique packet ids usb: Halt ep queue en cancel pending packets on a packet error fix info qtree indention qemu-iotests: add backing file smaller than image test case stream: complete early if end of backing file is reached qed: refuse unaligned zero writes with a backing file Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'block/qed.c')
-rw-r--r--block/qed.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/block/qed.c b/block/qed.c
index a02dbfd72..21cb23987 100644
--- a/block/qed.c
+++ b/block/qed.c
@@ -1363,10 +1363,21 @@ static int coroutine_fn bdrv_qed_co_write_zeroes(BlockDriverState *bs,
int nb_sectors)
{
BlockDriverAIOCB *blockacb;
+ BDRVQEDState *s = bs->opaque;
QEDWriteZeroesCB cb = { .done = false };
QEMUIOVector qiov;
struct iovec iov;
+ /* Refuse if there are untouched backing file sectors */
+ if (bs->backing_hd) {
+ if (qed_offset_into_cluster(s, sector_num * BDRV_SECTOR_SIZE) != 0) {
+ return -ENOTSUP;
+ }
+ if (qed_offset_into_cluster(s, nb_sectors * BDRV_SECTOR_SIZE) != 0) {
+ return -ENOTSUP;
+ }
+ }
+
/* Zero writes start without an I/O buffer. If a buffer becomes necessary
* then it will be allocated during request processing.
*/