From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMNOB-0006eW-0J for qemu-devel@nongnu.org; Sun, 31 Mar 2013 14:54:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UMNO9-0002fi-Et for qemu-devel@nongnu.org; Sun, 31 Mar 2013 14:53:58 -0400 Received: from mail.avalus.com ([2001:41c8:10:1dd::10]:43563) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMNO9-0002c7-5J for qemu-devel@nongnu.org; Sun, 31 Mar 2013 14:53:57 -0400 Date: Sun, 31 Mar 2013 19:53:28 +0000 From: Alex Bligh Message-ID: <66DB172ECC6AABDC49D0E5A4@Ximines.local> In-Reply-To: References: <1363609123-20748-1-git-send-email-alex@alex.org.uk> <51471767.8030604@redhat.com> <7AC8953FE45335FB794B6DFE@Ximines.local> <51471F14.7030209@redhat.com> <6D0F4ACDA3B7FCF1A50F8B52@Ximines.local> <5147298C.8080900@redhat.com> <51473E82.1020806@redhat.com> <861AFE1A9C44444FD8BAEE16@Ximines.local> <5147512E.5050501@eu.citrix.com> <5147562E.1090203@redhat.com> <5148414C.7060303@redhat.com> <514980BD.7010005@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Re: [Qemu-devel] [Xen-devel] [PATCHv3] QEMU(upstream): Disable xen's use of O_DIRECT by default as it results in crashes. Reply-To: Alex Bligh List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefano Stabellini , Paolo Bonzini Cc: Ian Campbell , Stefano Stabellini , George Dunlap , Ian Jackson , qemu-devel@nongnu.org, xen-devel , Anthony Liguori , Alex Bligh Stefano, --On 29 March 2013 17:19:26 +0000 Stefano Stabellini wrote: >> I think so. blkfront reads "sectors" when QEMU moves to >> XenbusStateConnected, in blkfront_connect. >> >> blk_connect is called from xen_be_try_initialise, which moves to >> XenbusStateConnected on success. So, QEMU's blk_connect will always be >> called before blkfront's blkfront_connect. > > Alex, do you have any updates on this patch? Sorry, I've been snowed under with other stuff. I got to the speed bump below, then didn't get back to it after Paolo's reply. I'll see if I can get some time tomorrow. -- Alex Bligh ---------- Forwarded Message ---------- Date: 20 March 2013 10:26:21 +0100 From: Paolo Bonzini To: Alex Bligh CC: Stefano Stabellini , George Dunlap , Ian Campbell , Ian Jackson , qemu-devel@nongnu.org, xen-devel , Anthony Liguori Subject: Re: [Xen-devel] [PATCHv3] QEMU(upstream): Disable xen's use of O_DIRECT by default as it results in crashes. Il 20/03/2013 09:33, Alex Bligh ha scritto: > Stefano, > > --On 19 March 2013 15:13:29 +0000 Stefano Stabellini > wrote: > >> Therefore I think that the current change is not safe, but it is pretty >> easy to make it safe. >> You just need to move the call to blk_open from blk_init to blk_connect. >> Actually you can move most of blk_init to blk_connect, you just need to >> keep the 4 xenstore_write_be_int at the end of the function. > > The final of these 4 writes in blk_init is: > > xenstore_write_be_int(&blkdev->xendev, "sectors", > blkdev->file_size / blkdev->file_blk); > > and blkdev->filesize comes from bdrv_getlength(blkdev->bs), and that > requires (I think) bdrv_open to have been called. Can these > 4 writes move safely to blk_connect? Or can we write the sectors > count as (say) 0 here and fix it later in blk_connect? The remainder > look ok. I think so. blkfront reads "sectors" when QEMU moves to XenbusStateConnected, in blkfront_connect. blk_connect is called from xen_be_try_initialise, which moves to XenbusStateConnected on success. So, QEMU's blk_connect will always be called before blkfront's blkfront_connect. Paolo ---------- End Forwarded Message ----------