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 12:53:37 +0800
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, May 23, 2013 at 01:23:40PM +0300, Michael S. Tsirkin wrote:
> On Thu, May 23, 2013 at 05:08:00PM +0800, Amos Kong wrote:

> > +    info->broadcast_allowed = n->nobcast;
> > +    info->multicast_overflow = n->mac_table.multi_overflow;
> > +    info->unicast_overflow = n->mac_table.uni_overflow;
> > +    info->main_mac = g_strdup_printf("%.2x:%.2x:%.2x:%.2x:%.2x:%.2x",
> > +                                     n->mac[0], n->mac[1], n->mac[2],
> > +                                     n->mac[3], n->mac[4], n->mac[5]);
> 
> We really want a helper for this g_strdup_printf thing IMO.

entry->value = mac_strdup_printf(n->mac_table.macs + i * ETH_ALEN);

static char *mac_strdup_printf(uint8_t *mac)
{
    return g_strdup_printf("%.2x:%.2x:%.2x:%.2x:%.2x:%.2x", mac[0],
                            mac[1], mac[2], mac[3], mac[4], mac[5]);
}


-- 
                        Amos.



reply via email to

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