From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOTn0-0002K0-MA for qemu-devel@nongnu.org; Mon, 01 Sep 2014 11:45:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOTmt-0003pu-UK for qemu-devel@nongnu.org; Mon, 01 Sep 2014 11:45:06 -0400 Received: from mail-we0-x236.google.com ([2a00:1450:400c:c03::236]:47551) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOTmt-0003pg-O1 for qemu-devel@nongnu.org; Mon, 01 Sep 2014 11:44:59 -0400 Received: by mail-we0-f182.google.com with SMTP id w62so5695280wes.27 for ; Mon, 01 Sep 2014 08:44:58 -0700 (PDT) Date: Mon, 1 Sep 2014 16:44:55 +0100 From: Stefan Hajnoczi Message-ID: <20140901154455.GD22346@stefanha-thinkpad.redhat.com> References: <20140828141904.28233.58158.malonedeb@gac.canonical.com> <20140901075522.11915.55201.malone@chaenomeles.canonical.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="a2FkP9tdjPU2nyhF" Content-Disposition: inline In-Reply-To: <20140901075522.11915.55201.malone@chaenomeles.canonical.com> Subject: Re: [Qemu-devel] [Bug 1362635] Re: bdrv_read co-routine re-entered recursively List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bug 1362635 <1362635@bugs.launchpad.net> Cc: Fam Zheng , jsnow@redhat.com, qemu-devel@nongnu.org --a2FkP9tdjPU2nyhF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Sep 01, 2014 at 07:55:22AM -0000, senya wrote: > I'm trying to reanimate github.com/jagane/qemu-kvm-livebackup > there is a separate thread which connects with client through socket and sends disk blocks to it. Regarding your original question about threads: it is possible to do block I/O from threads but there are rules about how to do that safely. The natural way to do things in QEMU is not with threads, this was always an issue with Jagane's patches (I guess he didn't want to spend time integrating it into QEMU's main loop when prototyping the code but it's not a good long-term solution). More about livebackup: There has been more recent work by Fam Zheng to achieve the same thing. The advantage of Fam's approach is that it reuses existing QEMU primitives instead of adding special case livebackup code. Fam has moved on to other work but his latest patches are from May so picking them up again shouldn't be that hard. It consists of two things: image fleecing and dirty bitmap commands. Image fleecing gives cheap access to a point-in-time snapshot of the disk (over NBD). Internally it uses the run-time NBD server and the block-backup command to export a point-in-time snapshot. The dirty bitmap provides what Jagane did but the plan is to also persist bitmaps across QEMU shutdown. This will make incremental backups easy. Please see Part IV of the "Block layer status report" presentation for an overview: http://www.linux-kvm.org/wiki/images/4/41/Kvm-forum-2013-block-layer-status-report.pdf Here are Fam's patch series: https://lists.gnu.org/archive/html/qemu-devel/2014-05/msg03880.html https://lists.gnu.org/archive/html/qemu-devel/2014-03/msg05250.html The first step is getting the image fleecing code merged. Then the in-memory dirty bitmap can be merged. Finally, persistent dirty bitmap support can be written. Stefan --a2FkP9tdjPU2nyhF Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUBJR3AAoJEJykq7OBq3PIBtcIAJNciDFTe3GbVNOaaYdVNatN eRnQX3bDKwBp1vZCQvy6+jY/FDwzf65TxbTeJYOK+uSBhncbyXSK6slt7KX+O9p7 P8nAcvnGA/E8hUellgN6lK7xdmGixnejynLREOW+amS3WmlTi2GeZKZ8NMC+YuZ5 DDDUtktE6/Xr2B/IVZ3HFt6vZY3gDlHH8EO1m+ikT8uLGFTQxcKp23Q1kw8Ss+pU csVN5PgqTQkZzn4FGWzCw7IHdvWy/XSTxGfVOx+wWktv9gDeYrtMv5zLdUbq6SYA xIf6bmjMpP60m/CjrIKS3mARf6TZDPyX2qHNnEQNCi/uz0eR1XfpwFF/j8utChQ= =QKdA -----END PGP SIGNATURE----- --a2FkP9tdjPU2nyhF--