projects
/
sdk
/
emulator
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
38ceff0
)
nbd: obey FUA on reads
author
Paolo Bonzini
<pbonzini@redhat.com>
Thu, 19 Apr 2012 09:59:11 +0000
(11:59 +0200)
committer
Paolo Bonzini
<pbonzini@redhat.com>
Thu, 19 Apr 2012 15:19:37 +0000
(17:19 +0200)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
nbd.c
patch
|
blob
|
history
diff --git
a/nbd.c
b/nbd.c
index
d4dafc6
..
153709f
100644
(file)
--- a/
nbd.c
+++ b/
nbd.c
@@
-842,6
+842,15
@@
static void nbd_trip(void *opaque)
case NBD_CMD_READ:
TRACE("Request type is READ");
+ if (request.type & NBD_CMD_FLAG_FUA) {
+ ret = bdrv_co_flush(exp->bs);
+ if (ret < 0) {
+ LOG("flush failed");
+ reply.error = -ret;
+ goto error_reply;
+ }
+ }
+
ret = bdrv_read(exp->bs, (request.from + exp->dev_offset) / 512,
req->data, request.len / 512);
if (ret < 0) {