[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/21] util: remove the net/net.h dependency
From: |
marcandre . lureau |
Subject: |
[PULL 12/21] util: remove the net/net.h dependency |
Date: |
Tue, 22 Mar 2022 16:25:52 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Move qemu_ether_ntoa() which is only needed in net/.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
include/qemu-common.h | 1 -
net/announce.c | 13 +++++++++++++
util/cutils.c | 14 --------------
3 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/include/qemu-common.h b/include/qemu-common.h
index 19e254dbe53e..f0fe07cd74c3 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -108,7 +108,6 @@ void qemu_hexdump(FILE *fp, const char *prefix,
*/
int parse_debug_env(const char *name, int max, int initial);
-const char *qemu_ether_ntoa(const MACAddr *mac);
void page_size_init(void);
/* returns non-zero if dump is in progress, otherwise zero is
diff --git a/net/announce.c b/net/announce.c
index 26f057f5ee47..3b9e2f1f14e8 100644
--- a/net/announce.c
+++ b/net/announce.c
@@ -120,6 +120,19 @@ static int announce_self_create(uint8_t *buf,
return 60; /* len (FCS will be added by hardware) */
}
+/*
+ * Helper to print ethernet mac address
+ */
+static const char *qemu_ether_ntoa(const MACAddr *mac)
+{
+ static char ret[18];
+
+ snprintf(ret, sizeof(ret), "%02x:%02x:%02x:%02x:%02x:%02x",
+ mac->a[0], mac->a[1], mac->a[2], mac->a[3], mac->a[4], mac->a[5]);
+
+ return ret;
+}
+
static void qemu_announce_self_iter(NICState *nic, void *opaque)
{
AnnounceTimer *timer = opaque;
diff --git a/util/cutils.c b/util/cutils.c
index 53346138c970..0d475ec4cddd 100644
--- a/util/cutils.c
+++ b/util/cutils.c
@@ -27,7 +27,6 @@
#include <math.h>
#include "qemu-common.h"
-#include "net/net.h"
#include "qemu/ctype.h"
#include "qemu/cutils.h"
#include "qemu/error-report.h"
@@ -936,19 +935,6 @@ int parse_debug_env(const char *name, int max, int initial)
return debug;
}
-/*
- * Helper to print ethernet mac address
- */
-const char *qemu_ether_ntoa(const MACAddr *mac)
-{
- static char ret[18];
-
- snprintf(ret, sizeof(ret), "%02x:%02x:%02x:%02x:%02x:%02x",
- mac->a[0], mac->a[1], mac->a[2], mac->a[3], mac->a[4], mac->a[5]);
-
- return ret;
-}
-
/*
* Return human readable string for size @val.
* @val can be anything that uint64_t allows (no more than "16 EiB").
--
2.35.1.273.ge6ebfd0e8cbb
- [PULL 02/21] vl: typo fix in a comment, (continued)
- [PULL 02/21] vl: typo fix in a comment, marcandre . lureau, 2022/03/22
- [PULL 03/21] m68k/nios2-semi: fix gettimeofday() result check, marcandre . lureau, 2022/03/22
- [PULL 04/21] Drop qemu_foo() socket API wrapper, marcandre . lureau, 2022/03/22
- [PULL 09/21] Move HOST_LONG_BITS to compiler.h, marcandre . lureau, 2022/03/22
- [PULL 05/21] Replace GCC_FMT_ATTR with G_GNUC_PRINTF, marcandre . lureau, 2022/03/22
- [PULL 07/21] compiler.h: replace QEMU_SENTINEL with G_GNUC_NULL_TERMINATED, marcandre . lureau, 2022/03/22
- [PULL 06/21] compiler.h: replace QEMU_WARN_UNUSED_RESULT with G_GNUC_WARN_UNUSED_RESULT, marcandre . lureau, 2022/03/22
- [PULL 10/21] scripts/modinfo-collect: remove unused/dead code, marcandre . lureau, 2022/03/22
- [PULL 08/21] Simplify HOST_LONG_BITS, marcandre . lureau, 2022/03/22
- [PULL 11/21] util: remove needless includes, marcandre . lureau, 2022/03/22
- [PULL 12/21] util: remove the net/net.h dependency,
marcandre . lureau <=
- [PULL 13/21] qapi: remove needless include, marcandre . lureau, 2022/03/22
- [PULL 14/21] meson: move int128 checks from configure, marcandre . lureau, 2022/03/22
- [PULL 15/21] meson: fix CONFIG_ATOMIC128 check, marcandre . lureau, 2022/03/22
- [PULL 16/21] qapi: remove needless include, marcandre . lureau, 2022/03/22
- [PULL 17/21] qga: remove bswap.h include, marcandre . lureau, 2022/03/22
- [PULL 18/21] error: use GLib to remember the program name, marcandre . lureau, 2022/03/22
- [PULL 19/21] tests: remove needless include, marcandre . lureau, 2022/03/22
- [PULL 20/21] Remove trailing ; after G_DEFINE_AUTO macro, marcandre . lureau, 2022/03/22
- [PULL 21/21] qapi: remove needless include, marcandre . lureau, 2022/03/22
- Re: [PULL 00/21] Fixes patches, Peter Maydell, 2022/03/22