Skip to contentSkip to conversation

sheepdog: switch to writethrough mode if cluster doesn't support flush

PATCH Applied MORITA Kazutaka 2 participants 2 messages May 2, 2012 – May 3, 2012 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sheepdog: switch to writethrough mode if cluster doesn't support flush

This is necessary for qemu to work with the older version of Sheepdog which doesn't support SD_OP_FLUSH_VDI.

---
 block/sheepdog.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
block/sheepdog.c +8 -0
index 0ed6b19..e01d371 100644
@@ -1678,6 +1678,14 @@ static int coroutine_fn sd_co_flush_to_disk(BlockDriverState *bs)
         return ret;
     }
 
+    if (rsp->result == SD_RES_INVALID_PARMS) {
+        dprintf("disable write cache since the server doesn't support it\n");
+
+        s->cache_enabled = 0;
+        closesocket(s->flush_fd);
+        return 0;
+    }
+
     if (rsp->result != SD_RES_SUCCESS) {
         error_report("%s", sd_strerror(rsp->result));
         return -EIO;
Signature · 1 line
1.7.2.5
Applied
#1 lore raw

Am 02.05.2012 22:26, schrieb MORITA Kazutaka:

Quoted 4 lines

This is necessary for qemu to work with the older version of Sheepdog which doesn't support SD_OP_FLUSH_VDI.

Thanks, applied to the block branch.

Kevin