qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 2/3] qga: implement qmp_guest_get_vcpus() for Linux with sysfs
Date: Thu, 07 Mar 2013 00:40:59 +0100	[thread overview]
Message-ID: <5137D40B.8020506@redhat.com> (raw)
In-Reply-To: <5137CE15.1080206@redhat.com>

On 03/07/13 00:15, Eric Blake wrote:
> On 03/06/2013 02:59 PM, Laszlo Ersek wrote:
>> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
>> ---
>>  qga/commands-posix.c |  146 +++++++++++++++++++++++++++++++++++++++++++++++--
>>  1 files changed, 140 insertions(+), 6 deletions(-)
>>
> 
>> @@ -1027,6 +1031,136 @@ error:
>>      return NULL;
>>  }
>>  
>> +#define SYSCONF_EXACT(name, err) sysconf_exact((name), #name, (err))
> 
> Technically, the inner () are redundant (in a parameter list, there is
> no syntax that can be rendered differently if you called
> sysconf_exact(name, #name, err)); but I don't mind keeping them for
> style purposes (the rule of thumb of parenthesizing macro parameters for
> safety is a bit easier to remember if you always do it, even when it is
> redundant).

You're correct, of course. I was thinking of the comma operator within
the macro argument, but one has to parenthesize that even for the macro
invocation, and then those parens will show up in the replacement text
as well. For example, the following works:

  #define X(a, b) y(a, b)

  static void
  y(int p, int q)
  {
  }

  int
  main(void)
  {
    int t;

    X((t=1, 2), 3);
    return 0;
  }

>> +        vcpu->has_can_offline = true; /* lolspeak ftw */
> 
> Indeed :)

I was hoping you'd appreciate it :)

>
> Reviewed-by: Eric Blake <eblake@redhat.com>

Thanks!
Laszlo

  reply	other threads:[~2013-03-06 23:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-06 21:59 [Qemu-devel] [PATCH v2 0/3] qga/Linux: online/offline/query VCPUs via guest sysfs Laszlo Ersek
2013-03-06 21:59 ` [Qemu-devel] [PATCH v2 1/3] qga: introduce guest-get-vcpus / guest-set-vcpus with stubs Laszlo Ersek
2013-03-06 22:32   ` Eric Blake
2013-03-06 22:48     ` Laszlo Ersek
2013-03-06 23:24       ` mdroth
2013-03-06 21:59 ` [Qemu-devel] [PATCH v2 2/3] qga: implement qmp_guest_get_vcpus() for Linux with sysfs Laszlo Ersek
2013-03-06 23:15   ` Eric Blake
2013-03-06 23:40     ` Laszlo Ersek [this message]
2013-03-06 21:59 ` [Qemu-devel] [PATCH v2 3/3] qga: implement qmp_guest_set_vcpus() " Laszlo Ersek
2013-03-06 23:20   ` Eric Blake
2013-03-06 23:55     ` Laszlo Ersek

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=5137D40B.8020506@redhat.com \
    --to=lersek@redhat.com \
    --cc=eblake@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).