qemu-devel
[Top][All Lists]
Advanced

[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: Amos Kong
Subject: Re: [Qemu-devel] [PATCH v3 2/2] net: introduce command to query rx-filter information
Date: Fri, 24 May 2013 11:03:48 +0800
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, May 23, 2013 at 06:14:19AM -0600, Eric Blake wrote:
> On 05/23/2013 03:08 AM, Amos Kong wrote:

> > +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,

hmp_info_rx_filter() passes NULL name when has_name is false.
'has_name' is need here. Or we can change it to:

           if (name && strcmp(nc->name, name) != 0) { 

I think using 'has_name' is clearer.

> for one less parameter and the same amount of information?

qmp_query_rx_filter() define is generated by QAPI infrastructure,
the parameters are fixed. We also use it in hmp_info_rx_filter().

-- 
                        Amos.



reply via email to

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