From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38203) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajsPq-0008BN-EP for qemu-devel@nongnu.org; Sat, 26 Mar 2016 13:54:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ajsPp-0006wn-LM for qemu-devel@nongnu.org; Sat, 26 Mar 2016 13:54:26 -0400 References: <1458325289-17848-1-git-send-email-kwolf@redhat.com> <1458325289-17848-6-git-send-email-kwolf@redhat.com> From: Max Reitz Message-ID: <56F6CCC9.2000508@redhat.com> Date: Sat, 26 Mar 2016 18:54:17 +0100 MIME-Version: 1.0 In-Reply-To: <1458325289-17848-6-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hrKoSBUJSUNwQO7DMicg7EBaefTjx3VVe" Subject: Re: [Qemu-devel] [PATCH 05/20] qemu-img: Call blk_set_enable_write_cache() explicitly List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-block@nongnu.org Cc: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --hrKoSBUJSUNwQO7DMicg7EBaefTjx3VVe Content-Type: multipart/mixed; boundary="BuM1WxwU7xM92jXOI3WHebvP00f4OIB4x" From: Max Reitz To: Kevin Wolf , qemu-block@nongnu.org Cc: qemu-devel@nongnu.org Message-ID: <56F6CCC9.2000508@redhat.com> Subject: Re: [PATCH 05/20] qemu-img: Call blk_set_enable_write_cache() explicitly References: <1458325289-17848-1-git-send-email-kwolf@redhat.com> <1458325289-17848-6-git-send-email-kwolf@redhat.com> In-Reply-To: <1458325289-17848-6-git-send-email-kwolf@redhat.com> --BuM1WxwU7xM92jXOI3WHebvP00f4OIB4x Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 18.03.2016 19:21, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf > --- > qemu-img.c | 79 ++++++++++++++++++++++++++++++++++++++----------------= -------- > 1 file changed, 48 insertions(+), 31 deletions(-) >=20 > diff --git a/qemu-img.c b/qemu-img.c > index 839e05b..96b51d4 100644 > --- a/qemu-img.c > +++ b/qemu-img.c [...] > @@ -2862,26 +2874,30 @@ static int img_rebase(int argc, char **argv) > qemu_progress_print(0, 100); > =20 > flags =3D BDRV_O_RDWR | (unsafe ? BDRV_O_NO_BACKING : 0); > - ret =3D bdrv_parse_cache_flags(cache, &flags); > + ret =3D bdrv_parse_cache_mode(cache, &flags, &writethrough); > if (ret < 0) { > error_report("Invalid cache option: %s", cache); > goto out; > } > =20 > - src_flags =3D BDRV_O_CACHE_WB; > - ret =3D bdrv_parse_cache_flags(src_cache, &src_flags); > + src_flags =3D 0; > + ret =3D bdrv_parse_cache_mode(src_cache, &src_flags, &src_writethr= ough); > if (ret < 0) { > error_report("Invalid source cache option: %s", src_cache); > goto out; > } > =20 > + /* The source files are opened read-only, don't care about WCE */ > + assert((src_writethrough & BDRV_O_RDWR) =3D=3D 0); Well, yeah, that is a trivial assertion to make because BDRV_O_RDWR is 2.= I guess you meant s/src_writethrough/src_flags/. With that fixed: Reviewed-by: Max Reitz > + (void) src_writethrough; > + > /* > * Open the images. > * > * Ignore the old backing file for unsafe rebase in case we want t= o correct > * the reference to a renamed or moved backing file. > */ > - blk =3D img_open(image_opts, filename, fmt, flags, true, quiet); > + blk =3D img_open(image_opts, filename, fmt, flags, true, writethro= ugh, quiet); > if (!blk) { > ret =3D -1; > goto out; --BuM1WxwU7xM92jXOI3WHebvP00f4OIB4x-- --hrKoSBUJSUNwQO7DMicg7EBaefTjx3VVe 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 iQEcBAEBCAAGBQJW9szJAAoJEDuxQgLoOKytyAYH/3xiADrUIh2znAiffpBYg8lm cGW9CCnkgXvxMXdkhdXTUEuz1nrU1of7x6JUJmpEyc3ocji36G6xIN/B6cShuDts QSq5ecUSnR+Cy9gXh3/nMAzbCa63QS6K1n3Sb2bAfK4yv4x5Gd6MLEs6LILLkm+v 0SqFXhTiIWVCXeOvPY/+uznxlwUDBig093vIHe5B8jx3bYjh1vB2C8JC+9X8PbB4 8jjHJ+2fm9Jw52fpkzQFzpEJlKDMTPtC+4crz04e4j+sKaOKYevmhSVDqE8tKCaJ Nv6Ann38STWsXSmgQweOrH2B8OijrsVXKAD3FaA1lB4BGiypjPS8aq9JVNPkdDw= =UwYV -----END PGP SIGNATURE----- --hrKoSBUJSUNwQO7DMicg7EBaefTjx3VVe--