summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorPeter Maydell2014-03-27 15:32:17 +0100
committerPeter Maydell2014-03-27 15:32:17 +0100
commit9ad665df2a9eeb8ed6f3501896e45c1a3cd9dd5f (patch)
tree98d331da8ca0de2ee028d31512f1b7d58e60ec3c /util
parentMerge remote-tracking branch 'remotes/mcayland/qemu-sparc' into staging (diff)
parentmigration: add more traces (diff)
downloadqemu-9ad665df2a9eeb8ed6f3501896e45c1a3cd9dd5f.tar.gz
qemu-9ad665df2a9eeb8ed6f3501896e45c1a3cd9dd5f.tar.xz
qemu-9ad665df2a9eeb8ed6f3501896e45c1a3cd9dd5f.zip
Merge remote-tracking branch 'remotes/amit-migration/tags/for_upstream' into staging
migration: traces Adds trace messages to migration path. Patches have been on list for a while, and have been reviewed by Juan. # gpg: Signature made Thu 27 Mar 2014 10:44:21 GMT using RSA key ID 854083B6 # gpg: Can't check signature: public key not found * remotes/amit-migration/tags/for_upstream: migration: add more traces util: add qemu_ether_ntoa Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'util')
-rw-r--r--util/cutils.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/util/cutils.c b/util/cutils.c
index 0116fcde74..b337293239 100644
--- a/util/cutils.c
+++ b/util/cutils.c
@@ -27,6 +27,7 @@
#include "qemu/sockets.h"
#include "qemu/iov.h"
+#include "net/net.h"
void strpadcpy(char *buf, int buf_size, const char *str, char pad)
{
@@ -530,3 +531,16 @@ 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;
+}