[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 2/2] net: introduce command to query rx-filte
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH v3 2/2] net: introduce command to query rx-filter information |
Date: |
Wed, 26 Jun 2013 09:14:40 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) |
Eric Blake <address@hidden> writes:
> On 05/23/2013 03:08 AM, Amos Kong wrote:
>> We want to implement mac programming over macvtap through Libvirt,
>> related rx-filter configuration contains main mac, some of rx-mode
>> and mac-table.
>>
>> The previous patch adds QMP event to notify management of rx-filter
>> change. This patch adds a monitor command to query rx-filter
>> information.
>>
>> A flag is used to avoid events flooding, if user don't query
>
> s/don't/doesn't/
>
>> rx-filter after receives one event, new events won't be sent
>
> s/after/after it/
>
>> to qmp monitor.
>>
>> +++ b/net/net.c
>> @@ -961,6 +961,53 @@ void print_net_client(Monitor *mon, NetClientState *nc)
>> nc->info_str);
>> }
>>
>> +RxFilterInfoList *qmp_query_rx_filter(bool has_name, const char *name,
>> + Error **errp)
>> +{
>> + NetClientState *nc;
>> + RxFilterInfoList *filter_list = NULL, *last_entry = NULL;
>> +
>> + QTAILQ_FOREACH(nc, &net_clients, next) {
>> + RxFilterInfoList *entry;
>> + RxFilterInfo *info;
>> +
>> + if (nc->info->type != NET_CLIENT_OPTIONS_KIND_NIC) {
>> + continue;
>> + }
>> + if (has_name && strcmp(nc->name, name) != 0) {
>
> Do you need the has_name argument here, or can you ensure that the
> caller passes NULL when the caller's has_name was false, for one less
> parameter and the same amount of information?
QAPI always generates a has_FOO parameter for an optional FOO parameter,
even when FOO is a pointer, which has the perfectly obvious special "not
given" value NULL. I hate that.
[...]
- Re: [Qemu-devel] [PATCH v3 2/2] net: introduce command to query rx-filter information,
Markus Armbruster <=
- Re: [Qemu-devel] [PATCH v3 2/2] net: introduce command to query rx-filter information, Markus Armbruster, 2013/06/26
- Re: [Qemu-devel] [PATCH v3 2/2] net: introduce command to query rx-filter information, Markus Armbruster, 2013/06/26
- Re: [Qemu-devel] [PATCH v3 2/2] net: introduce command to query rx-filter information, Markus Armbruster, 2013/06/26
- Re: [Qemu-devel] [PATCH v3 2/2] net: introduce command to query rx-filter information, Luiz Capitulino, 2013/06/26
- Re: [Qemu-devel] [PATCH v3 2/2] net: introduce command to query rx-filter information, Markus Armbruster, 2013/06/26
- Re: [Qemu-devel] [PATCH v3 2/2] net: introduce command to query rx-filter information, Eric Blake, 2013/06/28
- Re: [Qemu-devel] [PATCH v3 2/2] net: introduce command to query rx-filter information, Markus Armbruster, 2013/06/28
- Re: [Qemu-devel] [PATCH v3 2/2] net: introduce command to query rx-filter information, Amos Kong, 2013/06/30