summary refs log tree commit diff stats
path: root/hw/timer/lm32_timer.c
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2016-07-15 12:32:01 -0600
committerStefan Hajnoczi <stefanha@redhat.com>2016-07-20 14:11:54 +0100
commit04ed95f4843281e292d93018d56d4b14705f9f2c (patch)
tree86ecceb673bffe3412e015de6c36912706cb92be /hw/timer/lm32_timer.c
parent8a39b4d6e2926a536027f7ffbc28a3ed2e5d32b0 (diff)
downloadfocaccia-qemu-04ed95f4843281e292d93018d56d4b14705f9f2c.tar.gz
focaccia-qemu-04ed95f4843281e292d93018d56d4b14705f9f2c.zip
block: Fragment writes to max transfer length
Drivers should be able to rely on the block layer honoring the
max transfer length, rather than needing to return -EINVAL
(iscsi) or manually fragment things (nbd).  We already fragment
write zeroes at the block layer; this patch adds the fragmentation
for normal writes, after requests have been aligned (fragmenting
before alignment would lead to multiple unaligned requests, rather
than just the head and tail).

When fragmenting a large request where FUA was requested, but
where we know that FUA is implemented by flushing all requests
rather than the given request, then we can still get by with
only one flush.  Note, however, that we need a followup patch
to the raw format driver to avoid a regression in the number of
flushes actually issued.

The return value was previously nebulous on success (sometimes
zero, sometimes the length written); since we never have a short
write, and since fragmenting may store yet another positive
value in 'ret', change the function to always return 0 on success,
matching what we do in bdrv_aligned_preadv().

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-id: 1468607524-19021-4-git-send-email-eblake@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw/timer/lm32_timer.c')
0 files changed, 0 insertions, 0 deletions