From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50404) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCKh4-0001Z9-8v for qemu-devel@nongnu.org; Tue, 07 Jul 2015 00:41:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCKh3-0006YS-1P for qemu-devel@nongnu.org; Tue, 07 Jul 2015 00:41:18 -0400 Received: from mail-ob0-x22f.google.com ([2607:f8b0:4003:c01::22f]:36526) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCKh2-0006YJ-Tb for qemu-devel@nongnu.org; Tue, 07 Jul 2015 00:41:16 -0400 Received: by obdbs4 with SMTP id bs4so121264061obd.3 for ; Mon, 06 Jul 2015 21:41:16 -0700 (PDT) Sender: fluxion From: Michael Roth Date: Mon, 6 Jul 2015 23:40:17 -0500 Message-Id: <1436244020-27822-8-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1436244020-27822-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1436244020-27822-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 07/10] 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 e8769bb..3f3a144 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -390,8 +390,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; } /* @@ -928,7 +949,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