On 21.12.2012 19:43, Eric Blake wrote:
> On 12/21/2012 05:59 AM, Michal Privoznik wrote:
>> Nowadays only basic information is reported. However, with the
>> current implementation much more can be exposed to users. like
>> broadcast/destination address (the former in case of standard
>> ethernet device, the latter in case of PPP interface), if the
>> interface is up, of type loopback, in promisc mode or capable of
>> sending multicast.
>> ---
>>
> 
>> +++ b/qga/qapi-schema.json
>> @@ -480,26 +480,57 @@
>>  #
>>  # @prefix: Network prefix length of @ip-address
>>  #
>> -# Since: 1.1
>> +# @dest-address: The broadcast or peer address.
>> +#
>> +# Since: 1.1, @dest-address since 1.3
> 
> Actually, since 1.4 now (1.3 is already out).
> 
>>  ##
>>  { 'type': 'GuestIpAddress',
>>    'data': {'ip-address': 'str',
>>             'ip-address-type': 'GuestIpAddressType',
>> -           'prefix': 'int'} }
>> +           'prefix': 'int',
>> +           '*dest-address': 'str'} }
> 
> Is this field always going to be present in 1.4?  If so, then it doesn't
> need to be marked optional (even though it wasn't present in 1.3).

Not really. This field is gonna be there iff guest agent is able to dig
the info out. For instance, for PPP interfaces, I was unable to get
peer's address via getifaddrs(). Other utilities use netlink for that.
However, if interface has an broadcast address, this can be easily
obtained via getifaddrs(). That's why I am making this optional for now.

> 
>>  ##
>> +# @GuestNetworkInterfaceType:
>> +#
>> +# @broadcast: Interface has a broadcast address. In which case it is
>> +#             contained in @dest-address in @GuestIpAddress.
>> +#
>> +# @ppp: Interface is of point-to-point type. The peer address is then in
>> +#       @dest-address in @GuestIpAddress.
>> +#
>> +# Since: 1.3
> 
> 1.4
> 
>> +##
>> +{ 'enum': 'GuestNetworkInterfaceType',
>> +  'data': ['broadcast', 'ppp'] }
>> +##
>>  # @GuestNetworkInterface:
>>  #
>>  # @name: The name of interface for which info are being delivered
>>  #
>> +# @up: If the interface is up
>> +#
>> +# @loopback: If the interface is of loopback type
>> +#
>> +# @promisc: If the interface is in promiscuous mode
>> +#
>> +# @multicast: If the interface is cappable of multicast
> 
> s/cappable/capable/
> 
>> +#
>> +# @type: If the interface has a broadcast address(-es) assigned, or is a 
>> PPP.
>> +#
>>  # @hardware-address: Hardware address of @name
>>  #
>>  # @ip-addresses: List of addresses assigned to @name
>>  #
>> -# Since: 1.1
>> +# Since: 1.1, @up, @loopback, @promisc, @multicast and @type since 1.3
> 
> 1.4
> 
>>  ##
>>  { 'type': 'GuestNetworkInterface',
>>    'data': {'name': 'str',
>> +           'up': 'bool',
>> +           'loopback': 'bool',
>> +           'promisc': 'bool',
>> +           'multicast': 'bool',
>> +           '*type': 'GuestNetworkInterfaceType',
> 
> Again, is this field optional?

Yes. Because this actually tells type of 'dest-address' field which is
optional I think this one should be optional as well.

> 
>>             '*hardware-address': 'str',
>>             '*ip-addresses': ['GuestIpAddress'] } }
>>  
>>
> 

Michal

Reply via email to