qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] sheepdog: switch to writethrough mode if cluster doesn't support flush
@ 2012-05-02 20:26 MORITA Kazutaka
  2012-05-03 12:35 ` Kevin Wolf
  0 siblings, 1 reply; 2+ messages in thread
From: MORITA Kazutaka @ 2012-05-02 20:26 UTC (permalink / raw)
  To: kwolf; +Cc: morita.kazutaka, namei.unix, hch, qemu-devel

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

Signed-off-by: MORITA Kazutaka <morita.kazutaka@gmail.com>
---
 block/sheepdog.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/block/sheepdog.c b/block/sheepdog.c
index 0ed6b19..e01d371 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -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;
-- 
1.7.2.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] sheepdog: switch to writethrough mode if cluster doesn't support flush
  2012-05-02 20:26 [Qemu-devel] [PATCH] sheepdog: switch to writethrough mode if cluster doesn't support flush MORITA Kazutaka
@ 2012-05-03 12:35 ` Kevin Wolf
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2012-05-03 12:35 UTC (permalink / raw)
  To: MORITA Kazutaka; +Cc: namei.unix, hch, qemu-devel

Am 02.05.2012 22:26, schrieb MORITA Kazutaka:
> This is necessary for qemu to work with the older version of Sheepdog
> which doesn't support SD_OP_FLUSH_VDI.
> 
> Signed-off-by: MORITA Kazutaka <morita.kazutaka@gmail.com>

Thanks, applied to the block branch.

Kevin

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-05-03 12:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-02 20:26 [Qemu-devel] [PATCH] sheepdog: switch to writethrough mode if cluster doesn't support flush MORITA Kazutaka
2012-05-03 12:35 ` Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).