From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzrzA-0000Tq-EN for qemu-devel@nongnu.org; Thu, 18 Jul 2013 13:27:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uzrz8-0006Qe-TP for qemu-devel@nongnu.org; Thu, 18 Jul 2013 13:27:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28545) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uzrz8-0006Qa-M0 for qemu-devel@nongnu.org; Thu, 18 Jul 2013 13:27:22 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6IHRMnV021968 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 18 Jul 2013 13:27:22 -0400 Message-ID: <51E82579.20201@redhat.com> Date: Thu, 18 Jul 2013 11:27:21 -0600 From: Eric Blake MIME-Version: 1.0 References: <1374091462-18391-1-git-send-email-imain@redhat.com> <1374091462-18391-5-git-send-email-imain@redhat.com> In-Reply-To: <1374091462-18391-5-git-send-email-imain@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dPt2SA6BuDCTEMLDkJpERIfKNC5oHUgEo" Subject: Re: [Qemu-devel] [PATCH V4 4/4] Change default to qcow2 for sync mode none. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ian Main Cc: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --dPt2SA6BuDCTEMLDkJpERIfKNC5oHUgEo Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/17/2013 02:04 PM, Ian Main wrote: > qcow2 supports backing files so it makes sense to default to qcow2 > for MIRROR_SYNC_MODE_NONE so that we can use the source as a backing > drive and export it via nbd. Defaulting FULL and TOP to SYNC_MODE_NONE= > breaks tests but that could be fixed if we wanted it. >=20 > Signed-off-by: Ian Main > --- > blockdev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/blockdev.c b/blockdev.c > index 000dea6..805b0e5 100644 > --- a/blockdev.c > +++ b/blockdev.c > @@ -1462,7 +1462,7 @@ void qmp_drive_backup(const char *device, const c= har *target, > } > =20 > if (!has_format) { > - format =3D mode =3D=3D NEW_IMAGE_MODE_EXISTING ? NULL : bs->dr= v->format_name; > + format =3D mode =3D=3D NEW_IMAGE_MODE_EXISTING ? NULL : "qcow2= "; Is this the right thing to do? Or should we do: if (!has_format) { if (mode =3D=3D NEW_IMAGE_MODE_EXISTING) { format =3D NULL; } else { format =3D bs->drv->format_name ?: "qcow2"; } } That is, I think we should default to doing a backup in the format given by the original (what if the original is qed, which also supports backing files), and only use qcow2 when there is no guidance whatsoever. But in practice, I don't care - format probing is a security hole, so libvirt should always be passing a format, at which point the entire !has_format condition should be skipped when called by libvirt. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --dPt2SA6BuDCTEMLDkJpERIfKNC5oHUgEo Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJR6CV5AAoJEKeha0olJ0Nq9YUH/RR/5hre/KdQRF5XPWZSRKe9 AAHYoSiH8VxwFnt4ViwBctu5RCiGyVShQoDAUIeIj3y/zm+jHMgtVe1vMrbAeeNh Wy7CYqfcAiTmfwTow5KtEcDRzq8nq6ruU0KUjNbEBZC0LOFhujekR08cwI4VRVlO fNjfx/Y8xv6YBa8KG9IOvyil4qTvNE0ou/g6gAwY6vL33QsGwcwNPCyzvQ/TQAkV PexwUfz+165njBjW8uQsMEp1U6pKbCHN/yZy0/L/HxbAk0QYoUEClag+x3uXzqE7 GBstf04b3QpaEpJmkpOQJt1tOIPq0+MKf/qmvy9mY5kQGaxsuz+7P5ujsCaC4EA= =NpSO -----END PGP SIGNATURE----- --dPt2SA6BuDCTEMLDkJpERIfKNC5oHUgEo--