From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=46260 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ovyvt-00077w-EU for qemu-devel@nongnu.org; Wed, 15 Sep 2010 16:50:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ovyvr-0000RV-VQ for qemu-devel@nongnu.org; Wed, 15 Sep 2010 16:50:21 -0400 Received: from moutng.kundenserver.de ([212.227.17.9]:59922) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ovyvr-0000Qh-JV for qemu-devel@nongnu.org; Wed, 15 Sep 2010 16:50:19 -0400 Message-ID: <4C91317A.6070409@mail.berlios.de> Date: Wed, 15 Sep 2010 22:50:02 +0200 From: Stefan Weil MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/5] Introduce strtobytes() library function to convert string to byte count. References: <1284553440-17985-1-git-send-email-Jes.Sorensen@redhat.com> <1284553440-17985-2-git-send-email-Jes.Sorensen@redhat.com> <795CDD0E-ED9C-4EC1-AE65-A563DC9A2240@web.de> In-Reply-To: <795CDD0E-ED9C-4EC1-AE65-A563DC9A2240@web.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-1?Q?Andreas_F=E4rber?= Cc: Jes.Sorensen@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com, quintela@redhat.com Am 15.09.2010 20:46, schrieb Andreas Färber: > Am 15.09.2010 um 14:23 schrieb Jes.Sorensen@redhat.com: > [...] >> +/* >> + * Convert string to bytes, allowing either K/k for KB, M/m for MB, >> + * G/b for GB or T/t for TB. Default without any postfix is MB. > ^^^ typo >> + * End pointer will be returned in *end, if end is valid. >> + * Return 0 on error. >> + */ > > You seem to be refactoring existing code into this function, but the > use of such suffixes usually brings up the question whether it's > factor 1024 or 1000. > Here you're using 1024 apparently. If you don't want the user dealing > with (imo ugly) Ki/Mi/Gi/Ti units this should at least be documented > accordingly: G/g for GiB, etc. or G/g for GB = 1024 MB, etc. > > Andreas [snip] I'd prefer the standard prefixes: KiB, MiB, GiB for powers of 1024, KB, MB, GB for powers of 1000. The standard has the big advantage of being a standard, even if not everybody likes it. Existing QEMU code should be cleaned (= changed) were needed. Stefan