提交 115c2b5a 编写于 作者: M MORITA Kazutaka 提交者: Kevin Wolf

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.
Signed-off-by: NMORITA Kazutaka <morita.kazutaka@gmail.com>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 847c25d0
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册