From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYNaS-0000me-8r for qemu-devel@nongnu.org; Tue, 23 Feb 2016 19:45:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYNaR-0003f1-BI for qemu-devel@nongnu.org; Tue, 23 Feb 2016 19:45:52 -0500 References: <1456273021-17473-1-git-send-email-jsnow@redhat.com> <1456273021-17473-3-git-send-email-jsnow@redhat.com> <20160224002757.GA749@ad.usersys.redhat.com> From: Eric Blake Message-ID: <56CCFD38.5040704@redhat.com> Date: Tue, 23 Feb 2016 17:45:44 -0700 MIME-Version: 1.0 In-Reply-To: <20160224002757.GA749@ad.usersys.redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="37Fl2rIMo9KI9xtx4Hm1CB0CJSKDJflgp" Subject: Re: [Qemu-devel] [PATCH v3 2/3] block/backup: avoid copying less than full target clusters List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , John Snow Cc: kwolf@redhat.com, qemu-block@nongnu.org, jcody@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --37Fl2rIMo9KI9xtx4Hm1CB0CJSKDJflgp Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/23/2016 05:27 PM, Fam Zheng wrote: > On Tue, 02/23 19:17, John Snow wrote: >> During incremental backups, if the target has a cluster size that is >> larger than the backup cluster size and we are backing up to a target >> that cannot (for whichever reason) pull clusters up from a backing ima= ge, >> we may inadvertantly create unusable incremental backup images. >> >> + /* If there is no backing file on the target, we cannot rely on C= OW if our >> + * backup cluster size is smaller than the target cluster size. E= ven for >> + * targets with a backing file, try to avoid COW if possible. */ >> + ret =3D bdrv_get_info(job->target, &bdi); >> + if (ret < 0 && !target->backing) { >> + error_setg_errno(errp, -ret, >> + "Can't determine cluster size of target that has no backi= ng file. " >> + "This may create an unusable destination image. Aborting.= "); >=20 > Most error messages don't end with a period, but that's not a hard rule= AFAICT. Ah, but it is: include/qapi/error.h: * The resulting message should be a single phrase, with no newline or * trailing punctuation. * Please don't error_setg(&error_fatal, ...), use error_report() and * exit(), because that's more obvious. * Likewise, don't error_setg(&error_abort, ...), use assert(). */ #define error_setg(errp, fmt, ...) \ The error message should be "Can't determine cluster size of target without backing file"; everything else should be done with error_append_hint(&errp, "Aborting, since this may create an unusable destination image\n") --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --37Fl2rIMo9KI9xtx4Hm1CB0CJSKDJflgp 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/ iQEcBAEBCAAGBQJWzP04AAoJEKeha0olJ0NqxbUH/R+iy4L/SZG+MO1CRSzhM4AK 5qXA3QApb5jOFzsMb///nq5qkcfPYcXDZWz5MhGUq57XQJIYemK3ZXd/GYHeB6lq Uf/8LuI48iniLcweZ6rsnvs8LoyQG0WE7hzl0aIyFLh1kf2RvmIzvbaqXuWyuCWr Toz8EMJfaTruRxRle0ZRfsC1GzAsX1sl4US4rtuPxeKdNRuRxi0m5+Ls5lgNC8+4 /9LVkQeSIXdVR6HOWpfrMGWqRuyns5tzrtxCAttkcvfpd16UqSI0QVxaormRjXC4 OEJ33zjJI5tzYslUXyvxSeF8arfxVv7uYzklnBB+YXtcOo6za/++iZOj89v33AU= =Qc1q -----END PGP SIGNATURE----- --37Fl2rIMo9KI9xtx4Hm1CB0CJSKDJflgp--