aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2013-11-22 13:39:47 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2013-12-03 15:26:49 +0100
commit7ce21016b69b512bf4777965a4292318f2bc7544 (patch)
tree5f79714c6bdb5996906ab6e8ebdbf262621e8d92 /block.c
parentd5ef94d43da8c57a2d597efbdec3d9a54d97fdf7 (diff)
block: handle ENOTSUP from discard in generic code
Similar to write_zeroes, let the generic code receive a ENOTSUP for discard operations. Since bdrv_discard has advisory semantics, we can just swallow the error. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Peter Lieven <pl@kamp.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block.c b/block.c
index c491edfb95..9818052603 100644
--- a/block.c
+++ b/block.c
@@ -4376,7 +4376,7 @@ int coroutine_fn bdrv_co_discard(BlockDriverState *bs, int64_t sector_num,
ret = co.ret;
}
}
- if (ret) {
+ if (ret && ret != -ENOTSUP) {
return ret;
}