qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Tomas Golembiovsky" <tgolembi@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>,
	sjubran@redhat.com, okrishtal@virtuozzo.com,
	Michael Roth <mdroth@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH v4 11/11] qga-win: demystify namespace striping
Date: Wed, 10 Oct 2018 12:19:20 -0500	[thread overview]
Message-ID: <a7bff59d-6087-0517-b859-44be0681dfee@redhat.com> (raw)
In-Reply-To: <CAMxuvayviBgZXJJRiXNTd9Z2=tJZtkSjL-8RJODRM9NAtUufgA@mail.gmail.com>

On 10/4/18 8:20 AM, Marc-André Lureau wrote:
> Hi
> 
> On Thu, Oct 4, 2018 at 3:22 PM Tomáš Golembiovský <tgolembi@redhat.com> wrote:
>>
>> It was not obvious what exactly the cryptic string copying does to the
>> GUID. This change makes the intent clearer.

In the subject line, s/striping/stripping/ (this is about performing a 
'strip' operation on a prefix, but I read the subject as an instance of 
'stripe' as in drawing a line or fragmenting data in a RAID).

>> +++ b/qga/commands-win32.c
>> @@ -507,7 +507,14 @@ static GuestPCIAddress *get_pci_info(char *guid, Error **errp)
>>       char dev_name[MAX_PATH];
>>       char *buffer = NULL;
>>       GuestPCIAddress *pci = NULL;
>> -    char *name = g_strdup(&guid[4]);
>> +    char *name = NULL;
>> +
>> +    if ((g_str_has_prefix(guid, "\\\\.\\") == TRUE) ||
>> +        (g_str_has_prefix(guid, "\\\\?\\") == TRUE)) {

I find that 'cond == true' is redundant to just writing 'cond'. And that 
sentiment applies to both the <stdbool.h> 'bool' and to the glib 
abomination TRUE (why they had to invent their own boolean names, worse 
in every way compared to <stdbool.h>, is beyond me).

>> +        name = g_strdup(&guid[4]);
> 
> I find "guid + 4" easier to read though

Concur.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

      parent reply	other threads:[~2018-10-10 17:19 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-04 11:22 [Qemu-devel] [PATCH v4 00/11] qga: report serial number and disk node Tomáš Golembiovský
2018-10-04 11:22 ` [Qemu-devel] [PATCH v4 01/11] qga-win: fix crashes when PCI info cannot be retrived Tomáš Golembiovský
2018-10-04 13:21   ` Marc-André Lureau
2018-10-09 11:07     ` Tomáš Golembiovský
2018-10-10 23:35   ` Michael Roth
2018-10-11  1:04   ` Eric Blake
2018-10-04 11:22 ` [Qemu-devel] [PATCH v4 02/11] qga-win: handle NULL values Tomáš Golembiovský
2018-10-04 13:21   ` Marc-André Lureau
2018-10-10 23:08   ` Michael Roth
2018-10-04 11:22 ` [Qemu-devel] [PATCH v4 03/11] build: rename CONFIG_QGA_NTDDDISK to CONFIG_QGA_NTDDSCSI Tomáš Golembiovský
2018-10-04 13:21   ` Marc-André Lureau
2018-10-07  9:29     ` Sameeh Jubran
2018-10-04 11:22 ` [Qemu-devel] [PATCH v4 04/11] qga-win: add debugging information Tomáš Golembiovský
2018-10-04 13:21   ` Marc-André Lureau
2018-10-04 11:22 ` [Qemu-devel] [PATCH v4 05/11] qga-win: refactor disk properties (bus) Tomáš Golembiovský
2018-10-04 13:21   ` Marc-André Lureau
2018-10-04 11:22 ` [Qemu-devel] [PATCH v4 06/11] configure: add test for libudev Tomáš Golembiovský
2018-10-04 13:21   ` Marc-André Lureau
2018-10-04 11:22 ` [Qemu-devel] [PATCH v4 07/11] qga: report disk serial number Tomáš Golembiovský
2018-10-04 13:21   ` Marc-André Lureau
2018-10-04 11:22 ` [Qemu-devel] [PATCH v4 08/11] qga-win: refactor disk info Tomáš Golembiovský
2018-10-04 11:22 ` [Qemu-devel] [PATCH v4 09/11] qga-win: handle multi-disk volumes Tomáš Golembiovský
2018-10-07 12:13   ` Sameeh Jubran
2018-10-10 14:57     ` Tomáš Golembiovský
2018-10-04 11:22 ` [Qemu-devel] [PATCH v4 10/11] qga: return disk device in guest-get-fsinfo Tomáš Golembiovský
2018-10-04 13:20   ` Marc-André Lureau
2018-10-04 11:22 ` [Qemu-devel] [PATCH v4 11/11] qga-win: demystify namespace striping Tomáš Golembiovský
2018-10-04 13:20   ` Marc-André Lureau
2018-10-07 11:03     ` Sameeh Jubran
2018-10-09 12:38     ` Tomáš Golembiovský
2018-10-10 17:19     ` Eric Blake [this message]

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=a7bff59d-6087-0517-b859-44be0681dfee@redhat.com \
    --to=eblake@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=okrishtal@virtuozzo.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sjubran@redhat.com \
    --cc=tgolembi@redhat.com \
    /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).