Il 12/09/2012 10:25, Tristan Wibberley ha scritto: > The attached diff adds a commandline option "--cache=" with four modes > and makes no change to the default behaviour of qemu-nbd: > > --cache=writethrough [default, O_DSYNC, very slow, very resilient] > --cache=off [same as --nocache, O_DIRECT, slow, resilient] > --cache=none [O_DIRECT, O_DSYNC, very very slow, very very resilient] > --cache=writeback [fast, not resilient]
A very similar patch is in QEMU 1.2.0, just released last week. :) --cache=writethrough [default, O_DSYNC] --cache=none [same as --nocache, O_DIRECT] --cache=directsync [O_DIRECT, O_DSYNC] --cache=writeback > I have not included Stephane's extra fsync operation on close because > that would make --cache=writeback very slow on disconnect. Users can > sync after disconnect via alternatives available on their platform. An fsync is already done by bdrv_close; however, this only syncs just before qemu-nbd exits, not after each and every disconnect. I think it's a good compromise. The best solution would be to add support for fsync in the NBD kernel driver, so that --cache=writeback would be just as good. Paolo