qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v5] migrate: Move max-bandwidth and downtime-lim


From: Ashijeet Acharya
Subject: Re: [Qemu-devel] [PATCH v5] migrate: Move max-bandwidth and downtime-limit to migrate_set_parameter
Date: Wed, 14 Sep 2016 20:03:41 +0530

On Wed, Sep 14, 2016 at 7:28 PM, Eric Blake <address@hidden> wrote:
> On 09/14/2016 03:05 AM, Ashijeet Acharya wrote:
>
>>>> +    if (params->has_max_bandwidth &&
>>>> +        (params->max_bandwidth < 0 || params->max_bandwidth > SIZE_MAX)) {
>>>> +        error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
>>>> +                   "max_bandwidth",
>>>> +                   "an integer in the range of 0 to SIZE_MAX");
>>>
>>> Might be nicer to give a numeric value instead of assuming the reader
>>> knows what value SIZE_MAX has, but not the end of the world.
>>
>> I used SIZE_MAX because substituting it with its value looked a bit messy.
>> Should I use its actual value?
>
> as in ("...%zu", ..., SIZE_MAX), since not all platforms have the same
> value of SIZE_MAX.  I'm okay if you don't bother, but if you do, see if
> any other code does similar, and copy how they do it (I seem to recall
> past complaints about a cast being needed because at least one system
> has a broken header that defines SIZE_MAX with the wrong type).
>

Well, I did grep around to find any similar occurrences but
unfortunately I found none.
So, I am gonna use the method you described above.

Ashijeet
> --
> Eric Blake   eblake redhat com    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
>



reply via email to

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