qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Tomáš Golembiovský" <tgolembi@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Michael Roth" <mdroth@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH] qga: report disk size and free space
Date: Tue, 3 Jul 2018 12:54:08 +0200	[thread overview]
Message-ID: <20180703125408.623d77fc@fiorina> (raw)
In-Reply-To: <0b2c142da5d44a4b645dee47b7c50dae87a90a05.1530606672.git.tgolembi@redhat.com>

On Tue,  3 Jul 2018 10:31:20 +0200
Tomáš Golembiovský <tgolembi@redhat.com> 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,
                                                                ^

    ERROR: spaces required around that '&' (ctx:VxV)
    #73: FILE: qga/commands-win32.c:712:
    +                (PULARGE_INTEGER)&fs->free) != 0) {
                                    ^

Seems that & is mistakenly interpreted as bitwise-AND operator. 
Or am I expected to format that as

  ..., (PULARGE_INTEGER) & fs->size, ...

because that looks... weird.


Also, checkpatch.pl itself suggest to look into MAINTAINERS to find out
whom to report false positives, but there is no maintainer there. :)

    Tomas


-- 
Tomáš Golembiovský <tgolembi@redhat.com>

  parent reply	other threads:[~2018-07-03 10:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-03  8:31 [Qemu-devel] [PATCH] qga: report disk size and free space Tomáš Golembiovský
2018-07-03 10:01 ` Marc-André Lureau
2018-07-03 10:36   ` Tomáš Golembiovský
2018-07-03 10:54 ` Tomáš Golembiovský [this message]
2018-07-03 16:26   ` Eric Blake
2018-07-03 11:39 ` no-reply
2018-07-03 16:24 ` Eric Blake
2018-07-10 17:58 ` Tomáš Golembiovský

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180703125408.623d77fc@fiorina \
    --to=tgolembi@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).