Re: [PATCH v2 2/7] bandwidth: Declare internal structures

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

 



2011/7/18 Jiri Denemark <jdenemar@xxxxxxxxxx>:
> On Tue, Jul 12, 2011 at 13:57:08 +0200, Michal Privoznik wrote:
>> ---
>>  src/util/network.h |   16 ++++++++++++++++
>>  1 files changed, 16 insertions(+), 0 deletions(-)
>>
>> diff --git a/src/util/network.h b/src/util/network.h
>> index ed0b78c..568bca1 100644
>> --- a/src/util/network.h
>> +++ b/src/util/network.h
>> @@ -45,6 +45,22 @@ typedef struct {
>>
>>  typedef virSocketAddr *virSocketAddrPtr;
>>
>> +typedef struct {
>> +    /* Even if we let user to input rates
>> +     * in various units, we store them in bps */
>
> Let's not allow users to use various units :-)

ditto

>> +    unsigned long average;
>> +    unsigned long peak;
>> +    unsigned long burst;
>> +} virRate;

Also don't use long, as it's size is compiler and architecture
dependent. Make it either int if that's large enough or make it long
long to guarantee 64bit size if we need that here.

-- 
Matthias Bolte
http://photron.blogspot.com

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]