Currently, as rbd driver do not support dynamic growth when write beyond EOF,
so just print a clear error message.

Signed-off-by: Jun Li <junm...@gmail.com>
---
v2:
Just use rbd_aio_write to realize error detection.
---
 block/rbd.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/block/rbd.c b/block/rbd.c
index 5b5a64a..710ee3e 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -661,6 +661,10 @@ static BlockAIOCB *rbd_start_aio(BlockDriverState *bs,
     }
 
     if (r < 0) {
+        if (r == -EINVAL && cmd == RBD_AIO_WRITE) {
+            fprintf(stderr, "Image formats that grow on demand "
+                            "are not supported on rbd.\n");
+        }
         goto failed_completion;
     }
 
-- 
1.9.3


Reply via email to