* [Qemu-devel] [PATCH 00/11] trivial: Remove superfluous '\n' around error_report/error_setg
@ 2015-02-11 4:12 arei.gonglei
2015-02-11 4:12 ` [Qemu-devel] [PATCH 01/11] block: remove " arei.gonglei
` (11 more replies)
0 siblings, 12 replies; 16+ messages in thread
From: arei.gonglei @ 2015-02-11 4:12 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Gonglei, peter.huangpeng
From: Gonglei <arei.gonglei@huawei.com>
Yestoday, I found that some files have superflous '\n' charactor
around error_report/error_setg when reviewed patches.
By a simply script, the below files were listed. Classify and fix
them. It's suitable for appling via qemu-trivial IMHO.
Gonglei (11):
block: remove superfluous '\n' around error_report/error_setg
a9gtimer: remove superfluous '\n' around error_setg
pl330.c: remove superfluous '\n' around error_setg
numa: remove superfluous '\n' around error_setg
Remove superfluous '\n' around error_report()
vhost-scsi: Remove superfluous '\n' around error_report()
vfio: Remove superfluous '\n' around error_report()
xtensa: Remove superfluous '\n' around error_report()
tpm: Remove superfluous '\n' around error_report()
arm/digic_boards: Remove superfluous '\n' around error_report()
vhost: Remove superfluous '\n' around error_report()
block/archipelago.c | 6 +++---
exec.c | 2 +-
hw/arm/digic_boards.c | 6 +++---
hw/block/nand.c | 2 +-
hw/dma/pl330.c | 4 ++--
hw/ide/pci.c | 2 +-
hw/microblaze/boot.c | 2 +-
hw/scsi/vhost-scsi.c | 6 +++---
hw/timer/a9gtimer.c | 2 +-
hw/tpm/tpm_passthrough.c | 12 ++++++------
hw/vfio/common.c | 10 +++++-----
hw/virtio/vhost-backend.c | 2 +-
hw/xtensa/sim.c | 2 +-
hw/xtensa/xtfpga.c | 10 +++++-----
migration/rdma.c | 2 +-
net/vhost-user.c | 4 ++--
numa.c | 6 +++---
qemu-img.c | 2 +-
target-s390x/kvm.c | 2 +-
tpm.c | 2 +-
trace/control.c | 2 +-
21 files changed, 44 insertions(+), 44 deletions(-)
--
1.7.12.4
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH 01/11] block: remove superfluous '\n' around error_report/error_setg
2015-02-11 4:12 [Qemu-devel] [PATCH 00/11] trivial: Remove superfluous '\n' around error_report/error_setg arei.gonglei
@ 2015-02-11 4:12 ` arei.gonglei
2015-02-11 4:12 ` [Qemu-devel] [PATCH 02/11] a9gtimer: remove superfluous '\n' around error_setg arei.gonglei
` (10 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: arei.gonglei @ 2015-02-11 4:12 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Gonglei, peter.huangpeng
From: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
block/archipelago.c | 6 +++---
hw/block/nand.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/block/archipelago.c b/block/archipelago.c
index a8114b5..855655c 100644
--- a/block/archipelago.c
+++ b/block/archipelago.c
@@ -291,7 +291,7 @@ static int qemu_archipelago_init(BDRVArchipelagoState *s)
ret = qemu_archipelago_xseg_init(s);
if (ret < 0) {
- error_report("Cannot initialize XSEG. Aborting...\n");
+ error_report("Cannot initialize XSEG. Aborting...");
goto err_exit;
}
@@ -645,7 +645,7 @@ static int qemu_archipelago_create_volume(Error **errp, const char *volname,
target = xseg_get_target(xseg, req);
if (!target) {
- error_setg(errp, "Cannot get XSEG target.\n");
+ error_setg(errp, "Cannot get XSEG target.");
goto err_exit;
}
memcpy(target, volname, targetlen);
@@ -889,7 +889,7 @@ static BlockAIOCB *qemu_archipelago_aio_rw(BlockDriverState *bs,
return &aio_cb->common;
err_exit:
- error_report("qemu_archipelago_aio_rw(): I/O Error\n");
+ error_report("qemu_archipelago_aio_rw(): I/O Error");
qemu_aio_unref(aio_cb);
return NULL;
}
diff --git a/hw/block/nand.c b/hw/block/nand.c
index 1882a0c..61d2cec 100644
--- a/hw/block/nand.c
+++ b/hw/block/nand.c
@@ -393,7 +393,7 @@ static void nand_realize(DeviceState *dev, Error **errp)
nand_init_2048(s);
break;
default:
- error_setg(errp, "Unsupported NAND block size %#x\n",
+ error_setg(errp, "Unsupported NAND block size %#x",
1 << s->page_shift);
return;
}
--
1.7.12.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH 02/11] a9gtimer: remove superfluous '\n' around error_setg
2015-02-11 4:12 [Qemu-devel] [PATCH 00/11] trivial: Remove superfluous '\n' around error_report/error_setg arei.gonglei
2015-02-11 4:12 ` [Qemu-devel] [PATCH 01/11] block: remove " arei.gonglei
@ 2015-02-11 4:12 ` arei.gonglei
2015-02-11 4:12 ` [Qemu-devel] [PATCH 03/11] pl330.c: " arei.gonglei
` (9 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: arei.gonglei @ 2015-02-11 4:12 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Gonglei, peter.huangpeng
From: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
hw/timer/a9gtimer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/timer/a9gtimer.c b/hw/timer/a9gtimer.c
index 435142a..b087bbd 100644
--- a/hw/timer/a9gtimer.c
+++ b/hw/timer/a9gtimer.c
@@ -289,7 +289,7 @@ static void a9_gtimer_realize(DeviceState *dev, Error **errp)
int i;
if (s->num_cpu < 1 || s->num_cpu > A9_GTIMER_MAX_CPUS) {
- error_setg(errp, "%s: num-cpu must be between 1 and %d\n",
+ error_setg(errp, "%s: num-cpu must be between 1 and %d",
__func__, A9_GTIMER_MAX_CPUS);
return;
}
--
1.7.12.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH 03/11] pl330.c: remove superfluous '\n' around error_setg
2015-02-11 4:12 [Qemu-devel] [PATCH 00/11] trivial: Remove superfluous '\n' around error_report/error_setg arei.gonglei
2015-02-11 4:12 ` [Qemu-devel] [PATCH 01/11] block: remove " arei.gonglei
2015-02-11 4:12 ` [Qemu-devel] [PATCH 02/11] a9gtimer: remove superfluous '\n' around error_setg arei.gonglei
@ 2015-02-11 4:12 ` arei.gonglei
2015-02-16 9:45 ` Michael Tokarev
2015-02-11 4:12 ` [Qemu-devel] [PATCH 04/11] numa: " arei.gonglei
` (8 subsequent siblings)
11 siblings, 1 reply; 16+ messages in thread
From: arei.gonglei @ 2015-02-11 4:12 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Gonglei, peter.huangpeng
From: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
hw/dma/pl330.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/dma/pl330.c b/hw/dma/pl330.c
index 16cf77e..0f72b59 100644
--- a/hw/dma/pl330.c
+++ b/hw/dma/pl330.c
@@ -1566,7 +1566,7 @@ static void pl330_realize(DeviceState *dev, Error **errp)
s->cfg[1] |= 5;
break;
default:
- error_setg(errp, "Bad value for i-cache_len property: %" PRIx8 "\n",
+ error_setg(errp, "Bad value for i-cache_len property: %" PRIx8 "",
s->i_cache_len);
return;
}
@@ -1601,7 +1601,7 @@ static void pl330_realize(DeviceState *dev, Error **errp)
s->cfg[CFG_CRD] |= 0x4;
break;
default:
- error_setg(errp, "Bad value for data_width property: %" PRIx8 "\n",
+ error_setg(errp, "Bad value for data_width property: %" PRIx8 "",
s->data_width);
return;
}
--
1.7.12.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH 04/11] numa: remove superfluous '\n' around error_setg
2015-02-11 4:12 [Qemu-devel] [PATCH 00/11] trivial: Remove superfluous '\n' around error_report/error_setg arei.gonglei
` (2 preceding siblings ...)
2015-02-11 4:12 ` [Qemu-devel] [PATCH 03/11] pl330.c: " arei.gonglei
@ 2015-02-11 4:12 ` arei.gonglei
2015-02-11 4:12 ` [Qemu-devel] [PATCH 05/11] Remove superfluous '\n' around error_report() arei.gonglei
` (7 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: arei.gonglei @ 2015-02-11 4:12 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Gonglei, peter.huangpeng
From: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
numa.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/numa.c b/numa.c
index afd2866..6decd13 100644
--- a/numa.c
+++ b/numa.c
@@ -59,7 +59,7 @@ static void numa_node_parse(NumaNodeOptions *node, QemuOpts *opts, Error **errp)
if (nodenr >= MAX_NODES) {
error_setg(errp, "Max number of NUMA nodes reached: %"
- PRIu16 "\n", nodenr);
+ PRIu16 "", nodenr);
return;
}
@@ -78,7 +78,7 @@ static void numa_node_parse(NumaNodeOptions *node, QemuOpts *opts, Error **errp)
}
if (node->has_mem && node->has_memdev) {
- error_setg(errp, "qemu: cannot specify both mem= and memdev=\n");
+ error_setg(errp, "qemu: cannot specify both mem= and memdev=");
return;
}
@@ -87,7 +87,7 @@ static void numa_node_parse(NumaNodeOptions *node, QemuOpts *opts, Error **errp)
}
if (node->has_memdev != have_memdevs) {
error_setg(errp, "qemu: memdev option must be specified for either "
- "all or no nodes\n");
+ "all or no nodes");
return;
}
--
1.7.12.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH 05/11] Remove superfluous '\n' around error_report()
2015-02-11 4:12 [Qemu-devel] [PATCH 00/11] trivial: Remove superfluous '\n' around error_report/error_setg arei.gonglei
` (3 preceding siblings ...)
2015-02-11 4:12 ` [Qemu-devel] [PATCH 04/11] numa: " arei.gonglei
@ 2015-02-11 4:12 ` arei.gonglei
2015-02-11 4:12 ` [Qemu-devel] [PATCH 06/11] vhost-scsi: " arei.gonglei
` (6 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: arei.gonglei @ 2015-02-11 4:12 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Gonglei, peter.huangpeng
From: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
exec.c | 2 +-
hw/ide/pci.c | 2 +-
hw/microblaze/boot.c | 2 +-
migration/rdma.c | 2 +-
qemu-img.c | 2 +-
target-s390x/kvm.c | 2 +-
trace/control.c | 2 +-
7 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/exec.c b/exec.c
index 6b79ad1..86653e5 100644
--- a/exec.c
+++ b/exec.c
@@ -1155,7 +1155,7 @@ static void *file_ram_alloc(RAMBlock *block,
error:
if (mem_prealloc) {
- error_report("%s\n", error_get_pretty(*errp));
+ error_report("%s", error_get_pretty(*errp));
exit(1);
}
return NULL;
diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index e3f2054..913a976 100644
--- a/hw/ide/pci.c
+++ b/hw/ide/pci.c
@@ -99,7 +99,7 @@ static int32_t bmdma_prepare_buf(IDEDMA *dma, int is_write)
* This should accommodate the largest ATA transaction
* for LBA48 (65,536 sectors) and 32K sector sizes. */
if (s->sg.size > INT32_MAX) {
- error_report("IDE: sglist describes more than 2GiB.\n");
+ error_report("IDE: sglist describes more than 2GiB.");
break;
}
bm->cur_prd_addr += l;
diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c
index a2843cd..38c59db 100644
--- a/hw/microblaze/boot.c
+++ b/hw/microblaze/boot.c
@@ -185,7 +185,7 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr ddr_base,
ram_size - initrd_offset);
}
if (initrd_size < 0) {
- error_report("qemu: could not load initrd '%s'\n",
+ error_report("qemu: could not load initrd '%s'",
initrd_filename);
exit(EXIT_FAILURE);
}
diff --git a/migration/rdma.c b/migration/rdma.c
index 6bee30c..1989f61 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -1627,7 +1627,7 @@ static int qemu_rdma_exchange_get_response(RDMAContext *rdma,
return -EIO;
}
if (head->len > RDMA_CONTROL_MAX_BUFFER - sizeof(*head)) {
- error_report("too long length: %d\n", head->len);
+ error_report("too long length: %d", head->len);
return -EINVAL;
}
if (sizeof(*head) + head->len != byte_len) {
diff --git a/qemu-img.c b/qemu-img.c
index e148af8..ec05ccf 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -1638,7 +1638,7 @@ static int img_convert(int argc, char **argv)
if (skip_create) {
int64_t output_sectors = bdrv_nb_sectors(out_bs);
if (output_sectors < 0) {
- error_report("unable to get output image length: %s\n",
+ error_report("unable to get output image length: %s",
strerror(-output_sectors));
ret = -1;
goto out;
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index 6f2d5b4..83c03d1 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -210,7 +210,7 @@ void kvm_s390_reset_vcpu(S390CPU *cpu)
* Before this ioctl cpu_synchronize_state() is called in common kvm
* code (kvm-all) */
if (kvm_vcpu_ioctl(cs, KVM_S390_INITIAL_RESET, NULL)) {
- error_report("Initial CPU reset failed on CPU %i\n", cs->cpu_index);
+ error_report("Initial CPU reset failed on CPU %i", cs->cpu_index);
}
}
diff --git a/trace/control.c b/trace/control.c
index 0d30801..995beb3 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -126,7 +126,7 @@ static void trace_init_events(const char *fname)
error_report("WARNING: trace event '%s' does not exist",
line_ptr);
} else if (!trace_event_get_state_static(ev)) {
- error_report("WARNING: trace event '%s' is not traceable\n",
+ error_report("WARNING: trace event '%s' is not traceable",
line_ptr);
} else {
trace_event_set_state_dynamic(ev, enable);
--
1.7.12.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH 06/11] vhost-scsi: Remove superfluous '\n' around error_report()
2015-02-11 4:12 [Qemu-devel] [PATCH 00/11] trivial: Remove superfluous '\n' around error_report/error_setg arei.gonglei
` (4 preceding siblings ...)
2015-02-11 4:12 ` [Qemu-devel] [PATCH 05/11] Remove superfluous '\n' around error_report() arei.gonglei
@ 2015-02-11 4:12 ` arei.gonglei
2015-02-11 4:12 ` [Qemu-devel] [PATCH 07/11] vfio: " arei.gonglei
` (5 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: arei.gonglei @ 2015-02-11 4:12 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Gonglei, peter.huangpeng
From: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
hw/scsi/vhost-scsi.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
index dcb2bc5..54f916e 100644
--- a/hw/scsi/vhost-scsi.c
+++ b/hw/scsi/vhost-scsi.c
@@ -82,7 +82,7 @@ static int vhost_scsi_start(VHostSCSI *s)
if (abi_version > VHOST_SCSI_ABI_VERSION) {
error_report("vhost-scsi: The running tcm_vhost kernel abi_version:"
" %d is greater than vhost_scsi userspace supports: %d, please"
- " upgrade your version of QEMU\n", abi_version,
+ " upgrade your version of QEMU", abi_version,
VHOST_SCSI_ABI_VERSION);
return -ENOSYS;
}
@@ -140,7 +140,7 @@ static void vhost_scsi_stop(VHostSCSI *s)
if (k->set_guest_notifiers) {
ret = k->set_guest_notifiers(qbus->parent, s->dev.nvqs, false);
if (ret < 0) {
- error_report("vhost guest notifier cleanup failed: %d\n", ret);
+ error_report("vhost guest notifier cleanup failed: %d", ret);
}
}
assert(ret >= 0);
@@ -185,7 +185,7 @@ static void vhost_scsi_set_status(VirtIODevice *vdev, uint8_t val)
ret = vhost_scsi_start(s);
if (ret < 0) {
- error_report("virtio-scsi: unable to start vhost: %s\n",
+ error_report("virtio-scsi: unable to start vhost: %s",
strerror(-ret));
/* There is no userspace virtio-scsi fallback so exit */
--
1.7.12.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH 07/11] vfio: Remove superfluous '\n' around error_report()
2015-02-11 4:12 [Qemu-devel] [PATCH 00/11] trivial: Remove superfluous '\n' around error_report/error_setg arei.gonglei
` (5 preceding siblings ...)
2015-02-11 4:12 ` [Qemu-devel] [PATCH 06/11] vhost-scsi: " arei.gonglei
@ 2015-02-11 4:12 ` arei.gonglei
2015-02-11 4:12 ` [Qemu-devel] [PATCH 08/11] xtensa: " arei.gonglei
` (4 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: arei.gonglei @ 2015-02-11 4:12 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Gonglei, peter.huangpeng
From: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
hw/vfio/common.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index e71385e..6c49cc4 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -201,7 +201,7 @@ static int vfio_dma_unmap(VFIOContainer *container,
};
if (ioctl(container->fd, VFIO_IOMMU_UNMAP_DMA, &unmap)) {
- error_report("VFIO_UNMAP_DMA: %d\n", -errno);
+ error_report("VFIO_UNMAP_DMA: %d", -errno);
return -errno;
}
@@ -234,7 +234,7 @@ static int vfio_dma_map(VFIOContainer *container, hwaddr iova,
return 0;
}
- error_report("VFIO_MAP_DMA: %d\n", -errno);
+ error_report("VFIO_MAP_DMA: %d", -errno);
return -errno;
}
@@ -274,7 +274,7 @@ static void vfio_iommu_map_notify(Notifier *n, void *data)
iotlb->translated_addr,
&xlat, &len, iotlb->perm & IOMMU_WO);
if (!memory_region_is_ram(mr)) {
- error_report("iommu map to non memory area %"HWADDR_PRIx"\n",
+ error_report("iommu map to non memory area %"HWADDR_PRIx"",
xlat);
return;
}
@@ -283,7 +283,7 @@ static void vfio_iommu_map_notify(Notifier *n, void *data)
* check that it did not truncate too much.
*/
if (len & iotlb->addr_mask) {
- error_report("iommu has granularity incompatible with target AS\n");
+ error_report("iommu has granularity incompatible with target AS");
return;
}
@@ -566,7 +566,7 @@ static void vfio_kvm_device_add_group(VFIOGroup *group)
};
if (kvm_vm_ioctl(kvm_state, KVM_CREATE_DEVICE, &cd)) {
- error_report("Failed to create KVM VFIO device: %m\n");
+ error_report("Failed to create KVM VFIO device: %m");
return;
}
--
1.7.12.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH 08/11] xtensa: Remove superfluous '\n' around error_report()
2015-02-11 4:12 [Qemu-devel] [PATCH 00/11] trivial: Remove superfluous '\n' around error_report/error_setg arei.gonglei
` (6 preceding siblings ...)
2015-02-11 4:12 ` [Qemu-devel] [PATCH 07/11] vfio: " arei.gonglei
@ 2015-02-11 4:12 ` arei.gonglei
2015-02-11 4:12 ` [Qemu-devel] [PATCH 09/11] tpm: " arei.gonglei
` (3 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: arei.gonglei @ 2015-02-11 4:12 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Gonglei, peter.huangpeng
From: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
hw/xtensa/sim.c | 2 +-
hw/xtensa/xtfpga.c | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/hw/xtensa/sim.c b/hw/xtensa/sim.c
index 37ea9ae..328d209 100644
--- a/hw/xtensa/sim.c
+++ b/hw/xtensa/sim.c
@@ -64,7 +64,7 @@ static void xtensa_sim_init(MachineState *machine)
for (n = 0; n < smp_cpus; n++) {
cpu = cpu_xtensa_init(cpu_model);
if (cpu == NULL) {
- error_report("unable to find CPU definition '%s'\n",
+ error_report("unable to find CPU definition '%s'",
cpu_model);
exit(EXIT_FAILURE);
}
diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c
index e5a6bba..bb90eb2 100644
--- a/hw/xtensa/xtfpga.c
+++ b/hw/xtensa/xtfpga.c
@@ -190,7 +190,7 @@ static void lx_init(const LxBoardDesc *board, MachineState *machine)
for (n = 0; n < smp_cpus; n++) {
cpu = cpu_xtensa_init(cpu_model);
if (cpu == NULL) {
- error_report("unable to find CPU definition '%s'\n",
+ error_report("unable to find CPU definition '%s'",
cpu_model);
exit(EXIT_FAILURE);
}
@@ -235,7 +235,7 @@ static void lx_init(const LxBoardDesc *board, MachineState *machine)
board->flash_size / board->flash_sector_size,
4, 0x0000, 0x0000, 0x0000, 0x0000, be);
if (flash == NULL) {
- error_report("unable to mount pflash\n");
+ error_report("unable to mount pflash");
exit(EXIT_FAILURE);
}
}
@@ -287,7 +287,7 @@ static void lx_init(const LxBoardDesc *board, MachineState *machine)
uint32_t dtb_addr = tswap32(cur_lowmem);
if (!fdt) {
- error_report("could not load DTB '%s'\n", dtb_filename);
+ error_report("could not load DTB '%s'", dtb_filename);
exit(EXIT_FAILURE);
}
@@ -307,7 +307,7 @@ static void lx_init(const LxBoardDesc *board, MachineState *machine)
lowmem_end - cur_lowmem);
}
if (initrd_size < 0) {
- error_report("could not load initrd '%s'\n", initrd_filename);
+ error_report("could not load initrd '%s'", initrd_filename);
exit(EXIT_FAILURE);
}
initrd_location.start = tswap32(cur_lowmem);
@@ -333,7 +333,7 @@ static void lx_init(const LxBoardDesc *board, MachineState *machine)
if (success > 0 && is_linux) {
entry_point = ep;
} else {
- error_report("could not load kernel '%s'\n",
+ error_report("could not load kernel '%s'",
kernel_filename);
exit(EXIT_FAILURE);
}
--
1.7.12.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH 09/11] tpm: Remove superfluous '\n' around error_report()
2015-02-11 4:12 [Qemu-devel] [PATCH 00/11] trivial: Remove superfluous '\n' around error_report/error_setg arei.gonglei
` (7 preceding siblings ...)
2015-02-11 4:12 ` [Qemu-devel] [PATCH 08/11] xtensa: " arei.gonglei
@ 2015-02-11 4:12 ` arei.gonglei
2015-02-11 4:12 ` [Qemu-devel] [PATCH 10/11] arm/digic_boards: " arei.gonglei
` (2 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: arei.gonglei @ 2015-02-11 4:12 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Gonglei, peter.huangpeng
From: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
hw/tpm/tpm_passthrough.c | 12 ++++++------
tpm.c | 2 +-
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/hw/tpm/tpm_passthrough.c b/hw/tpm/tpm_passthrough.c
index 2bf3c6f..13ac1d2 100644
--- a/hw/tpm/tpm_passthrough.c
+++ b/hw/tpm/tpm_passthrough.c
@@ -126,7 +126,7 @@ static int tpm_passthrough_unix_tx_bufs(TPMPassthruState *tpm_pt,
if (!tpm_pt->tpm_op_canceled ||
(tpm_pt->tpm_op_canceled && errno != ECANCELED)) {
error_report("tpm_passthrough: error while transmitting data "
- "to TPM: %s (%i)\n",
+ "to TPM: %s (%i)",
strerror(errno), errno);
}
goto err_exit;
@@ -139,14 +139,14 @@ static int tpm_passthrough_unix_tx_bufs(TPMPassthruState *tpm_pt,
if (!tpm_pt->tpm_op_canceled ||
(tpm_pt->tpm_op_canceled && errno != ECANCELED)) {
error_report("tpm_passthrough: error while reading data from "
- "TPM: %s (%i)\n",
+ "TPM: %s (%i)",
strerror(errno), errno);
}
} else if (ret < sizeof(struct tpm_resp_hdr) ||
tpm_passthrough_get_size_from_buffer(out) != ret) {
ret = -1;
error_report("tpm_passthrough: received invalid response "
- "packet from TPM\n");
+ "packet from TPM");
}
err_exit:
@@ -282,7 +282,7 @@ static void tpm_passthrough_cancel_cmd(TPMBackend *tb)
if (tpm_pt->cancel_fd >= 0) {
n = write(tpm_pt->cancel_fd, "-", 1);
if (n != 1) {
- error_report("Canceling TPM command failed: %s\n",
+ error_report("Canceling TPM command failed: %s",
strerror(errno));
} else {
tpm_pt->tpm_op_canceled = true;
@@ -413,13 +413,13 @@ static int tpm_passthrough_handle_device_opts(QemuOpts *opts, TPMBackend *tb)
tpm_pt->tpm_fd = qemu_open(tpm_pt->tpm_dev, O_RDWR);
if (tpm_pt->tpm_fd < 0) {
- error_report("Cannot access TPM device using '%s': %s\n",
+ error_report("Cannot access TPM device using '%s': %s",
tpm_pt->tpm_dev, strerror(errno));
goto err_free_parameters;
}
if (tpm_passthrough_test_tpmdev(tpm_pt->tpm_fd)) {
- error_report("'%s' is not a TPM device.\n",
+ error_report("'%s' is not a TPM device.",
tpm_pt->tpm_dev);
goto err_close_tpmdev;
}
diff --git a/tpm.c b/tpm.c
index c371023..0541535 100644
--- a/tpm.c
+++ b/tpm.c
@@ -134,7 +134,7 @@ static int configure_tpm(QemuOpts *opts)
Error *local_err = NULL;
if (!QLIST_EMPTY(&tpm_backends)) {
- error_report("Only one TPM is allowed.\n");
+ error_report("Only one TPM is allowed.");
return 1;
}
--
1.7.12.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH 10/11] arm/digic_boards: Remove superfluous '\n' around error_report()
2015-02-11 4:12 [Qemu-devel] [PATCH 00/11] trivial: Remove superfluous '\n' around error_report/error_setg arei.gonglei
` (8 preceding siblings ...)
2015-02-11 4:12 ` [Qemu-devel] [PATCH 09/11] tpm: " arei.gonglei
@ 2015-02-11 4:12 ` arei.gonglei
2015-02-11 4:12 ` [Qemu-devel] [PATCH 11/11] vhost: " arei.gonglei
2015-02-11 13:41 ` [Qemu-devel] [PATCH 00/11] trivial: Remove superfluous '\n' around error_report/error_setg Markus Armbruster
11 siblings, 0 replies; 16+ messages in thread
From: arei.gonglei @ 2015-02-11 4:12 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Gonglei, peter.huangpeng
From: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
hw/arm/digic_boards.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/arm/digic_boards.c b/hw/arm/digic_boards.c
index 2a4b872..7114c36 100644
--- a/hw/arm/digic_boards.c
+++ b/hw/arm/digic_boards.c
@@ -65,7 +65,7 @@ static void digic4_board_init(DigicBoard *board)
s->digic = DIGIC(object_new(TYPE_DIGIC));
object_property_set_bool(OBJECT(s->digic), true, "realized", &err);
if (err != NULL) {
- error_report("Couldn't realize DIGIC SoC: %s\n",
+ error_report("Couldn't realize DIGIC SoC: %s",
error_get_pretty(err));
exit(1);
}
@@ -104,13 +104,13 @@ static void digic_load_rom(DigicBoardState *s, hwaddr addr,
char *fn = qemu_find_file(QEMU_FILE_TYPE_BIOS, filename);
if (!fn) {
- error_report("Couldn't find rom image '%s'.\n", filename);
+ error_report("Couldn't find rom image '%s'.", filename);
exit(1);
}
rom_size = load_image_targphys(fn, addr, max_size);
if (rom_size < 0 || rom_size > max_size) {
- error_report("Couldn't load rom image '%s'.\n", filename);
+ error_report("Couldn't load rom image '%s'.", filename);
exit(1);
}
}
--
1.7.12.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH 11/11] vhost: Remove superfluous '\n' around error_report()
2015-02-11 4:12 [Qemu-devel] [PATCH 00/11] trivial: Remove superfluous '\n' around error_report/error_setg arei.gonglei
` (9 preceding siblings ...)
2015-02-11 4:12 ` [Qemu-devel] [PATCH 10/11] arm/digic_boards: " arei.gonglei
@ 2015-02-11 4:12 ` arei.gonglei
2015-02-11 13:41 ` [Qemu-devel] [PATCH 00/11] trivial: Remove superfluous '\n' around error_report/error_setg Markus Armbruster
11 siblings, 0 replies; 16+ messages in thread
From: arei.gonglei @ 2015-02-11 4:12 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Gonglei, peter.huangpeng
From: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
hw/virtio/vhost-backend.c | 2 +-
net/vhost-user.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/virtio/vhost-backend.c b/hw/virtio/vhost-backend.c
index ff4f200..4d68a27 100644
--- a/hw/virtio/vhost-backend.c
+++ b/hw/virtio/vhost-backend.c
@@ -61,7 +61,7 @@ int vhost_set_backend_type(struct vhost_dev *dev, VhostBackendType backend_type)
dev->vhost_ops = &user_ops;
break;
default:
- error_report("Unknown vhost backend type\n");
+ error_report("Unknown vhost backend type");
r = -1;
}
diff --git a/net/vhost-user.c b/net/vhost-user.c
index 24e050c..23babd6 100644
--- a/net/vhost-user.c
+++ b/net/vhost-user.c
@@ -122,12 +122,12 @@ static void net_vhost_user_event(void *opaque, int event)
case CHR_EVENT_OPENED:
vhost_user_start(s);
net_vhost_link_down(s, false);
- error_report("chardev \"%s\" went up\n", s->chr->label);
+ error_report("chardev \"%s\" went up", s->chr->label);
break;
case CHR_EVENT_CLOSED:
net_vhost_link_down(s, true);
vhost_user_stop(s);
- error_report("chardev \"%s\" went down\n", s->chr->label);
+ error_report("chardev \"%s\" went down", s->chr->label);
break;
}
}
--
1.7.12.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH 00/11] trivial: Remove superfluous '\n' around error_report/error_setg
2015-02-11 4:12 [Qemu-devel] [PATCH 00/11] trivial: Remove superfluous '\n' around error_report/error_setg arei.gonglei
` (10 preceding siblings ...)
2015-02-11 4:12 ` [Qemu-devel] [PATCH 11/11] vhost: " arei.gonglei
@ 2015-02-11 13:41 ` Markus Armbruster
2015-02-12 1:10 ` Gonglei
11 siblings, 1 reply; 16+ messages in thread
From: Markus Armbruster @ 2015-02-11 13:41 UTC (permalink / raw)
To: arei.gonglei; +Cc: qemu-trivial, qemu-devel, peter.huangpeng
<arei.gonglei@huawei.com> writes:
> From: Gonglei <arei.gonglei@huawei.com>
>
> Yestoday, I found that some files have superflous '\n' charactor
> around error_report/error_setg when reviewed patches.
>
> By a simply script, the below files were listed. Classify and fix
> them. It's suitable for appling via qemu-trivial IMHO.
You can find my script in commit 312fd5f :)
> Gonglei (11):
> block: remove superfluous '\n' around error_report/error_setg
> a9gtimer: remove superfluous '\n' around error_setg
> pl330.c: remove superfluous '\n' around error_setg
> numa: remove superfluous '\n' around error_setg
> Remove superfluous '\n' around error_report()
> vhost-scsi: Remove superfluous '\n' around error_report()
> vfio: Remove superfluous '\n' around error_report()
> xtensa: Remove superfluous '\n' around error_report()
> tpm: Remove superfluous '\n' around error_report()
> arm/digic_boards: Remove superfluous '\n' around error_report()
> vhost: Remove superfluous '\n' around error_report()
When I fixed this before, I didn't split it up (commits 312fd5f 6daf194
be62a2eb). Splitting it up is fine, of course. Having the catch-all as
PATCH 05/11 is a bit odd, though. Its qemu-img.c hunk could go into
PATCH 01, because qemu-img is part of the block subsystem. Not worth a
respin as far as I'm concerned.
Reviewed-by: Markus Armbruster <armbru@redhat.com>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH 00/11] trivial: Remove superfluous '\n' around error_report/error_setg
2015-02-11 13:41 ` [Qemu-devel] [PATCH 00/11] trivial: Remove superfluous '\n' around error_report/error_setg Markus Armbruster
@ 2015-02-12 1:10 ` Gonglei
0 siblings, 0 replies; 16+ messages in thread
From: Gonglei @ 2015-02-12 1:10 UTC (permalink / raw)
To: Markus Armbruster; +Cc: qemu-trivial, qemu-devel, peter.huangpeng
On 2015/2/11 21:41, Markus Armbruster wrote:
> <arei.gonglei@huawei.com> writes:
>
>> From: Gonglei <arei.gonglei@huawei.com>
>>
>> Yesterday, I found that some files have superfluous '\n' character
>> around error_report/error_setg when reviewed patches.
>>
>> By a simply script, the below files were listed. Classify and fix
>> them. It's suitable for applying via qemu-trivial IMHO.
>
> You can find my script in commit 312fd5f :)
>
It's cool, I haven't noticed it before. :)
>> Gonglei (11):
>> block: remove superfluous '\n' around error_report/error_setg
>> a9gtimer: remove superfluous '\n' around error_setg
>> pl330.c: remove superfluous '\n' around error_setg
>> numa: remove superfluous '\n' around error_setg
>> Remove superfluous '\n' around error_report()
>> vhost-scsi: Remove superfluous '\n' around error_report()
>> vfio: Remove superfluous '\n' around error_report()
>> xtensa: Remove superfluous '\n' around error_report()
>> tpm: Remove superfluous '\n' around error_report()
>> arm/digic_boards: Remove superfluous '\n' around error_report()
>> vhost: Remove superfluous '\n' around error_report()
>
> When I fixed this before, I didn't split it up (commits 312fd5f 6daf194
> be62a2eb). Splitting it up is fine, of course. Having the catch-all as
> PATCH 05/11 is a bit odd, though. Its qemu-img.c hunk could go into
> PATCH 01, because qemu-img is part of the block subsystem. Not worth a
> respin as far as I'm concerned.
>
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
>
Thanks.
Regards,
-Gonglei
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH 03/11] pl330.c: remove superfluous '\n' around error_setg
2015-02-11 4:12 ` [Qemu-devel] [PATCH 03/11] pl330.c: " arei.gonglei
@ 2015-02-16 9:45 ` Michael Tokarev
2015-02-25 4:18 ` Gonglei
0 siblings, 1 reply; 16+ messages in thread
From: Michael Tokarev @ 2015-02-16 9:45 UTC (permalink / raw)
To: arei.gonglei, qemu-devel; +Cc: qemu-trivial, peter.huangpeng
11.02.2015 07:12, arei.gonglei@huawei.com wrote:
> From: Gonglei <arei.gonglei@huawei.com>
>
> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> ---
> hw/dma/pl330.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/dma/pl330.c b/hw/dma/pl330.c
> index 16cf77e..0f72b59 100644
> --- a/hw/dma/pl330.c
> +++ b/hw/dma/pl330.c
> @@ -1566,7 +1566,7 @@ static void pl330_realize(DeviceState *dev, Error **errp)
> s->cfg[1] |= 5;
> break;
> default:
> - error_setg(errp, "Bad value for i-cache_len property: %" PRIx8 "\n",
> + error_setg(errp, "Bad value for i-cache_len property: %" PRIx8 "",
Not hugely important but there's no need in the trailing "" here and below.
Thanks,
/mjt
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH 03/11] pl330.c: remove superfluous '\n' around error_setg
2015-02-16 9:45 ` Michael Tokarev
@ 2015-02-25 4:18 ` Gonglei
0 siblings, 0 replies; 16+ messages in thread
From: Gonglei @ 2015-02-25 4:18 UTC (permalink / raw)
To: Michael Tokarev, qemu-devel; +Cc: qemu-trivial, peter.huangpeng
On 2015/2/16 17:45, Michael Tokarev wrote:
> 11.02.2015 07:12, arei.gonglei@huawei.com wrote:
>> From: Gonglei <arei.gonglei@huawei.com>
>>
>> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
>> ---
>> hw/dma/pl330.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/hw/dma/pl330.c b/hw/dma/pl330.c
>> index 16cf77e..0f72b59 100644
>> --- a/hw/dma/pl330.c
>> +++ b/hw/dma/pl330.c
>> @@ -1566,7 +1566,7 @@ static void pl330_realize(DeviceState *dev, Error **errp)
>> s->cfg[1] |= 5;
>> break;
>> default:
>> - error_setg(errp, "Bad value for i-cache_len property: %" PRIx8 "\n",
>> + error_setg(errp, "Bad value for i-cache_len property: %" PRIx8 "",
>
> Not hugely important but there's no need in the trailing "" here and below.
>
Fixed, thanks.
Regards,
-Gonglei
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2015-02-25 4:20 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-11 4:12 [Qemu-devel] [PATCH 00/11] trivial: Remove superfluous '\n' around error_report/error_setg arei.gonglei
2015-02-11 4:12 ` [Qemu-devel] [PATCH 01/11] block: remove " arei.gonglei
2015-02-11 4:12 ` [Qemu-devel] [PATCH 02/11] a9gtimer: remove superfluous '\n' around error_setg arei.gonglei
2015-02-11 4:12 ` [Qemu-devel] [PATCH 03/11] pl330.c: " arei.gonglei
2015-02-16 9:45 ` Michael Tokarev
2015-02-25 4:18 ` Gonglei
2015-02-11 4:12 ` [Qemu-devel] [PATCH 04/11] numa: " arei.gonglei
2015-02-11 4:12 ` [Qemu-devel] [PATCH 05/11] Remove superfluous '\n' around error_report() arei.gonglei
2015-02-11 4:12 ` [Qemu-devel] [PATCH 06/11] vhost-scsi: " arei.gonglei
2015-02-11 4:12 ` [Qemu-devel] [PATCH 07/11] vfio: " arei.gonglei
2015-02-11 4:12 ` [Qemu-devel] [PATCH 08/11] xtensa: " arei.gonglei
2015-02-11 4:12 ` [Qemu-devel] [PATCH 09/11] tpm: " arei.gonglei
2015-02-11 4:12 ` [Qemu-devel] [PATCH 10/11] arm/digic_boards: " arei.gonglei
2015-02-11 4:12 ` [Qemu-devel] [PATCH 11/11] vhost: " arei.gonglei
2015-02-11 13:41 ` [Qemu-devel] [PATCH 00/11] trivial: Remove superfluous '\n' around error_report/error_setg Markus Armbruster
2015-02-12 1:10 ` Gonglei
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).