[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v3 06/13] virtio-net: use qemu_mac_strdup_printf
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL v3 06/13] virtio-net: use qemu_mac_strdup_printf |
Date: |
Thu, 12 Mar 2015 12:19:50 +0000 |
From: Scott Feldman <address@hidden>
Signed-off-by: Scott Feldman <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
hw/net/virtio-net.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 27adcc5..321bef4 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -226,12 +226,6 @@ static void rxfilter_notify(NetClientState *nc)
}
}
-static char *mac_strdup_printf(const 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]);
-}
-
static intList *get_vlan_table(VirtIONet *n)
{
intList *list, *entry;
@@ -284,12 +278,12 @@ static RxFilterInfo
*virtio_net_query_rxfilter(NetClientState *nc)
info->multicast_overflow = n->mac_table.multi_overflow;
info->unicast_overflow = n->mac_table.uni_overflow;
- info->main_mac = mac_strdup_printf(n->mac);
+ info->main_mac = qemu_mac_strdup_printf(n->mac);
str_list = NULL;
for (i = 0; i < n->mac_table.first_multi; i++) {
entry = g_malloc0(sizeof(*entry));
- entry->value = mac_strdup_printf(n->mac_table.macs + i * ETH_ALEN);
+ entry->value = qemu_mac_strdup_printf(n->mac_table.macs + i *
ETH_ALEN);
entry->next = str_list;
str_list = entry;
}
@@ -298,7 +292,7 @@ static RxFilterInfo
*virtio_net_query_rxfilter(NetClientState *nc)
str_list = NULL;
for (i = n->mac_table.first_multi; i < n->mac_table.in_use; i++) {
entry = g_malloc0(sizeof(*entry));
- entry->value = mac_strdup_printf(n->mac_table.macs + i * ETH_ALEN);
+ entry->value = qemu_mac_strdup_printf(n->mac_table.macs + i *
ETH_ALEN);
entry->next = str_list;
str_list = entry;
}
--
2.1.0
- [Qemu-devel] [PULL v3 00/13] Net patches, Stefan Hajnoczi, 2015/03/12
- [Qemu-devel] [PULL v3 03/13] net: synchronize net_host_device_remove with host_net_remove_completion, Stefan Hajnoczi, 2015/03/12
- [Qemu-devel] [PULL v3 02/13] configure: silence glib unknown attribute __alloc_size__, Stefan Hajnoczi, 2015/03/12
- [Qemu-devel] [PULL v3 01/13] configure: handle clang -nopie argument warning, Stefan Hajnoczi, 2015/03/12
- [Qemu-devel] [PULL v3 05/13] net: add MAC address string printer, Stefan Hajnoczi, 2015/03/12
- [Qemu-devel] [PULL v3 04/13] tests: rtl8139: test timers and interrupt, Stefan Hajnoczi, 2015/03/12
- [Qemu-devel] [PULL v3 08/13] pci: add rocker device ID, Stefan Hajnoczi, 2015/03/12
- [Qemu-devel] [PULL v3 06/13] virtio-net: use qemu_mac_strdup_printf,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL v3 07/13] rocker: add register programming guide, Stefan Hajnoczi, 2015/03/12
- [Qemu-devel] [PULL v3 09/13] pci: add network device class 'other' for network switches, Stefan Hajnoczi, 2015/03/12
- [Qemu-devel] [PULL v3 11/13] rocker: add tests, Stefan Hajnoczi, 2015/03/12
- [Qemu-devel] [PULL v3 13/13] rocker: timestamp on the debug logs helps correlate with events in the VM, Stefan Hajnoczi, 2015/03/12
- Re: [Qemu-devel] [PULL v3 00/13] Net patches, Peter Maydell, 2015/03/12
- [Qemu-devel] [PULL v3 10/13] rocker: add new rocker switch device, Stefan Hajnoczi, 2015/03/12
- [Qemu-devel] [PULL v3 12/13] MAINTAINERS: add rocker, Stefan Hajnoczi, 2015/03/12