From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47025) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCHoQ-0003DP-0Y for qemu-devel@nongnu.org; Mon, 06 Jul 2015 21:36:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCHoI-0000zy-8P for qemu-devel@nongnu.org; Mon, 06 Jul 2015 21:36:41 -0400 Received: from e33.co.us.ibm.com ([32.97.110.151]:45262) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCHoI-0000zR-09 for qemu-devel@nongnu.org; Mon, 06 Jul 2015 21:36:34 -0400 Received: from /spool/local by e33.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 6 Jul 2015 19:36:32 -0600 Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 6B34B19D8040 for ; Mon, 6 Jul 2015 19:27:30 -0600 (MDT) Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t671aU1V38797480 for ; Mon, 6 Jul 2015 18:36:30 -0700 Received: from d03av03.boulder.ibm.com (localhost [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t671aUGq002267 for ; Mon, 6 Jul 2015 19:36:30 -0600 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Roth In-Reply-To: <1431327525-25625-1-git-send-email-justin@quarantainenet.nl> References: <1431327525-25625-1-git-send-email-justin@quarantainenet.nl> Message-ID: <20150707013247.17393.19280@loki> Date: Mon, 06 Jul 2015 20:32:47 -0500 Subject: Re: [Qemu-devel] [PATCH v4 0/2] Fix guest-fstrim behaviour List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Justin Ossevoort , qemu-devel@nongnu.org Quoting Justin Ossevoort (2015-05-11 01:58:43) > The qemu-ga 'guest-fstrim' command is currently not working properly. > = > There are 2 issues: > - The current implementation reuses a struct between ioctl() calls without > reinitialising it's fields. This struct however is updated to reflect > the result of the trim operation. > Therefor only the first filesystem is thoroughly trimmed, the rest is o= nly > trimmed up to the amount that was trimmed by the previous filesystem. > - The current implementation will return an error if some filesystem retu= rned > an unexpected error. The first issue consistently causes this issue when > the 'guest-fstrim' is performed multiple times in a row when multiple > filesystems are being trimmed, as this causes a trim request for at most > 0 bytes, which is an error. Applied, thanks. > = > The first patch fixes the first issue by explicitly resetting the struct = used > to perform the trim ioctl for each path. This is a pretty mundane change = and > fixes most use-cases. > = > The second patch fixes the second issue by changing the returned value to > return a per-path result. This way all paths are always trimmed and depen= dening > on the outcome of the ioctl an error or some details about the trim are > returned. The returned values for error, minimum and trimmed are filesyst= em, > storage stack and kernel version dependant. > = > There was an earlier request to mirror the fields from the 'guest-fsinfo' > operation. The trim operation however need not happen at the mountpoint l= evel. > A logical future improvement would be to allow the caller to supply an op= tional > list of paths they want to trim, without needing to have intimate details= about > the filesystem layout of the guest. > = > [Changes since v3] > - Patch 2: Change return type of qmp_guest_fstrim in qga/command-win32.c > - Patch 2: Change commit message on patch 2 to indicate returned values a= re > filesystem, storage stack and kernel version dependant > = > Justin Ossevoort (2): > qga/commands-posix: Fix bug in guest-fstrim > qga/commands-posix: Return per path fstrim result > = > qga/commands-posix.c | 63 ++++++++++++++++++++++++++++++++++++----------= ------ > qga/commands-win32.c | 4 +++- > qga/qapi-schema.json | 32 +++++++++++++++++++++++--- > 3 files changed, 76 insertions(+), 23 deletions(-) > = > -- = > 2.1.4 > = >=20