Skip to contentSkip to conversation

Rename hexdump to avoid FreeBSD libutil conflict

PATCH In review Ed Maste 2 participants 2 messages May 16, 2013 – May 17, 2013

lore
Share & tools
lore

Ed Maste

author
#0 lore raw

PATCH v2 1/1 Rename hexdump to avoid FreeBSD libutil conflict

On FreeBSD libutil is used for openpty(), but it also provides a hexdump() which conflicts with QEMU's.

---
v1->v2: Add hexdump() use in iov.c

If desired I can workaround this via #define hacks in qemu-common.h instead; please let me know and I will submit that patch. This is needed to build on FreeBSD.

 hw/dma/pl330.c        |    4 ++--
 include/qemu-common.h |    2 +-
 util/hexdump.c        |    2 +-
 util/iov.c            |    2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)
hw/dma/pl330.c +2 -2
index 8b33138..60f5299 100644
@@ -1157,7 +1157,7 @@ static int pl330_exec_cycle(PL330Chan *channel)
         if (PL330_ERR_DEBUG > 1) {
             DB_PRINT("PL330 read from memory @%08x (size = %08x):\n",
                       q->addr, len);
-            hexdump((char *)buf, stderr, "", len);
+            qemu_hexdump((char *)buf, stderr, "", len);
         }
         fifo_res = pl330_fifo_push(&s->fifo, buf, len, q->tag);
         if (fifo_res == PL330_FIFO_OK) {
@@ -1189,7 +1189,7 @@ static int pl330_exec_cycle(PL330Chan *channel)
             if (PL330_ERR_DEBUG > 1) {
                 DB_PRINT("PL330 read from memory @%08x (size = %08x):\n",
                          q->addr, len);
-                hexdump((char *)buf, stderr, "", len);
+                qemu_hexdump((char *)buf, stderr, "", len);
             }
             if (q->inc) {
                 q->addr += len;
include/qemu-common.h +1 -1
index 7f18b8e..b9057d1 100644
@@ -443,7 +443,7 @@ int mod_utf8_codepoint(const char *s, size_t n, char **end);
  * Hexdump a buffer to a file. An optional string prefix is added to every line
  */
 
-void hexdump(const char *buf, FILE *fp, const char *prefix, size_t size);
+void qemu_hexdump(const char *buf, FILE *fp, const char *prefix, size_t size);
 
 /* vector definitions */
 #ifdef __ALTIVEC__
util/hexdump.c +1 -1
index 0d0efc8..969b340 100644
@@ -15,7 +15,7 @@
 
 #include "qemu-common.h"
 
-void hexdump(const char *buf, FILE *fp, const char *prefix, size_t size)
+void qemu_hexdump(const char *buf, FILE *fp, const char *prefix, size_t size)
 {
     unsigned int b;
 
util/iov.c +1 -1
index 78bbbe1..cc6e837 100644
@@ -225,7 +225,7 @@ void iov_hexdump(const struct iovec *iov, const unsigned int iov_cnt,
     size = size > limit ? limit : size;
     buf = g_malloc(size);
     iov_to_buf(iov, iov_cnt, 0, buf, size);
-    hexdump(buf, fp, prefix, size);
+    qemu_hexdump(buf, fp, prefix, size);
     g_free(buf);
 }
 
Signature · 1 line
1.7.10.3
Reviewed-by on v2 1/1
#1 lore raw

Il 16/05/2013 17:32, Ed Maste ha scritto:

Quoted 10 lines

On FreeBSD libutil is used for openpty(), but it also provides a hexdump() which conflicts with QEMU's.

---
v1->v2: Add hexdump() use in iov.c

If desired I can workaround this via #define hacks in qemu-common.h instead; please let me know and I will submit that patch. This is needed to build on FreeBSD.

No, it's fine and should be in 1.5 given the delay.

Quoted 68 lines
 hw/dma/pl330.c        |    4 ++--
 include/qemu-common.h |    2 +-
 util/hexdump.c        |    2 +-
 util/iov.c            |    2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)
hw/dma/pl330.c +2 -2
index 8b33138..60f5299 100644
@@ -1157,7 +1157,7 @@ static int pl330_exec_cycle(PL330Chan *channel)
         if (PL330_ERR_DEBUG > 1) {
             DB_PRINT("PL330 read from memory @%08x (size = %08x):\n",
                       q->addr, len);
-            hexdump((char *)buf, stderr, "", len);
+            qemu_hexdump((char *)buf, stderr, "", len);
         }
         fifo_res = pl330_fifo_push(&s->fifo, buf, len, q->tag);
         if (fifo_res == PL330_FIFO_OK) {
@@ -1189,7 +1189,7 @@ static int pl330_exec_cycle(PL330Chan *channel)
             if (PL330_ERR_DEBUG > 1) {
                 DB_PRINT("PL330 read from memory @%08x (size = %08x):\n",
                          q->addr, len);
-                hexdump((char *)buf, stderr, "", len);
+                qemu_hexdump((char *)buf, stderr, "", len);
             }
             if (q->inc) {
                 q->addr += len;
include/qemu-common.h +1 -1
index 7f18b8e..b9057d1 100644
@@ -443,7 +443,7 @@ int mod_utf8_codepoint(const char *s, size_t n, char **end);
  * Hexdump a buffer to a file. An optional string prefix is added to every line
  */
 
-void hexdump(const char *buf, FILE *fp, const char *prefix, size_t size);
+void qemu_hexdump(const char *buf, FILE *fp, const char *prefix, size_t size);
 
 /* vector definitions */
 #ifdef __ALTIVEC__
util/hexdump.c +1 -1
index 0d0efc8..969b340 100644
@@ -15,7 +15,7 @@
 
 #include "qemu-common.h"
 
-void hexdump(const char *buf, FILE *fp, const char *prefix, size_t size)
+void qemu_hexdump(const char *buf, FILE *fp, const char *prefix, size_t size)
 {
     unsigned int b;
 
util/iov.c +1 -1
index 78bbbe1..cc6e837 100644
@@ -225,7 +225,7 @@ void iov_hexdump(const struct iovec *iov, const unsigned int iov_cnt,
     size = size > limit ? limit : size;
     buf = g_malloc(size);
     iov_to_buf(iov, iov_cnt, 0, buf, size);
-    hexdump(buf, fp, prefix, size);
+    qemu_hexdump(buf, fp, prefix, size);
     g_free(buf);
 }