qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/4] Rename all 'dprintf' macros to 'DPRINTF'
@ 2013-07-29 12:16 Peter Maydell
  2013-07-29 12:16 ` [Qemu-devel] [PATCH 1/4] block/sheepdog: Rename 'dprintf' " Peter Maydell
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Peter Maydell @ 2013-07-29 12:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Anthony Liguori, patches, Alexander Graf,
	Andreas Färber, qemu-ppc, Stefan Hajnoczi, Paolo Bonzini,
	Richard Henderson

'dprintf' is the name of a POSIX standard function:
 http://pubs.opengroup.org/onlinepubs/9699919799/functions/dprintf.html
and so we should not steal the name to use as a debug macro.
The clang compiler in particular will emit a warning about this
redefinition:

  hw/net/spapr_llan.c:43:9: error: 'dprintf' macro redefined [-Werror]
#define dprintf(fmt...)
        ^
/usr/include/x86_64-linux-gnu/bits/stdio2.h:189:12: note: previous definition is here
#   define dprintf(fd, ...) \
           ^
1 error generated.

This patch series fixes this with the simple approach
of renaming all the users of a 'dprintf' macro to 'DPRINTF'
(which is what this macro is already called in a number of
other files in the tree). It's almost entirely a simple
search and replace; there are two cases where I folded an
overlong line that checkpatch complained about.


Peter Maydell (4):
  block/sheepdog: Rename 'dprintf' to 'DPRINTF'
  s390x: Rename 'dprintf' to 'DPRINTF'
  target-ppc/kvm.c: Rename 'dprintf' to 'DPRINTF'
  spapr: Rename 'dprintf' to 'DPRINTF'

 block/sheepdog.c           |   30 ++++++++++++-------------
 hw/net/spapr_llan.c        |   26 +++++++++++-----------
 hw/ppc/spapr_vio.c         |    8 +++----
 hw/s390x/s390-virtio-bus.c |    4 ++--
 hw/s390x/s390-virtio.c     |    4 ++--
 hw/scsi/spapr_vscsi.c      |   49 +++++++++++++++++++++--------------------
 target-ppc/kvm.c           |   52 ++++++++++++++++++++++----------------------
 target-s390x/kvm.c         |   19 ++++++++--------
 8 files changed, 97 insertions(+), 95 deletions(-)

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Qemu-devel] [PATCH 1/4] block/sheepdog: Rename 'dprintf' to 'DPRINTF'
  2013-07-29 12:16 [Qemu-devel] [PATCH 0/4] Rename all 'dprintf' macros to 'DPRINTF' Peter Maydell
@ 2013-07-29 12:16 ` Peter Maydell
  2013-07-29 12:44   ` Kevin Wolf
  2013-07-29 12:16 ` [Qemu-devel] [PATCH 2/4] s390x: " Peter Maydell
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 10+ messages in thread
From: Peter Maydell @ 2013-07-29 12:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Anthony Liguori, patches, Alexander Graf,
	Andreas Färber, qemu-ppc, Stefan Hajnoczi, Paolo Bonzini,
	Richard Henderson

'dprintf' is the name of a POSIX standard function so we should not be
stealing it for our debug macro. Rename to 'DPRINTF' (in line with
a number of other source files.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 block/sheepdog.c |   30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/block/sheepdog.c b/block/sheepdog.c
index 6a41ad9..a506137 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -242,14 +242,14 @@ static inline bool is_snapshot(struct SheepdogInode *inode)
     return !!inode->snap_ctime;
 }
 
-#undef dprintf
+#undef DPRINTF
 #ifdef DEBUG_SDOG
-#define dprintf(fmt, args...)                                       \
+#define DPRINTF(fmt, args...)                                       \
     do {                                                            \
         fprintf(stdout, "%s %d: " fmt, __func__, __LINE__, ##args); \
     } while (0)
 #else
-#define dprintf(fmt, args...)
+#define DPRINTF(fmt, args...)
 #endif
 
 typedef struct SheepdogAIOCB SheepdogAIOCB;
@@ -729,7 +729,7 @@ static void coroutine_fn aio_read_response(void *opaque)
         break;
     case AIOCB_FLUSH_CACHE:
         if (rsp.result == SD_RES_INVALID_PARMS) {
-            dprintf("disable cache since the server doesn't support it\n");
+            DPRINTF("disable cache since the server doesn't support it\n");
             s->cache_flags = SD_FLAG_CMD_DIRECT;
             rsp.result = SD_RES_SUCCESS;
         }
@@ -1229,7 +1229,7 @@ static int coroutine_fn resend_aioreq(BDRVSheepdogState *s, AIOReq *aio_req)
          * the same object */
         QLIST_FOREACH(areq, &s->inflight_aio_head, aio_siblings) {
             if (areq != aio_req && areq->oid == aio_req->oid) {
-                dprintf("simultaneous CoW to %" PRIx64 "\n", aio_req->oid);
+                DPRINTF("simultaneous CoW to %" PRIx64 "\n", aio_req->oid);
                 QLIST_REMOVE(aio_req, aio_siblings);
                 QLIST_INSERT_HEAD(&s->pending_aio_head, aio_req, aio_siblings);
                 return SD_RES_SUCCESS;
@@ -1319,7 +1319,7 @@ static int sd_open(BlockDriverState *bs, QDict *options, int flags)
     s->discard_supported = true;
 
     if (snapid || tag[0] != '\0') {
-        dprintf("%" PRIx32 " snapshot inode was open.\n", vid);
+        DPRINTF("%" PRIx32 " snapshot inode was open.\n", vid);
         s->is_snapshot = true;
     }
 
@@ -1554,7 +1554,7 @@ static void sd_close(BlockDriverState *bs)
     unsigned int wlen, rlen = 0;
     int fd, ret;
 
-    dprintf("%s\n", s->name);
+    DPRINTF("%s\n", s->name);
 
     fd = connect_to_sdog(s);
     if (fd < 0) {
@@ -1714,7 +1714,7 @@ static int sd_create_branch(BDRVSheepdogState *s)
     char *buf;
     bool deleted;
 
-    dprintf("%" PRIx32 " is snapshot.\n", s->inode.vdi_id);
+    DPRINTF("%" PRIx32 " is snapshot.\n", s->inode.vdi_id);
 
     buf = g_malloc(SD_INODE_SIZE);
 
@@ -1730,7 +1730,7 @@ static int sd_create_branch(BDRVSheepdogState *s)
         goto out;
     }
 
-    dprintf("%" PRIx32 " is created.\n", vid);
+    DPRINTF("%" PRIx32 " is created.\n", vid);
 
     fd = connect_to_sdog(s);
     if (fd < 0) {
@@ -1751,7 +1751,7 @@ static int sd_create_branch(BDRVSheepdogState *s)
 
     s->is_snapshot = false;
     ret = 0;
-    dprintf("%" PRIx32 " was newly created.\n", s->inode.vdi_id);
+    DPRINTF("%" PRIx32 " was newly created.\n", s->inode.vdi_id);
 
 out:
     g_free(buf);
@@ -1841,11 +1841,11 @@ static int coroutine_fn sd_co_rw_vector(void *p)
         }
 
         if (create) {
-            dprintf("update ino (%" PRIu32 ") %" PRIu64 " %" PRIu64 " %ld\n",
+            DPRINTF("update ino (%" PRIu32 ") %" PRIu64 " %" PRIu64 " %ld\n",
                     inode->vdi_id, oid,
                     vid_to_data_oid(inode->data_vdi_id[idx], idx), idx);
             oid = vid_to_data_oid(inode->vdi_id, idx);
-            dprintf("new oid %" PRIx64 "\n", oid);
+            DPRINTF("new oid %" PRIx64 "\n", oid);
         }
 
         aio_req = alloc_aio_req(s, acb, oid, len, offset, flags, old_oid, done);
@@ -1978,7 +1978,7 @@ static int sd_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
     SheepdogInode *inode;
     unsigned int datalen;
 
-    dprintf("sn_info: name %s id_str %s s: name %s vm_state_size %" PRId64 " "
+    DPRINTF("sn_info: name %s id_str %s s: name %s vm_state_size %" PRId64 " "
             "is_snapshot %d\n", sn_info->name, sn_info->id_str,
             s->name, sn_info->vm_state_size, s->is_snapshot);
 
@@ -1989,7 +1989,7 @@ static int sd_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
         return -EINVAL;
     }
 
-    dprintf("%s %s\n", sn_info->name, sn_info->id_str);
+    DPRINTF("%s %s\n", sn_info->name, sn_info->id_str);
 
     s->inode.vm_state_size = sn_info->vm_state_size;
     s->inode.vm_clock_nsec = sn_info->vm_clock_nsec;
@@ -2033,7 +2033,7 @@ static int sd_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
     }
 
     memcpy(&s->inode, inode, datalen);
-    dprintf("s->inode: name %s snap_id %x oid %x\n",
+    DPRINTF("s->inode: name %s snap_id %x oid %x\n",
             s->inode.name, s->inode.snap_id, s->inode.vdi_id);
 
 cleanup:
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Qemu-devel] [PATCH 2/4] s390x: Rename 'dprintf' to 'DPRINTF'
  2013-07-29 12:16 [Qemu-devel] [PATCH 0/4] Rename all 'dprintf' macros to 'DPRINTF' Peter Maydell
  2013-07-29 12:16 ` [Qemu-devel] [PATCH 1/4] block/sheepdog: Rename 'dprintf' " Peter Maydell
@ 2013-07-29 12:16 ` Peter Maydell
  2013-07-29 12:16 ` [Qemu-devel] [PATCH 3/4] target-ppc/kvm.c: " Peter Maydell
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Peter Maydell @ 2013-07-29 12:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Anthony Liguori, patches, Alexander Graf,
	Andreas Färber, qemu-ppc, Stefan Hajnoczi, Paolo Bonzini,
	Richard Henderson

'dprintf' is the name of a POSIX standard function so we should not be
stealing it for our debug macro. Rename to 'DPRINTF' (in line with
a number of other source files.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/s390x/s390-virtio-bus.c |    4 ++--
 hw/s390x/s390-virtio.c     |    4 ++--
 target-s390x/kvm.c         |   19 ++++++++++---------
 3 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c
index 207eb82..f0aa941 100644
--- a/hw/s390x/s390-virtio-bus.c
+++ b/hw/s390x/s390-virtio-bus.c
@@ -38,10 +38,10 @@
 /* #define DEBUG_S390 */
 
 #ifdef DEBUG_S390
-#define dprintf(fmt, ...) \
+#define DPRINTF(fmt, ...) \
     do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
 #else
-#define dprintf(fmt, ...) \
+#define DPRINTF(fmt, ...) \
     do { } while (0)
 #endif
 
diff --git a/hw/s390x/s390-virtio.c b/hw/s390x/s390-virtio.c
index edbde00..439d732 100644
--- a/hw/s390x/s390-virtio.c
+++ b/hw/s390x/s390-virtio.c
@@ -41,10 +41,10 @@
 //#define DEBUG_S390
 
 #ifdef DEBUG_S390
-#define dprintf(fmt, ...) \
+#define DPRINTF(fmt, ...) \
     do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
 #else
-#define dprintf(fmt, ...) \
+#define DPRINTF(fmt, ...) \
     do { } while (0)
 #endif
 
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index 60e94f8..3ed5855 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -40,10 +40,10 @@
 /* #define DEBUG_KVM */
 
 #ifdef DEBUG_KVM
-#define dprintf(fmt, ...) \
+#define DPRINTF(fmt, ...) \
     do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
 #else
-#define dprintf(fmt, ...) \
+#define DPRINTF(fmt, ...) \
     do { } while (0)
 #endif
 
@@ -585,7 +585,7 @@ static int handle_priv(S390CPU *cpu, struct kvm_run *run,
     uint16_t ipbh0 = (run->s390_sieic.ipb & 0xffff0000) >> 16;
     uint8_t ipb = run->s390_sieic.ipb & 0xff;
 
-    dprintf("KVM: PRIV: %d\n", ipa1);
+    DPRINTF("KVM: PRIV: %d\n", ipa1);
     switch (ipa1) {
         case PRIV_SCLP_CALL:
             r = kvm_sclp_service_call(cpu, run, ipbh0);
@@ -598,7 +598,7 @@ static int handle_priv(S390CPU *cpu, struct kvm_run *run,
                     r = 0;
                 }
             } else {
-                dprintf("KVM: unknown PRIV: 0x%x\n", ipa1);
+                DPRINTF("KVM: unknown PRIV: 0x%x\n", ipa1);
                 r = -1;
             }
             break;
@@ -631,7 +631,7 @@ static int handle_diag(S390CPU *cpu, struct kvm_run *run, int ipb_code)
             sleep(10);
             break;
         default:
-            dprintf("KVM: unknown DIAG: 0x%x\n", ipb_code);
+            DPRINTF("KVM: unknown DIAG: 0x%x\n", ipb_code);
             r = -1;
             break;
     }
@@ -644,7 +644,7 @@ static int s390_cpu_restart(S390CPU *cpu)
     kvm_s390_interrupt(cpu, KVM_S390_RESTART, 0);
     s390_add_running_cpu(cpu);
     qemu_cpu_kick(CPU(cpu));
-    dprintf("DONE: SIGP cpu restart: %p\n", &cpu->env);
+    DPRINTF("DONE: SIGP cpu restart: %p\n", &cpu->env);
     return 0;
 }
 
@@ -672,7 +672,7 @@ static int s390_cpu_initial_reset(S390CPU *cpu)
         env->regs[i] = 0;
     }
 
-    dprintf("DONE: SIGP initial reset: %p\n", env);
+    DPRINTF("DONE: SIGP initial reset: %p\n", env);
     return 0;
 }
 
@@ -741,7 +741,8 @@ static int handle_instruction(S390CPU *cpu, struct kvm_run *run)
     int ipb_code = (run->s390_sieic.ipb & 0x0fff0000) >> 16;
     int r = -1;
 
-    dprintf("handle_instruction 0x%x 0x%x\n", run->s390_sieic.ipa, run->s390_sieic.ipb);
+    DPRINTF("handle_instruction 0x%x 0x%x\n",
+            run->s390_sieic.ipa, run->s390_sieic.ipb);
     switch (ipa0) {
     case IPA0_B2:
     case IPA0_B9:
@@ -775,7 +776,7 @@ static int handle_intercept(S390CPU *cpu)
     int icpt_code = run->s390_sieic.icptcode;
     int r = 0;
 
-    dprintf("intercept: 0x%x (at 0x%lx)\n", icpt_code,
+    DPRINTF("intercept: 0x%x (at 0x%lx)\n", icpt_code,
             (long)cs->kvm_run->psw_addr);
     switch (icpt_code) {
         case ICPT_INSTRUCTION:
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Qemu-devel] [PATCH 3/4] target-ppc/kvm.c: Rename 'dprintf' to 'DPRINTF'
  2013-07-29 12:16 [Qemu-devel] [PATCH 0/4] Rename all 'dprintf' macros to 'DPRINTF' Peter Maydell
  2013-07-29 12:16 ` [Qemu-devel] [PATCH 1/4] block/sheepdog: Rename 'dprintf' " Peter Maydell
  2013-07-29 12:16 ` [Qemu-devel] [PATCH 2/4] s390x: " Peter Maydell
@ 2013-07-29 12:16 ` Peter Maydell
  2013-07-29 12:16 ` [Qemu-devel] [PATCH 4/4] spapr: " Peter Maydell
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Peter Maydell @ 2013-07-29 12:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Anthony Liguori, patches, Alexander Graf,
	Andreas Färber, qemu-ppc, Stefan Hajnoczi, Paolo Bonzini,
	Richard Henderson

'dprintf' is the name of a POSIX standard function so we should not be
stealing it for our debug macro. Rename to 'DPRINTF' (in line with
a number of other source files.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target-ppc/kvm.c |   52 ++++++++++++++++++++++++++--------------------------
 1 file changed, 26 insertions(+), 26 deletions(-)

diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
index b0099e1..7ba2224 100644
--- a/target-ppc/kvm.c
+++ b/target-ppc/kvm.c
@@ -40,10 +40,10 @@
 //#define DEBUG_KVM
 
 #ifdef DEBUG_KVM
-#define dprintf(fmt, ...) \
+#define DPRINTF(fmt, ...) \
     do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
 #else
-#define dprintf(fmt, ...) \
+#define DPRINTF(fmt, ...) \
     do { } while (0)
 #endif
 
@@ -548,7 +548,7 @@ static int kvm_put_fp(CPUState *cs)
         reg.addr = (uintptr_t)&fpscr;
         ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg);
         if (ret < 0) {
-            dprintf("Unable to set FPSCR to KVM: %s\n", strerror(errno));
+            DPRINTF("Unable to set FPSCR to KVM: %s\n", strerror(errno));
             return ret;
         }
 
@@ -562,7 +562,7 @@ static int kvm_put_fp(CPUState *cs)
 
             ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg);
             if (ret < 0) {
-                dprintf("Unable to set %s%d to KVM: %s\n", vsx ? "VSR" : "FPR",
+                DPRINTF("Unable to set %s%d to KVM: %s\n", vsx ? "VSR" : "FPR",
                         i, strerror(errno));
                 return ret;
             }
@@ -574,7 +574,7 @@ static int kvm_put_fp(CPUState *cs)
         reg.addr = (uintptr_t)&env->vscr;
         ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg);
         if (ret < 0) {
-            dprintf("Unable to set VSCR to KVM: %s\n", strerror(errno));
+            DPRINTF("Unable to set VSCR to KVM: %s\n", strerror(errno));
             return ret;
         }
 
@@ -583,7 +583,7 @@ static int kvm_put_fp(CPUState *cs)
             reg.addr = (uintptr_t)&env->avr[i];
             ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg);
             if (ret < 0) {
-                dprintf("Unable to set VR%d to KVM: %s\n", i, strerror(errno));
+                DPRINTF("Unable to set VR%d to KVM: %s\n", i, strerror(errno));
                 return ret;
             }
         }
@@ -608,7 +608,7 @@ static int kvm_get_fp(CPUState *cs)
         reg.addr = (uintptr_t)&fpscr;
         ret = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &reg);
         if (ret < 0) {
-            dprintf("Unable to get FPSCR from KVM: %s\n", strerror(errno));
+            DPRINTF("Unable to get FPSCR from KVM: %s\n", strerror(errno));
             return ret;
         } else {
             env->fpscr = fpscr;
@@ -622,7 +622,7 @@ static int kvm_get_fp(CPUState *cs)
 
             ret = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &reg);
             if (ret < 0) {
-                dprintf("Unable to get %s%d from KVM: %s\n",
+                DPRINTF("Unable to get %s%d from KVM: %s\n",
                         vsx ? "VSR" : "FPR", i, strerror(errno));
                 return ret;
             } else {
@@ -639,7 +639,7 @@ static int kvm_get_fp(CPUState *cs)
         reg.addr = (uintptr_t)&env->vscr;
         ret = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &reg);
         if (ret < 0) {
-            dprintf("Unable to get VSCR from KVM: %s\n", strerror(errno));
+            DPRINTF("Unable to get VSCR from KVM: %s\n", strerror(errno));
             return ret;
         }
 
@@ -648,7 +648,7 @@ static int kvm_get_fp(CPUState *cs)
             reg.addr = (uintptr_t)&env->avr[i];
             ret = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &reg);
             if (ret < 0) {
-                dprintf("Unable to get VR%d from KVM: %s\n",
+                DPRINTF("Unable to get VR%d from KVM: %s\n",
                         i, strerror(errno));
                 return ret;
             }
@@ -670,7 +670,7 @@ static int kvm_get_vpa(CPUState *cs)
     reg.addr = (uintptr_t)&env->vpa_addr;
     ret = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &reg);
     if (ret < 0) {
-        dprintf("Unable to get VPA address from KVM: %s\n", strerror(errno));
+        DPRINTF("Unable to get VPA address from KVM: %s\n", strerror(errno));
         return ret;
     }
 
@@ -680,7 +680,7 @@ static int kvm_get_vpa(CPUState *cs)
     reg.addr = (uintptr_t)&env->slb_shadow_addr;
     ret = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &reg);
     if (ret < 0) {
-        dprintf("Unable to get SLB shadow state from KVM: %s\n",
+        DPRINTF("Unable to get SLB shadow state from KVM: %s\n",
                 strerror(errno));
         return ret;
     }
@@ -690,7 +690,7 @@ static int kvm_get_vpa(CPUState *cs)
     reg.addr = (uintptr_t)&env->dtl_addr;
     ret = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &reg);
     if (ret < 0) {
-        dprintf("Unable to get dispatch trace log state from KVM: %s\n",
+        DPRINTF("Unable to get dispatch trace log state from KVM: %s\n",
                 strerror(errno));
         return ret;
     }
@@ -716,7 +716,7 @@ static int kvm_put_vpa(CPUState *cs)
         reg.addr = (uintptr_t)&env->vpa_addr;
         ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg);
         if (ret < 0) {
-            dprintf("Unable to set VPA address to KVM: %s\n", strerror(errno));
+            DPRINTF("Unable to set VPA address to KVM: %s\n", strerror(errno));
             return ret;
         }
     }
@@ -727,7 +727,7 @@ static int kvm_put_vpa(CPUState *cs)
     reg.addr = (uintptr_t)&env->slb_shadow_addr;
     ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg);
     if (ret < 0) {
-        dprintf("Unable to set SLB shadow state to KVM: %s\n", strerror(errno));
+        DPRINTF("Unable to set SLB shadow state to KVM: %s\n", strerror(errno));
         return ret;
     }
 
@@ -736,7 +736,7 @@ static int kvm_put_vpa(CPUState *cs)
     reg.addr = (uintptr_t)&env->dtl_addr;
     ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg);
     if (ret < 0) {
-        dprintf("Unable to set dispatch trace log state to KVM: %s\n",
+        DPRINTF("Unable to set dispatch trace log state to KVM: %s\n",
                 strerror(errno));
         return ret;
     }
@@ -746,7 +746,7 @@ static int kvm_put_vpa(CPUState *cs)
         reg.addr = (uintptr_t)&env->vpa_addr;
         ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg);
         if (ret < 0) {
-            dprintf("Unable to set VPA address to KVM: %s\n", strerror(errno));
+            DPRINTF("Unable to set VPA address to KVM: %s\n", strerror(errno));
             return ret;
         }
     }
@@ -864,7 +864,7 @@ int kvm_arch_put_registers(CPUState *cs, int level)
 #ifdef TARGET_PPC64
         if (cap_papr) {
             if (kvm_put_vpa(cs) < 0) {
-                dprintf("Warning: Unable to set VPA information to KVM\n");
+                DPRINTF("Warning: Unable to set VPA information to KVM\n");
             }
         }
 #endif /* TARGET_PPC64 */
@@ -1073,7 +1073,7 @@ int kvm_arch_get_registers(CPUState *cs)
 #ifdef TARGET_PPC64
         if (cap_papr) {
             if (kvm_get_vpa(cs) < 0) {
-                dprintf("Warning: Unable to get VPA information from KVM\n");
+                DPRINTF("Warning: Unable to get VPA information from KVM\n");
             }
         }
 #endif
@@ -1127,7 +1127,7 @@ void kvm_arch_pre_run(CPUState *cs, struct kvm_run *run)
          */
         irq = KVM_INTERRUPT_SET;
 
-        dprintf("injected interrupt %d\n", irq);
+        DPRINTF("injected interrupt %d\n", irq);
         r = kvm_vcpu_ioctl(cs, KVM_INTERRUPT, &irq);
         if (r < 0) {
             printf("cpu %d fail inject %x\n", cs->cpu_index, irq);
@@ -1191,20 +1191,20 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run)
     switch (run->exit_reason) {
     case KVM_EXIT_DCR:
         if (run->dcr.is_write) {
-            dprintf("handle dcr write\n");
+            DPRINTF("handle dcr write\n");
             ret = kvmppc_handle_dcr_write(env, run->dcr.dcrn, run->dcr.data);
         } else {
-            dprintf("handle dcr read\n");
+            DPRINTF("handle dcr read\n");
             ret = kvmppc_handle_dcr_read(env, run->dcr.dcrn, &run->dcr.data);
         }
         break;
     case KVM_EXIT_HLT:
-        dprintf("handle halt\n");
+        DPRINTF("handle halt\n");
         ret = kvmppc_handle_halt(cpu);
         break;
 #if defined(TARGET_PPC64)
     case KVM_EXIT_PAPR_HCALL:
-        dprintf("handle PAPR hypercall\n");
+        DPRINTF("handle PAPR hypercall\n");
         run->papr_hcall.ret = spapr_hypercall(cpu,
                                               run->papr_hcall.nr,
                                               run->papr_hcall.args);
@@ -1212,12 +1212,12 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run)
         break;
 #endif
     case KVM_EXIT_EPR:
-        dprintf("handle epr\n");
+        DPRINTF("handle epr\n");
         run->epr.epr = ldl_phys(env->mpic_iack);
         ret = 0;
         break;
     case KVM_EXIT_WATCHDOG:
-        dprintf("handle watchdog expiry\n");
+        DPRINTF("handle watchdog expiry\n");
         watchdog_perform_action();
         ret = 0;
         break;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Qemu-devel] [PATCH 4/4] spapr: Rename 'dprintf' to 'DPRINTF'
  2013-07-29 12:16 [Qemu-devel] [PATCH 0/4] Rename all 'dprintf' macros to 'DPRINTF' Peter Maydell
                   ` (2 preceding siblings ...)
  2013-07-29 12:16 ` [Qemu-devel] [PATCH 3/4] target-ppc/kvm.c: " Peter Maydell
@ 2013-07-29 12:16 ` Peter Maydell
  2013-07-29 16:38 ` [Qemu-devel] [PATCH 0/4] Rename all 'dprintf' macros " Richard Henderson
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Peter Maydell @ 2013-07-29 12:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Anthony Liguori, patches, Alexander Graf,
	Andreas Färber, qemu-ppc, Stefan Hajnoczi, Paolo Bonzini,
	Richard Henderson

'dprintf' is the name of a POSIX standard function so we should not be
stealing it for our debug macro. Rename to 'DPRINTF' (in line with
a number of other source files.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/net/spapr_llan.c   |   26 +++++++++++++-------------
 hw/ppc/spapr_vio.c    |    8 ++++----
 hw/scsi/spapr_vscsi.c |   49 +++++++++++++++++++++++++------------------------
 3 files changed, 42 insertions(+), 41 deletions(-)

diff --git a/hw/net/spapr_llan.c b/hw/net/spapr_llan.c
index 03a09f2..6df83fc 100644
--- a/hw/net/spapr_llan.c
+++ b/hw/net/spapr_llan.c
@@ -38,9 +38,9 @@
 /*#define DEBUG*/
 
 #ifdef DEBUG
-#define dprintf(fmt...) do { fprintf(stderr, fmt); } while (0)
+#define DPRINTF(fmt...) do { fprintf(stderr, fmt); } while (0)
 #else
-#define dprintf(fmt...)
+#define DPRINTF(fmt...)
 #endif
 
 /*
@@ -105,7 +105,7 @@ static ssize_t spapr_vlan_receive(NetClientState *nc, const uint8_t *buf,
     uint64_t handle;
     uint8_t control;
 
-    dprintf("spapr_vlan_receive() [%s] rx_bufs=%d\n", sdev->qdev.id,
+    DPRINTF("spapr_vlan_receive() [%s] rx_bufs=%d\n", sdev->qdev.id,
             dev->rx_bufs);
 
     if (!dev->isopen) {
@@ -123,7 +123,7 @@ static ssize_t spapr_vlan_receive(NetClientState *nc, const uint8_t *buf,
         }
 
         bd = vio_ldq(sdev, dev->buf_list + buf_ptr);
-        dprintf("use_buf_ptr=%d bd=0x%016llx\n",
+        DPRINTF("use_buf_ptr=%d bd=0x%016llx\n",
                 buf_ptr, (unsigned long long)bd);
     } while ((!(bd & VLAN_BD_VALID) || (VLAN_BD_LEN(bd) < (size + 8)))
              && (buf_ptr != dev->use_buf_ptr));
@@ -138,14 +138,14 @@ static ssize_t spapr_vlan_receive(NetClientState *nc, const uint8_t *buf,
     dev->use_buf_ptr = buf_ptr;
     vio_stq(sdev, dev->buf_list + dev->use_buf_ptr, 0);
 
-    dprintf("Found buffer: ptr=%d num=%d\n", dev->use_buf_ptr, dev->rx_bufs);
+    DPRINTF("Found buffer: ptr=%d num=%d\n", dev->use_buf_ptr, dev->rx_bufs);
 
     /* Transfer the packet data */
     if (spapr_vio_dma_write(sdev, VLAN_BD_ADDR(bd) + 8, buf, size) < 0) {
         return -1;
     }
 
-    dprintf("spapr_vlan_receive: DMA write completed\n");
+    DPRINTF("spapr_vlan_receive: DMA write completed\n");
 
     /* Update the receive queue */
     control = VLAN_RXQC_TOGGLE | VLAN_RXQC_VALID;
@@ -159,7 +159,7 @@ static ssize_t spapr_vlan_receive(NetClientState *nc, const uint8_t *buf,
     vio_sth(sdev, VLAN_BD_ADDR(rxq_bd) + dev->rxq_ptr + 2, 8);
     vio_stb(sdev, VLAN_BD_ADDR(rxq_bd) + dev->rxq_ptr, control);
 
-    dprintf("wrote rxq entry (ptr=0x%llx): 0x%016llx 0x%016llx\n",
+    DPRINTF("wrote rxq entry (ptr=0x%llx): 0x%016llx 0x%016llx\n",
             (unsigned long long)dev->rxq_ptr,
             (unsigned long long)vio_ldq(sdev, VLAN_BD_ADDR(rxq_bd) +
                                         dev->rxq_ptr),
@@ -374,7 +374,7 @@ static target_ulong h_add_logical_lan_buffer(PowerPCCPU *cpu,
     VIOsPAPRVLANDevice *dev = VIO_SPAPR_VLAN_DEVICE(sdev);
     vlan_bd_t bd;
 
-    dprintf("H_ADD_LOGICAL_LAN_BUFFER(0x" TARGET_FMT_lx
+    DPRINTF("H_ADD_LOGICAL_LAN_BUFFER(0x" TARGET_FMT_lx
             ", 0x" TARGET_FMT_lx ")\n", reg, buf);
 
     if (!sdev) {
@@ -405,7 +405,7 @@ static target_ulong h_add_logical_lan_buffer(PowerPCCPU *cpu,
 
     dev->rx_bufs++;
 
-    dprintf("h_add_logical_lan_buffer():  Added buf  ptr=%d  rx_bufs=%d"
+    DPRINTF("h_add_logical_lan_buffer():  Added buf  ptr=%d  rx_bufs=%d"
             " bd=0x%016llx\n", dev->add_buf_ptr, dev->rx_bufs,
             (unsigned long long)buf);
 
@@ -425,14 +425,14 @@ static target_ulong h_send_logical_lan(PowerPCCPU *cpu, sPAPREnvironment *spapr,
     int i, nbufs;
     int ret;
 
-    dprintf("H_SEND_LOGICAL_LAN(0x" TARGET_FMT_lx ", <bufs>, 0x"
+    DPRINTF("H_SEND_LOGICAL_LAN(0x" TARGET_FMT_lx ", <bufs>, 0x"
             TARGET_FMT_lx ")\n", reg, continue_token);
 
     if (!sdev) {
         return H_PARAMETER;
     }
 
-    dprintf("rxbufs = %d\n", dev->rx_bufs);
+    DPRINTF("rxbufs = %d\n", dev->rx_bufs);
 
     if (!dev->isopen) {
         return H_DROPPED;
@@ -444,7 +444,7 @@ static target_ulong h_send_logical_lan(PowerPCCPU *cpu, sPAPREnvironment *spapr,
 
     total_len = 0;
     for (i = 0; i < 6; i++) {
-        dprintf("   buf desc: 0x" TARGET_FMT_lx "\n", bufs[i]);
+        DPRINTF("   buf desc: 0x" TARGET_FMT_lx "\n", bufs[i]);
         if (!(bufs[i] & VLAN_BD_VALID)) {
             break;
         }
@@ -452,7 +452,7 @@ static target_ulong h_send_logical_lan(PowerPCCPU *cpu, sPAPREnvironment *spapr,
     }
 
     nbufs = i;
-    dprintf("h_send_logical_lan() %d buffers, total length 0x%x\n",
+    DPRINTF("h_send_logical_lan() %d buffers, total length 0x%x\n",
             nbufs, total_len);
 
     if (total_len == 0) {
diff --git a/hw/ppc/spapr_vio.c b/hw/ppc/spapr_vio.c
index 7c6f6e4..c3f5f46 100644
--- a/hw/ppc/spapr_vio.c
+++ b/hw/ppc/spapr_vio.c
@@ -39,10 +39,10 @@
 /* #define DEBUG_SPAPR */
 
 #ifdef DEBUG_SPAPR
-#define dprintf(fmt, ...) \
+#define DPRINTF(fmt, ...) \
     do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
 #else
-#define dprintf(fmt, ...) \
+#define DPRINTF(fmt, ...) \
     do { } while (0)
 #endif
 
@@ -201,7 +201,7 @@ static target_ulong h_reg_crq(PowerPCCPU *cpu, sPAPREnvironment *spapr,
     dev->crq.qsize = queue_len;
     dev->crq.qnext = 0;
 
-    dprintf("CRQ for dev 0x" TARGET_FMT_lx " registered at 0x"
+    DPRINTF("CRQ for dev 0x" TARGET_FMT_lx " registered at 0x"
             TARGET_FMT_lx "/0x" TARGET_FMT_lx "\n",
             reg, queue_addr, queue_len);
     return H_SUCCESS;
@@ -213,7 +213,7 @@ static target_ulong free_crq(VIOsPAPRDevice *dev)
     dev->crq.qsize = 0;
     dev->crq.qnext = 0;
 
-    dprintf("CRQ for dev 0x%" PRIx32 " freed\n", dev->reg);
+    DPRINTF("CRQ for dev 0x%" PRIx32 " freed\n", dev->reg);
 
     return H_SUCCESS;
 }
diff --git a/hw/scsi/spapr_vscsi.c b/hw/scsi/spapr_vscsi.c
index 55b44b9..d4848bb 100644
--- a/hw/scsi/spapr_vscsi.c
+++ b/hw/scsi/spapr_vscsi.c
@@ -45,10 +45,10 @@
 /*#define DEBUG_VSCSI*/
 
 #ifdef DEBUG_VSCSI
-#define dprintf(fmt, ...) \
+#define DPRINTF(fmt, ...) \
     do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
 #else
-#define dprintf(fmt, ...) \
+#define DPRINTF(fmt, ...) \
     do { } while (0)
 #endif
 
@@ -218,7 +218,7 @@ static int vscsi_send_rsp(VSCSIState *s, vscsi_req *req,
     uint64_t tag = iu->srp.rsp.tag;
     int total_len = sizeof(iu->srp.rsp);
 
-    dprintf("VSCSI: Sending resp status: 0x%x, "
+    DPRINTF("VSCSI: Sending resp status: 0x%x, "
             "res_in: %d, res_out: %d\n", status, res_in, res_out);
 
     memset(iu, 0, sizeof(struct srp_rsp));
@@ -277,7 +277,7 @@ static int vscsi_srp_direct_data(VSCSIState *s, vscsi_req *req,
     uint32_t llen;
     int rc = 0;
 
-    dprintf("VSCSI: direct segment 0x%x bytes, va=0x%llx desc len=0x%x\n",
+    DPRINTF("VSCSI: direct segment 0x%x bytes, va=0x%llx desc len=0x%x\n",
             len, (unsigned long long)md->va, md->len);
 
     llen = MIN(len, md->len);
@@ -305,7 +305,7 @@ static int vscsi_srp_indirect_data(VSCSIState *s, vscsi_req *req,
     int rc = 0;
     uint32_t llen, total = 0;
 
-    dprintf("VSCSI: indirect segment 0x%x bytes, td va=0x%llx len=0x%x\n",
+    DPRINTF("VSCSI: indirect segment 0x%x bytes, td va=0x%llx len=0x%x\n",
             len, (unsigned long long)td->va, td->len);
 
     /* While we have data ... */
@@ -325,16 +325,16 @@ static int vscsi_srp_indirect_data(VSCSIState *s, vscsi_req *req,
         /* No descriptor at hand, fetch one */
         if (!md) {
             if (!req->total_desc) {
-                dprintf("VSCSI:   Out of descriptors !\n");
+                DPRINTF("VSCSI:   Out of descriptors !\n");
                 break;
             }
             md = req->cur_desc = &req->ext_desc;
-            dprintf("VSCSI:   Reading desc from 0x%llx\n",
+            DPRINTF("VSCSI:   Reading desc from 0x%llx\n",
                     (unsigned long long)td->va);
             rc = spapr_vio_dma_read(&s->vdev, td->va, md,
                                     sizeof(struct srp_direct_buf));
             if (rc) {
-                dprintf("VSCSI: spapr_vio_dma_read -> %d reading ext_desc\n",
+                DPRINTF("VSCSI: spapr_vio_dma_read -> %d reading ext_desc\n",
                         rc);
                 break;
             }
@@ -342,7 +342,7 @@ static int vscsi_srp_indirect_data(VSCSIState *s, vscsi_req *req,
             td->va += sizeof(struct srp_direct_buf);
             --req->total_desc;
         }
-        dprintf("VSCSI:   [desc va=0x%llx,len=0x%x] remaining=0x%x\n",
+        DPRINTF("VSCSI:   [desc va=0x%llx,len=0x%x] remaining=0x%x\n",
                 (unsigned long long)md->va, md->len, len);
 
         /* Perform transfer */
@@ -353,10 +353,10 @@ static int vscsi_srp_indirect_data(VSCSIState *s, vscsi_req *req,
             rc = spapr_vio_dma_write(&s->vdev, md->va, buf, llen);
         }
         if (rc) {
-            dprintf("VSCSI: spapr_vio_dma_r/w(%d) -> %d\n", req->writing, rc);
+            DPRINTF("VSCSI: spapr_vio_dma_r/w(%d) -> %d\n", req->writing, rc);
             break;
         }
-        dprintf("VSCSI:     data: %02x %02x %02x %02x...\n",
+        DPRINTF("VSCSI:     data: %02x %02x %02x %02x...\n",
                 buf[0], buf[1], buf[2], buf[3]);
 
         len -= llen;
@@ -375,7 +375,7 @@ static int vscsi_srp_transfer_data(VSCSIState *s, vscsi_req *req,
 
     switch (req->dma_fmt) {
     case SRP_NO_DATA_DESC:
-        dprintf("VSCSI: no data desc transfer, skipping 0x%x bytes\n", len);
+        DPRINTF("VSCSI: no data desc transfer, skipping 0x%x bytes\n", len);
         break;
     case SRP_DATA_DESC_DIRECT:
         err = vscsi_srp_direct_data(s, req, buf, len);
@@ -430,7 +430,7 @@ static int vscsi_preprocess_desc(vscsi_req *req)
         req->cur_desc = (struct srp_direct_buf *)(cmd->add_data + offset);
         req->total_desc = req->local_desc = 1;
         vscsi_swap_desc(req->cur_desc);
-        dprintf("VSCSI: using direct RDMA %s, 0x%x bytes MD: 0x%llx\n",
+        DPRINTF("VSCSI: using direct RDMA %s, 0x%x bytes MD: 0x%llx\n",
                 req->writing ? "write" : "read",
                 req->cur_desc->len, (unsigned long long)req->cur_desc->va);
         break;
@@ -445,7 +445,7 @@ static int vscsi_preprocess_desc(vscsi_req *req)
             vscsi_swap_desc(&req->ind_desc->desc_list[i]);
         }
         req->cur_desc = req->local_desc ? &req->ind_desc->desc_list[0] : NULL;
-        dprintf("VSCSI: using indirect RDMA %s, 0x%x bytes %d descs "
+        DPRINTF("VSCSI: using indirect RDMA %s, 0x%x bytes %d descs "
                 "(%d local) VA: 0x%llx\n",
                 req->writing ? "read" : "write",
                 be32_to_cpu(req->ind_desc->len),
@@ -469,7 +469,7 @@ static void vscsi_transfer_data(SCSIRequest *sreq, uint32_t len)
     uint8_t *buf;
     int rc = 0;
 
-    dprintf("VSCSI: SCSI xfer complete tag=0x%x len=0x%x, req=%p\n",
+    DPRINTF("VSCSI: SCSI xfer complete tag=0x%x len=0x%x, req=%p\n",
             sreq->tag, len, req);
     if (req == NULL) {
         fprintf(stderr, "VSCSI: Can't find request for tag 0x%x\n", sreq->tag);
@@ -499,7 +499,7 @@ static void vscsi_command_complete(SCSIRequest *sreq, uint32_t status, size_t re
     vscsi_req *req = sreq->hba_private;
     int32_t res_in = 0, res_out = 0;
 
-    dprintf("VSCSI: SCSI cmd complete, r=0x%x tag=0x%x status=0x%x, req=%p\n",
+    DPRINTF("VSCSI: SCSI cmd complete, r=0x%x tag=0x%x status=0x%x, req=%p\n",
             reason, sreq->tag, status, req);
     if (req == NULL) {
         fprintf(stderr, "VSCSI: Can't find request for tag 0x%x\n", sreq->tag);
@@ -509,16 +509,16 @@ static void vscsi_command_complete(SCSIRequest *sreq, uint32_t status, size_t re
     if (status == CHECK_CONDITION) {
         req->senselen = scsi_req_get_sense(req->sreq, req->sense,
                                            sizeof(req->sense));
-        dprintf("VSCSI: Sense data, %d bytes:\n", len);
-        dprintf("       %02x  %02x  %02x  %02x  %02x  %02x  %02x  %02x\n",
+        DPRINTF("VSCSI: Sense data, %d bytes:\n", len);
+        DPRINTF("       %02x  %02x  %02x  %02x  %02x  %02x  %02x  %02x\n",
                 req->sense[0], req->sense[1], req->sense[2], req->sense[3],
                 req->sense[4], req->sense[5], req->sense[6], req->sense[7]);
-        dprintf("       %02x  %02x  %02x  %02x  %02x  %02x  %02x  %02x\n",
+        DPRINTF("       %02x  %02x  %02x  %02x  %02x  %02x  %02x  %02x\n",
                 req->sense[8], req->sense[9], req->sense[10], req->sense[11],
                 req->sense[12], req->sense[13], req->sense[14], req->sense[15]);
     }
 
-    dprintf("VSCSI: Command complete err=%d\n", status);
+    DPRINTF("VSCSI: Command complete err=%d\n", status);
     if (status == 0) {
         /* We handle overflows, not underflows for normal commands,
          * but hopefully nobody cares
@@ -546,7 +546,7 @@ static void vscsi_process_login(VSCSIState *s, vscsi_req *req)
     struct srp_login_rsp *rsp = &iu->srp.login_rsp;
     uint64_t tag = iu->srp.rsp.tag;
 
-    dprintf("VSCSI: Got login, sendin response !\n");
+    DPRINTF("VSCSI: Got login, sendin response !\n");
 
     /* TODO handle case that requested size is wrong and
      * buffer format is wrong
@@ -612,7 +612,8 @@ static int vscsi_queue_cmd(VSCSIState *s, vscsi_req *req)
 
     sdev = vscsi_device_find(&s->bus, be64_to_cpu(srp->cmd.lun), &lun);
     if (!sdev) {
-        dprintf("VSCSI: Command for lun %08" PRIx64 " with no drive\n", be64_to_cpu(srp->cmd.lun));
+        DPRINTF("VSCSI: Command for lun %08" PRIx64 " with no drive\n",
+                be64_to_cpu(srp->cmd.lun));
         if (srp->cmd.cdb[0] == INQUIRY) {
             vscsi_inquiry_no_target(s, req);
         } else {
@@ -625,7 +626,7 @@ static int vscsi_queue_cmd(VSCSIState *s, vscsi_req *req)
     req->sreq = scsi_req_new(sdev, req->qtag, lun, srp->cmd.cdb, req);
     n = scsi_req_enqueue(req->sreq);
 
-    dprintf("VSCSI: Queued command tag 0x%x CMD 0x%x ID %d LUN %d ret: %d\n",
+    DPRINTF("VSCSI: Queued command tag 0x%x CMD 0x%x ID %d LUN %d ret: %d\n",
             req->qtag, srp->cmd.cdb[0], id, lun, n);
 
     if (n) {
@@ -838,7 +839,7 @@ static int vscsi_do_crq(struct VIOsPAPRDevice *dev, uint8_t *crq_data)
     crq.s.IU_length = be16_to_cpu(crq.s.IU_length);
     crq.s.IU_data_ptr = be64_to_cpu(crq.s.IU_data_ptr);
 
-    dprintf("VSCSI: do_crq %02x %02x ...\n", crq.raw[0], crq.raw[1]);
+    DPRINTF("VSCSI: do_crq %02x %02x ...\n", crq.raw[0], crq.raw[1]);
 
     switch (crq.s.valid) {
     case 0xc0: /* Init command/response */
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [PATCH 1/4] block/sheepdog: Rename 'dprintf' to 'DPRINTF'
  2013-07-29 12:16 ` [Qemu-devel] [PATCH 1/4] block/sheepdog: Rename 'dprintf' " Peter Maydell
@ 2013-07-29 12:44   ` Kevin Wolf
  2013-07-29 23:39     ` MORITA Kazutaka
  0 siblings, 1 reply; 10+ messages in thread
From: Kevin Wolf @ 2013-07-29 12:44 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Anthony Liguori, patches, Alexander Graf, qemu-devel,
	Andreas Färber, qemu-ppc, Stefan Hajnoczi, Paolo Bonzini,
	morita.kazutaka, Richard Henderson

Am 29.07.2013 um 14:16 hat Peter Maydell geschrieben:
> 'dprintf' is the name of a POSIX standard function so we should not be
> stealing it for our debug macro. Rename to 'DPRINTF' (in line with
> a number of other source files.)
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Acked-by: Kevin Wolf <kwolf@redhat.com>

(CCed Kazutaka in case he has any objections, unexpectedly)

> ---
>  block/sheepdog.c |   30 +++++++++++++++---------------
>  1 file changed, 15 insertions(+), 15 deletions(-)
> 
> diff --git a/block/sheepdog.c b/block/sheepdog.c
> index 6a41ad9..a506137 100644
> --- a/block/sheepdog.c
> +++ b/block/sheepdog.c
> @@ -242,14 +242,14 @@ static inline bool is_snapshot(struct SheepdogInode *inode)
>      return !!inode->snap_ctime;
>  }
>  
> -#undef dprintf
> +#undef DPRINTF
>  #ifdef DEBUG_SDOG
> -#define dprintf(fmt, args...)                                       \
> +#define DPRINTF(fmt, args...)                                       \
>      do {                                                            \
>          fprintf(stdout, "%s %d: " fmt, __func__, __LINE__, ##args); \
>      } while (0)
>  #else
> -#define dprintf(fmt, args...)
> +#define DPRINTF(fmt, args...)
>  #endif
>  
>  typedef struct SheepdogAIOCB SheepdogAIOCB;
> @@ -729,7 +729,7 @@ static void coroutine_fn aio_read_response(void *opaque)
>          break;
>      case AIOCB_FLUSH_CACHE:
>          if (rsp.result == SD_RES_INVALID_PARMS) {
> -            dprintf("disable cache since the server doesn't support it\n");
> +            DPRINTF("disable cache since the server doesn't support it\n");
>              s->cache_flags = SD_FLAG_CMD_DIRECT;
>              rsp.result = SD_RES_SUCCESS;
>          }
> @@ -1229,7 +1229,7 @@ static int coroutine_fn resend_aioreq(BDRVSheepdogState *s, AIOReq *aio_req)
>           * the same object */
>          QLIST_FOREACH(areq, &s->inflight_aio_head, aio_siblings) {
>              if (areq != aio_req && areq->oid == aio_req->oid) {
> -                dprintf("simultaneous CoW to %" PRIx64 "\n", aio_req->oid);
> +                DPRINTF("simultaneous CoW to %" PRIx64 "\n", aio_req->oid);
>                  QLIST_REMOVE(aio_req, aio_siblings);
>                  QLIST_INSERT_HEAD(&s->pending_aio_head, aio_req, aio_siblings);
>                  return SD_RES_SUCCESS;
> @@ -1319,7 +1319,7 @@ static int sd_open(BlockDriverState *bs, QDict *options, int flags)
>      s->discard_supported = true;
>  
>      if (snapid || tag[0] != '\0') {
> -        dprintf("%" PRIx32 " snapshot inode was open.\n", vid);
> +        DPRINTF("%" PRIx32 " snapshot inode was open.\n", vid);
>          s->is_snapshot = true;
>      }
>  
> @@ -1554,7 +1554,7 @@ static void sd_close(BlockDriverState *bs)
>      unsigned int wlen, rlen = 0;
>      int fd, ret;
>  
> -    dprintf("%s\n", s->name);
> +    DPRINTF("%s\n", s->name);
>  
>      fd = connect_to_sdog(s);
>      if (fd < 0) {
> @@ -1714,7 +1714,7 @@ static int sd_create_branch(BDRVSheepdogState *s)
>      char *buf;
>      bool deleted;
>  
> -    dprintf("%" PRIx32 " is snapshot.\n", s->inode.vdi_id);
> +    DPRINTF("%" PRIx32 " is snapshot.\n", s->inode.vdi_id);
>  
>      buf = g_malloc(SD_INODE_SIZE);
>  
> @@ -1730,7 +1730,7 @@ static int sd_create_branch(BDRVSheepdogState *s)
>          goto out;
>      }
>  
> -    dprintf("%" PRIx32 " is created.\n", vid);
> +    DPRINTF("%" PRIx32 " is created.\n", vid);
>  
>      fd = connect_to_sdog(s);
>      if (fd < 0) {
> @@ -1751,7 +1751,7 @@ static int sd_create_branch(BDRVSheepdogState *s)
>  
>      s->is_snapshot = false;
>      ret = 0;
> -    dprintf("%" PRIx32 " was newly created.\n", s->inode.vdi_id);
> +    DPRINTF("%" PRIx32 " was newly created.\n", s->inode.vdi_id);
>  
>  out:
>      g_free(buf);
> @@ -1841,11 +1841,11 @@ static int coroutine_fn sd_co_rw_vector(void *p)
>          }
>  
>          if (create) {
> -            dprintf("update ino (%" PRIu32 ") %" PRIu64 " %" PRIu64 " %ld\n",
> +            DPRINTF("update ino (%" PRIu32 ") %" PRIu64 " %" PRIu64 " %ld\n",
>                      inode->vdi_id, oid,
>                      vid_to_data_oid(inode->data_vdi_id[idx], idx), idx);
>              oid = vid_to_data_oid(inode->vdi_id, idx);
> -            dprintf("new oid %" PRIx64 "\n", oid);
> +            DPRINTF("new oid %" PRIx64 "\n", oid);
>          }
>  
>          aio_req = alloc_aio_req(s, acb, oid, len, offset, flags, old_oid, done);
> @@ -1978,7 +1978,7 @@ static int sd_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
>      SheepdogInode *inode;
>      unsigned int datalen;
>  
> -    dprintf("sn_info: name %s id_str %s s: name %s vm_state_size %" PRId64 " "
> +    DPRINTF("sn_info: name %s id_str %s s: name %s vm_state_size %" PRId64 " "
>              "is_snapshot %d\n", sn_info->name, sn_info->id_str,
>              s->name, sn_info->vm_state_size, s->is_snapshot);
>  
> @@ -1989,7 +1989,7 @@ static int sd_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
>          return -EINVAL;
>      }
>  
> -    dprintf("%s %s\n", sn_info->name, sn_info->id_str);
> +    DPRINTF("%s %s\n", sn_info->name, sn_info->id_str);
>  
>      s->inode.vm_state_size = sn_info->vm_state_size;
>      s->inode.vm_clock_nsec = sn_info->vm_clock_nsec;
> @@ -2033,7 +2033,7 @@ static int sd_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
>      }
>  
>      memcpy(&s->inode, inode, datalen);
> -    dprintf("s->inode: name %s snap_id %x oid %x\n",
> +    DPRINTF("s->inode: name %s snap_id %x oid %x\n",
>              s->inode.name, s->inode.snap_id, s->inode.vdi_id);
>  
>  cleanup:
> -- 
> 1.7.9.5
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [PATCH 0/4] Rename all 'dprintf' macros to 'DPRINTF'
  2013-07-29 12:16 [Qemu-devel] [PATCH 0/4] Rename all 'dprintf' macros to 'DPRINTF' Peter Maydell
                   ` (3 preceding siblings ...)
  2013-07-29 12:16 ` [Qemu-devel] [PATCH 4/4] spapr: " Peter Maydell
@ 2013-07-29 16:38 ` Richard Henderson
  2013-07-29 17:34 ` Andreas Färber
  2013-08-02 12:35 ` Anthony Liguori
  6 siblings, 0 replies; 10+ messages in thread
From: Richard Henderson @ 2013-07-29 16:38 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Kevin Wolf, Anthony Liguori, patches, Alexander Graf, qemu-devel,
	Andreas Färber, qemu-ppc, Stefan Hajnoczi, Paolo Bonzini

On 07/29/2013 02:16 AM, Peter Maydell wrote:
> Peter Maydell (4):
>   block/sheepdog: Rename 'dprintf' to 'DPRINTF'
>   s390x: Rename 'dprintf' to 'DPRINTF'
>   target-ppc/kvm.c: Rename 'dprintf' to 'DPRINTF'
>   spapr: Rename 'dprintf' to 'DPRINTF'

Acked-by: Richard Henderson <rth@twiddle.net>


r~

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [PATCH 0/4] Rename all 'dprintf' macros to 'DPRINTF'
  2013-07-29 12:16 [Qemu-devel] [PATCH 0/4] Rename all 'dprintf' macros to 'DPRINTF' Peter Maydell
                   ` (4 preceding siblings ...)
  2013-07-29 16:38 ` [Qemu-devel] [PATCH 0/4] Rename all 'dprintf' macros " Richard Henderson
@ 2013-07-29 17:34 ` Andreas Färber
  2013-08-02 12:35 ` Anthony Liguori
  6 siblings, 0 replies; 10+ messages in thread
From: Andreas Färber @ 2013-07-29 17:34 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Kevin Wolf, Anthony Liguori, patches, Alexander Graf, qemu-devel,
	qemu-ppc, Stefan Hajnoczi, Paolo Bonzini, Richard Henderson

Am 29.07.2013 14:16, schrieb Peter Maydell:
> Peter Maydell (4):
>   block/sheepdog: Rename 'dprintf' to 'DPRINTF'
>   s390x: Rename 'dprintf' to 'DPRINTF'
>   target-ppc/kvm.c: Rename 'dprintf' to 'DPRINTF'
>   spapr: Rename 'dprintf' to 'DPRINTF'

Series:

Reviewed-by: Andreas Färber <afaerber@suse.de>

Still hoping to test ppc and s390x KVM bits once I'm done rebasing and
sending out my own stuff.

Cheers,
Andreas

>  block/sheepdog.c           |   30 ++++++++++++-------------
>  hw/net/spapr_llan.c        |   26 +++++++++++-----------
>  hw/ppc/spapr_vio.c         |    8 +++----
>  hw/s390x/s390-virtio-bus.c |    4 ++--
>  hw/s390x/s390-virtio.c     |    4 ++--
>  hw/scsi/spapr_vscsi.c      |   49 +++++++++++++++++++++--------------------
>  target-ppc/kvm.c           |   52 ++++++++++++++++++++++----------------------
>  target-s390x/kvm.c         |   19 ++++++++--------
>  8 files changed, 97 insertions(+), 95 deletions(-)

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [PATCH 1/4] block/sheepdog: Rename 'dprintf' to 'DPRINTF'
  2013-07-29 12:44   ` Kevin Wolf
@ 2013-07-29 23:39     ` MORITA Kazutaka
  0 siblings, 0 replies; 10+ messages in thread
From: MORITA Kazutaka @ 2013-07-29 23:39 UTC (permalink / raw)
  To: Kevin Wolf
  Cc: Peter Maydell, Anthony Liguori, patches, qemu-devel,
	Alexander Graf, Andreas Färber, qemu-ppc, Stefan Hajnoczi,
	Paolo Bonzini, morita.kazutaka, Richard Henderson

At Mon, 29 Jul 2013 14:44:16 +0200,
Kevin Wolf wrote:
> 
> Am 29.07.2013 um 14:16 hat Peter Maydell geschrieben:
> > 'dprintf' is the name of a POSIX standard function so we should not be
> > stealing it for our debug macro. Rename to 'DPRINTF' (in line with
> > a number of other source files.)
> > 
> > Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> 
> Acked-by: Kevin Wolf <kwolf@redhat.com>
> 
> (CCed Kazutaka in case he has any objections, unexpectedly)

No problem.

Reviewed-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>

Thanks,

Kazutaka

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [PATCH 0/4] Rename all 'dprintf' macros to 'DPRINTF'
  2013-07-29 12:16 [Qemu-devel] [PATCH 0/4] Rename all 'dprintf' macros to 'DPRINTF' Peter Maydell
                   ` (5 preceding siblings ...)
  2013-07-29 17:34 ` Andreas Färber
@ 2013-08-02 12:35 ` Anthony Liguori
  6 siblings, 0 replies; 10+ messages in thread
From: Anthony Liguori @ 2013-08-02 12:35 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel
  Cc: Kevin Wolf, Anthony Liguori, patches, Alexander Graf, None,
	qemu-ppc, Stefan Hajnoczi, Paolo Bonzini, Richard Henderson

Applied.  Thanks.

Regards,

Anthony Liguori

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-08-02 20:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-29 12:16 [Qemu-devel] [PATCH 0/4] Rename all 'dprintf' macros to 'DPRINTF' Peter Maydell
2013-07-29 12:16 ` [Qemu-devel] [PATCH 1/4] block/sheepdog: Rename 'dprintf' " Peter Maydell
2013-07-29 12:44   ` Kevin Wolf
2013-07-29 23:39     ` MORITA Kazutaka
2013-07-29 12:16 ` [Qemu-devel] [PATCH 2/4] s390x: " Peter Maydell
2013-07-29 12:16 ` [Qemu-devel] [PATCH 3/4] target-ppc/kvm.c: " Peter Maydell
2013-07-29 12:16 ` [Qemu-devel] [PATCH 4/4] spapr: " Peter Maydell
2013-07-29 16:38 ` [Qemu-devel] [PATCH 0/4] Rename all 'dprintf' macros " Richard Henderson
2013-07-29 17:34 ` Andreas Färber
2013-08-02 12:35 ` Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).