From: Kevin Wolf <kwolf@redhat.com>
To: anthony@codemonkey.ws
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 1/5] sheepdog: switch to writethrough mode if cluster doesn't support flush
Date: Mon, 7 May 2012 19:55:50 +0200 [thread overview]
Message-ID: <1336413354-5244-2-git-send-email-kwolf@redhat.com> (raw)
In-Reply-To: <1336413354-5244-1-git-send-email-kwolf@redhat.com>
From: MORITA Kazutaka <morita.kazutaka@gmail.com>
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>
Signed-off-by: Kevin Wolf <kwolf@redhat.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.6.5
next prev parent reply other threads:[~2012-05-07 17:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-07 17:55 [Qemu-devel] [PULL 0/5] Block patches for 1.1 Kevin Wolf
2012-05-07 17:55 ` Kevin Wolf [this message]
2012-05-07 17:55 ` [Qemu-devel] [PATCH 2/5] qcow2: Limit COW to where it's needed Kevin Wolf
2012-05-07 17:55 ` [Qemu-devel] [PATCH 3/5] block: make bdrv_create adopt coroutine Kevin Wolf
2012-05-07 17:55 ` [Qemu-devel] [PATCH 4/5] qcow2: lock on prealloc Kevin Wolf
2012-05-07 17:55 ` [Qemu-devel] [PATCH 5/5] fdc: simplify media change handling Kevin Wolf
2012-05-08 16:11 ` [Qemu-devel] [PULL 0/5] Block patches for 1.1 Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1336413354-5244-2-git-send-email-kwolf@redhat.com \
--to=kwolf@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).