From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCeq7-0006Ey-1p for qemu-devel@nongnu.org; Tue, 07 Jul 2015 22:11:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCeq5-0002tS-RX for qemu-devel@nongnu.org; Tue, 07 Jul 2015 22:11:58 -0400 Received: from e17.ny.us.ibm.com ([129.33.205.207]:57828) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCeq5-0002tK-NI for qemu-devel@nongnu.org; Tue, 07 Jul 2015 22:11:57 -0400 Received: from /spool/local by e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 7 Jul 2015 22:11:57 -0400 Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 456286E803C for ; Tue, 7 Jul 2015 22:03:41 -0400 (EDT) Received: from d01av05.pok.ibm.com (d01av05.pok.ibm.com [9.56.224.195]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t682Bsk955050314 for ; Wed, 8 Jul 2015 02:11:54 GMT Received: from d01av05.pok.ibm.com (localhost [127.0.0.1]) by d01av05.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t682Brpa020082 for ; Tue, 7 Jul 2015 22:11:54 -0400 From: Michael Roth Date: Tue, 7 Jul 2015 21:11:32 -0500 Message-Id: <1436321496-26179-8-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1436321496-26179-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1436321496-26179-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 07/11] qga: added empty qmp_quest_get_fsinfo functionality. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Denis V. Lunev" , peter.maydell@linaro.org, Olga Krishtal From: Olga Krishtal We need qmp_quest_get_fsinfo togather with vss-provider, which works with volumes. The call to this function is implemented via FindFirst/NextVolumes. Moreover, volumes in Windows OS are filesystem unit, so it will be more effective to work with them rather with devices. Signed-off-by: Olga Krishtal Signed-off-by: Denis V. Lunev CC: Eric Blake CC: Michael Roth Signed-off-by: Michael Roth --- qga/commands-win32.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/qga/commands-win32.c b/qga/commands-win32.c index 4275f8a..a283129 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -389,8 +389,29 @@ static void guest_file_init(void) GuestFilesystemInfoList *qmp_guest_get_fsinfo(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); - return NULL; + HANDLE vol_h; + GuestFilesystemInfoList *new, *ret = NULL; + char guid[256]; + + vol_h = FindFirstVolume(guid, sizeof(guid)); + if (vol_h == INVALID_HANDLE_VALUE) { + error_setg_win32(errp, GetLastError(), "failed to find any volume"); + return NULL; + } + + do { + new = g_malloc(sizeof(*ret)); + new->value = build_guest_fsinfo(guid, errp); + new->next = ret; + ret = new; + } while (FindNextVolume(vol_h, guid, sizeof(guid))); + + if (GetLastError() != ERROR_NO_MORE_FILES) { + error_setg_win32(errp, GetLastError(), "failed to find next volume"); + } + + FindVolumeClose(vol_h); + return ret; } /* @@ -927,7 +948,7 @@ GList *ga_command_blacklist_init(GList *blacklist) "guest-set-user-password", "guest-get-memory-blocks", "guest-set-memory-blocks", "guest-get-memory-block-size", - "guest-fsfreeze-freeze-list", "guest-get-fsinfo", + "guest-fsfreeze-freeze-list", "guest-fstrim", NULL}; char **p = (char **)list_unsupported; -- 1.9.1