From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43960) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWlF6-0008Is-Op for qemu-devel@nongnu.org; Tue, 22 May 2012 05:19:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SWlEz-0006Pv-1x for qemu-devel@nongnu.org; Tue, 22 May 2012 05:19:00 -0400 Received: from mail-pz0-f45.google.com ([209.85.210.45]:33114) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWlEy-0006PN-Pb for qemu-devel@nongnu.org; Tue, 22 May 2012 05:18:52 -0400 Received: by dadv2 with SMTP id v2so9684103dad.4 for ; Tue, 22 May 2012 02:18:50 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4FBB59F4.90600@redhat.com> Date: Tue, 22 May 2012 11:18:44 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1337287349-7664-1-git-send-email-josh.durgin@inktank.com> In-Reply-To: <1337287349-7664-1-git-send-email-josh.durgin@inktank.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] rbd: hook up cache options List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Josh Durgin Cc: kwolf@redhat.com, qemu-devel@nongnu.org Il 17/05/2012 22:42, Josh Durgin ha scritto: > + * Fallback to more conservative semantics if setting cache > + * options fails. Ignore errors from setting rbd_cache because the > + * only possible error is that the option does not exist, and > + * librbd defaults to no caching. If write through caching cannot > + * be set up, fall back to no caching. > + */ > + if (flags & BDRV_O_NOCACHE) { > + rados_conf_set(s->cluster, "rbd_cache", "false"); > + } else { > + rados_conf_set(s->cluster, "rbd_cache", "true"); > + if (!(flags & BDRV_O_CACHE_WB)) { > + r = rados_conf_set(s->cluster, "rbd_cache_max_dirty", "0"); > + if (r < 0) { > + rados_conf_set(s->cluster, "rbd_cache", "false"); > + } > + } > + } Last time I looked at ceph, rbd_flush was not a full flush of the cache; it only ensured that the pending requests were sent. So my questions are: 1) has this changed? does rbd_flush now flush dirty items when rbd_cache_max_dirty > 0? 2) should the usage of a cache be conditional on LIBRBD_VERSION_CODE >= LIBRBD_VERSION(0, 1, 1)? Thanks, Paolo