From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56978) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5O17-00075e-QV for qemu-devel@nongnu.org; Tue, 24 May 2016 21:53:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5O16-0007Wn-Ps for qemu-devel@nongnu.org; Tue, 24 May 2016 21:53:49 -0400 References: <1464097654-12977-1-git-send-email-kwolf@redhat.com> <1464097654-12977-13-git-send-email-kwolf@redhat.com> From: Eric Blake Message-ID: <574505A4.4010207@redhat.com> Date: Tue, 24 May 2016 19:53:40 -0600 MIME-Version: 1.0 In-Reply-To: <1464097654-12977-13-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="NQ0DixsGqMifMjDBlltV4GLqs9rlEXrrO" Subject: Re: [Qemu-devel] [PATCH v2 12/14] backup: Use BlockBackend for I/O List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-block@nongnu.org Cc: berto@igalia.com, jcody@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com, jsnow@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --NQ0DixsGqMifMjDBlltV4GLqs9rlEXrrO Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/24/2016 07:47 AM, Kevin Wolf wrote: > This changes the backup block job to use the job's BlockBackend for > performing its I/O. job->bs isn't used by the backup code any more > afterwards. >=20 > Signed-off-by: Kevin Wolf > --- > block/backup.c | 46 +++++++++++++++++++++----------------------= --- > block/io.c | 9 --------- > blockdev.c | 4 +--- > include/block/block.h | 2 -- > trace-events | 1 - > 5 files changed, 22 insertions(+), 40 deletions(-) >=20 > =20 > - if (is_write_notifier) { > - ret =3D bdrv_co_readv_no_serialising(bs, > - start * sectors_per_cluster= , > - n, &bounce_qiov); > - } else { > - ret =3D bdrv_co_readv(bs, start * sectors_per_cluster, n, > - &bounce_qiov); > - } > + ret =3D blk_co_preadv(blk, start * job->cluster_size, > + bounce_qiov.size, &bounce_qiov, > + is_write_notifier ? BDRV_REQ_NO_SERIALISIN= G : 0); See my question earlier in the series about whether we want a redundant size parameter in blk_co_preadv() now that it is public. > if (ret < 0) { > trace_backup_do_cow_read_fail(job, start, ret); > if (error_is_read) { > @@ -155,13 +150,11 @@ static int coroutine_fn backup_do_cow(BackupBlock= Job *job, > } > =20 > if (buffer_is_zero(iov.iov_base, iov.iov_len)) { > - ret =3D bdrv_co_write_zeroes(job->target, > - start * sectors_per_cluster, > - n, BDRV_REQ_MAY_UNMAP); > + ret =3D blk_co_write_zeroes(job->target, start * job->clus= ter_size, > + n * BDRV_SECTOR_SIZE, BDRV_REQ_M= AY_UNMAP); More rebasing fun. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --NQ0DixsGqMifMjDBlltV4GLqs9rlEXrrO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXRQWkAAoJEKeha0olJ0Nqn8AH/ju7bnjTWrJNCsRCoyw3gTpa 9hxUJZgcLafnJutzfz2iYG+vmwZzAnVdglvkRCPN/AuDtfKXjzmeHI3ZBRrdH77/ o77b5sjH4PmWtqjRUtQReZFJjm9T4blIx/Fp1QBs4xAj8ujj2ToGtzutWk4uhRqp CKgr+0tlZGXtOC33X874ELGt8VxUD/vMczhH+SU7gDwiwLH/Lfp1TZLUB9W8Au8K YwRetVJxpxg1QILJm4L9uLqL7CP1VZBdSDcepXqOTAfZDUyPzu10apzv5SD4nprA 2SXvwa/OvaxuFnbEuaqDe83SWh/roajZOdhfzT03h01XFfqoz14yoAZIAxSSOxc= =4c5I -----END PGP SIGNATURE----- --NQ0DixsGqMifMjDBlltV4GLqs9rlEXrrO--