diff mbox

sheepdog: implement direct write semantics

Message ID 50ED5E19.8020902@gmail.com
State New
Headers show

Commit Message

Liu Yuan Jan. 9, 2013, 12:10 p.m. UTC
On 01/09/2013 08:07 PM, Liu Yuan wrote:
> $ qemu-system-x86_64 --enable-kvm -drive
> file=~/images/test1,if=virtio,cache=writeback -smp 2 -cpu host -m 1024
> -drive file=sheepdog:test,if=virtio,cache=writeback

To emulate old impl, I modified the sheepdog block driver as following:

     if (s->flush_fd < 0) {
@@ -1125,6 +1126,7 @@ static int sd_open(BlockDriverState *bs, const
char *filename, int flags)
         ret = s->flush_fd;
         goto out;
     }
+    }

     if (snapid || tag[0] != '\0') {
         dprintf("%" PRIx32 " snapshot inode was open.\n", vid);
diff mbox

Patch

diff --git a/block/sheepdog.c b/block/sheepdog.c
index e821746..321a426 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -1118,6 +1118,7 @@  static int sd_open(BlockDriverState *bs, const
char *filename, int flags)
         goto out;
     }

+    if (0) {
     s->cache_enabled = true;
     s->flush_fd = connect_to_sdog(s->addr, s->port);