From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32889) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YczY8-0000V1-Ch for qemu-devel@nongnu.org; Tue, 31 Mar 2015 13:02:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YczY5-0006Ed-KR for qemu-devel@nongnu.org; Tue, 31 Mar 2015 13:02:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65201) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YczY5-0006EU-C6 for qemu-devel@nongnu.org; Tue, 31 Mar 2015 13:01:57 -0400 Message-ID: <551AD303.10402@redhat.com> Date: Tue, 31 Mar 2015 11:01:55 -0600 From: Eric Blake MIME-Version: 1.0 References: <1427814871-1936-1-git-send-email-justin@quarantainenet.nl> In-Reply-To: <1427814871-1936-1-git-send-email-justin@quarantainenet.nl> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="aoBj5NBkau54MlSg11rwrJmEj66D31Qq6" Subject: Re: [Qemu-devel] [PATCH] qga/commands-posix: Fix bug in guest-fstrim List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Justin Ossevoort , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --aoBj5NBkau54MlSg11rwrJmEj66D31Qq6 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03/31/2015 09:14 AM, Justin Ossevoort wrote: > The FITRIM ioctl updates the fstrim_range structure it receives. This > way the caller can determine how many bytes were trimmed. The > guest-fstrim logic reuses the same fstrim_range for each filesystem, > effectively limiting each filesystem to trim at most as much as the > previous was able to trim. >=20 > If a previous filesystem would have trimmed 0 bytes, than the next > filesystem would report an error 'Invalid argument' because a FITRIM > request with length 0 is not valid. >=20 > This change resets the fstrim_range structure for each filesystem. It > also returns all bytes trimmed for all filesystems, providing a hint to= > the caller about how effective the guest-fstrim request was. >=20 > Signed-off-by: Justin Ossevoort > --- > -# Returns: Nothing. > +# Returns: Number of bytes trimmed by this call. > # > # Since: 1.2 > ## > { 'command': 'guest-fstrim', > - 'data': { '*minimum': 'int' } } > + 'data': { '*minimum': 'int' }, > + 'returns': 'int' } No. Please don't add any new non-dictionary returns (see my pending patch that would flag this as not being on the whitelist: https://lists.gnu.org/archive/html/qemu-devel/2015-03/msg05046.html ). This is particularly true for an already existing command (clients might not be prepared for older guest agent returning an empty dictionary in place of an int; but SHOULD be prepared to see if the returned dictionary is empty). Better would be to add a key to the returned dictionary that reports either total amount trimmed, or even better, an array reporting stats for each file system trimmed; something like: { "return": { "trimmed": [ { "name":"abc", "mountpoint":"xyz", "trimmed":123 }, { "name":"def", "mountpoint":"pqr", "trimmed":456 } ] } } where the 'name' and 'mountpoint' keys of each array element correspond to the data given by the 'GuestFilesystemInfo' type in 'guest-get-fsinfo' (so that the two commands have correlated information)= =2E --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --aoBj5NBkau54MlSg11rwrJmEj66D31Qq6 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 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVGtMDAAoJEKeha0olJ0Nqzn4H/Av+M4+sXloVCnWdLylIZ0hC vIGYusE4FctGvNHhLAdWkC+Rz5amxVJGuQJwyP2MqsnWK7HhjTx/87uut8d7RCCP nklYNhnC/+D2PSjFDhKvm3xW+4VLDYcf3Ope56OyWBV/2VDFexEn/Lq4CqDx0cH6 g3VJ1Hzk0MfniKvYS4kwxiuid1StZFf5v65wXpGrNk+MMEBG4C8sA6JzWAYvJeFv hkpHNvwMYSbe/rj6x1jUM/ojGSW5y63+JhErZOf29X0kNtO8AKaPIVrOg7fHtzhU jG54ox5Xh6fxf6e4BRIBCfQaUI7sLfa2Y3Ooq2T6GPd871cLdnlfdFEhPbz2ZOU= =nDTb -----END PGP SIGNATURE----- --aoBj5NBkau54MlSg11rwrJmEj66D31Qq6--