|
From: | Eric Blake |
Subject: | Re: [Qemu-devel] [PATCH] qga: report disk size and free space |
Date: | Tue, 3 Jul 2018 11:26:31 -0500 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 |
On 07/03/2018 05:54 AM, Tomáš Golembiovský wrote:
On Tue, 3 Jul 2018 10:31:20 +0200 Tomáš Golembiovský <address@hidden> wrote:diff --git a/qga/commands-win32.c b/qga/commands-win32.c index 70ee5379f6..6d6ca05281 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -706,6 +706,22 @@ static GuestFilesystemInfo *build_guest_fsinfo(char *guid, Error **errp) } fs->type = g_strdup(fs_name); fs->disk = build_guest_disk_info(guid, errp); + + if (len > 0) { + if (GetDiskFreeSpaceEx(mnt_point, 0, (PULARGE_INTEGER)&fs->size, + (PULARGE_INTEGER)&fs->free) != 0) {Btw, it seems to me that checkpatch.pl returns some false positives here. See: ERROR: spaces required around that '&' (ctx:VxV) #72: FILE: qga/commands-win32.c:711: + if (GetDiskFreeSpaceEx(mnt_point, 0, (PULARGE_INTEGER)&fs->size, ^
Yes. PULARGE_INTEGER is not the normal qemu spelling for a typedef, so it confuses checkpatch into thinking you are doing a binary operator instead of a cast of a unary operator, hence a false positive not worth worrying about.
Also, checkpatch.pl itself suggest to look into MAINTAINERS to find out whom to report false positives, but there is no maintainer there. :)
Yes, that's an unfortunate problem - no one has volunteered to maintain checkpatch, so it just gets sporadic patches.
-- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
[Prev in Thread] | Current Thread | [Next in Thread] |