From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35171) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sv7J5-0007k4-RV for qemu-devel@nongnu.org; Sat, 28 Jul 2012 09:43:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sv7J4-0003ch-Ga for qemu-devel@nongnu.org; Sat, 28 Jul 2012 09:43:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23870) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sv7J4-0003cR-8f for qemu-devel@nongnu.org; Sat, 28 Jul 2012 09:43:46 -0400 Message-ID: <5013EC8A.3000409@redhat.com> Date: Sat, 28 Jul 2012 07:43:38 -0600 From: Eric Blake MIME-Version: 1.0 References: <1343127865-16608-1-git-send-email-pbonzini@redhat.com> <1343127865-16608-44-git-send-email-pbonzini@redhat.com> In-Reply-To: <1343127865-16608-44-git-send-email-pbonzini@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig8A33FCDE7D0A3ADA5F0BC594" Subject: Re: [Qemu-devel] [PATCH 43/47] mirror: allow customizing the granularity List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, jcody@redhat.com, qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig8A33FCDE7D0A3ADA5F0BC594 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/24/2012 05:04 AM, Paolo Bonzini wrote: > The desired granularity may be very different depending on the kind of > operation (e.g. continous replication vs. collapse-to-raw) and whether s/continous/continuous/ > the VM is expected to perform lots of I/O while mirroring is in progres= s. > Allow the user to customize it. >=20 > Signed-off-by: Paolo Bonzini > --- > @@ -857,6 +858,17 @@ void qmp_drive_mirror(const char *device, const ch= ar *target, > if (!has_mode) { > mode =3D NEW_IMAGE_MODE_ABSOLUTE_PATHS; > } > + if (!has_granularity) { > + granularity =3D 65536; > + } > + if (granularity < 512 || granularity > 1048576 * 64) { > + error_set(errp, QERR_INVALID_PARAMETER, device); > + return; > + } > + if (granularity & (granularity - 1)) { > + error_set(errp, QERR_INVALID_PARAMETER, device); > + return; In the XBZLRE migration series, we decided to round the users input down to a power of two instead of reject it. Should we do that here? Also, there is already an explicit QERR_PROPERY_VALUE_NOT_POWER_OF_2 that might fit better here (depending on how the error cleanup series goes). --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig8A33FCDE7D0A3ADA5F0BC594 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.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJQE+yLAAoJEKeha0olJ0NqHfQH/0+GaTZtrVegwr9ia5KhC/J3 KdI2TeYqu7ClPwiLcZCOoEEJtA2UQe+26cdGAGNLuZQsvv8welKSdRGWznw36RAH JgkqtFhfL8HQf2+hrdjbiIPGpFau98OPfbQMej9rXKg+IZW9D9Sm+5Z8SUNP26OW xmjilgOQ4iQe22D8w5DIDsHFeflzHqk2IxpL2TOqwFnI3ARR9B19OtWNYQ+8dwNl PWYWW8PjW+e+g8MMjaFC8QJJvsXOGYK4DDRLZwojpWnGkr03YJGoTvt+/HcbqNIJ asYHwIHYIwTNWYuLbEyuPmpfpwoPxxoCONiShmXuIySzDOe0j9NaxIbdyY8DfS0= =UJCw -----END PGP SIGNATURE----- --------------enig8A33FCDE7D0A3ADA5F0BC594--