qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 2/3] qga: implement qmp_guest_get_vcpus() for


From: Laszlo Ersek
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
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130216 Thunderbird/17.0.3

On 03/07/13 00:15, Eric Blake wrote:
> On 03/06/2013 02:59 PM, Laszlo Ersek wrote:
>> Signed-off-by: Laszlo Ersek <address@hidden>
>> ---
>>  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 <address@hidden>

Thanks!
Laszlo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]