Stefano,
--On 29 March 2013 17:19:26 +0000 Stefano Stabellini
<stefano.stabell...@eu.citrix.com> 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 <pbonz...@redhat.com>
To: Alex Bligh <a...@alex.org.uk>
CC: Stefano Stabellini <stefano.stabell...@eu.citrix.com>, George Dunlap
<george.dun...@eu.citrix.com>, Ian Campbell <ian.campb...@citrix.com>, Ian
Jackson <ian.jack...@eu.citrix.com>, qemu-devel@nongnu.org, xen-devel
<xen-de...@lists.xen.org>, Anthony Liguori <anth...@codemonkey.ws>
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
<stefano.stabell...@eu.citrix.com> 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 ----------