From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:41407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QCraI-0004YI-RR for qemu-devel@nongnu.org; Thu, 21 Apr 2011 06:58:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QCraH-0004sh-JA for qemu-devel@nongnu.org; Thu, 21 Apr 2011 06:58:06 -0400 Received: from mail-vw0-f45.google.com ([209.85.212.45]:35469) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QCraH-0004sd-Gl for qemu-devel@nongnu.org; Thu, 21 Apr 2011 06:58:05 -0400 Received: by vws17 with SMTP id 17so1392855vws.4 for ; Thu, 21 Apr 2011 03:58:04 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <1303375391-26679-1-git-send-email-ronniesahlberg@gmail.com> <20110421085026.GA4817@lst.de> <20110421090935.GA5381@lst.de> Date: Thu, 21 Apr 2011 11:58:04 +0100 Message-ID: From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] iSCSI support for QEMU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: ronnie sahlberg Cc: Christoph Hellwig , stefanha@linux.vnet.ibm.com, qemu-devel@nongnu.org On Thu, Apr 21, 2011 at 10:28 AM, ronnie sahlberg wrote: > On Thu, Apr 21, 2011 at 7:09 PM, Christoph Hellwig wrote: >> We only claim WCE=3D1 to the guest if cache=3Dwriteback or cache=3Dnone = are >> set. =A0So ignoring the issue of having a cache on the initiator side >> you must implement stable writes for the default cache=3Dwritethrough >> behaviour by either seeting the FUA bit on your writes, or doing >> a cache flush after every write in case the target does not support FUA. > > My target right now does such flushes for writes. > > > I fail to see why FUA, FUA_NV or flushes have any relevance to a test > that just involves reading data off the lun. I'll try to rephrase what Christoph has pointed out. When QEMU is run with cache=3Dwritethrough (default), QEMU does not report a write cache on the emulated disk. The guest believes that all writes are stable because there is no disk write cache. Therefore the guest does not need to issue synchronize cache commands ever. In order to meet these semantics with libiscsi, we would need to set FUA or send a synchronize cache command for every write. (QEMU's raw-posix.c file I/O meets these semantics by opening the image file with O_DSYNC when cache=3Dwritethrough.) > I do not understand why my target would have data integrity problem > when used with libiscsi > but not with open-iscsi mounted lun? In the open-iscsi cache=3Dwritethrough case, QEMU's raw-posix.c opens the file with O_DSYNC. Open-iscsi must set the FUA bit or synchronize cache for each write request. How does libiscsi behave in this case? Stefan