* [Qemu-devel] [PULL 01/52] s390x/virtio-ccw: fix spelling
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
@ 2016-06-05 7:42 ` Michael Tokarev
2016-06-05 7:42 ` [Qemu-devel] [PULL 02/52] hw/ipmi: " Michael Tokarev
` (51 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:42 UTC (permalink / raw)
To: qemu-devel; +Cc: Michael Tokarev, qemu-trivial
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
hw/s390x/virtio-ccw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index a1c1ed9..2b68e5e 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -1476,7 +1476,7 @@ static void virtio_ccw_device_plugged(DeviceState *d, Error **errp)
int n = virtio_get_num_queues(vdev);
if (virtio_get_num_queues(vdev) > VIRTIO_CCW_QUEUE_MAX) {
- error_setg(errp, "The nubmer of virtqueues %d "
+ error_setg(errp, "The number of virtqueues %d "
"exceeds ccw limit %d", n,
VIRTIO_CCW_QUEUE_MAX);
return;
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 02/52] hw/ipmi: fix spelling
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
2016-06-05 7:42 ` [Qemu-devel] [PULL 01/52] s390x/virtio-ccw: fix spelling Michael Tokarev
@ 2016-06-05 7:42 ` Michael Tokarev
2016-06-05 7:42 ` [Qemu-devel] [PULL 03/52] docs: "specify" spell fix Michael Tokarev
` (50 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:42 UTC (permalink / raw)
To: qemu-devel; +Cc: Michael Tokarev, qemu-trivial
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Acked-by: Corey Minyard <cminyard@mvista.com>
---
hw/ipmi/ipmi_bmc_extern.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/ipmi/ipmi_bmc_extern.c b/hw/ipmi/ipmi_bmc_extern.c
index fe12112..157879e 100644
--- a/hw/ipmi/ipmi_bmc_extern.c
+++ b/hw/ipmi/ipmi_bmc_extern.c
@@ -190,7 +190,7 @@ static void ipmi_bmc_extern_handle_command(IPMIBmc *b,
if (ibe->outlen) {
/* We already have a command queued. Shouldn't ever happen. */
fprintf(stderr, "IPMI KCS: Got command when not finished with the"
- " previous commmand\n");
+ " previous command\n");
abort();
}
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 03/52] docs: "specify" spell fix
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
2016-06-05 7:42 ` [Qemu-devel] [PULL 01/52] s390x/virtio-ccw: fix spelling Michael Tokarev
2016-06-05 7:42 ` [Qemu-devel] [PULL 02/52] hw/ipmi: " Michael Tokarev
@ 2016-06-05 7:42 ` Michael Tokarev
2016-06-05 7:42 ` [Qemu-devel] [PULL 04/52] qga: spelling fix Michael Tokarev
` (49 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:42 UTC (permalink / raw)
To: qemu-devel; +Cc: Michael Tokarev, qemu-trivial
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
docs/qapi-code-gen.txt | 2 +-
qemu-options.hx | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/qapi-code-gen.txt b/docs/qapi-code-gen.txt
index d7d6987..eff2075 100644
--- a/docs/qapi-code-gen.txt
+++ b/docs/qapi-code-gen.txt
@@ -322,7 +322,7 @@ enum. The value for each branch can be of any type.
A flat union definition avoids nesting on the wire, and specifies a
set of common members that occur in all variants of the union. The
-'base' key must specifiy either a type name (the type must be a
+'base' key must specify either a type name (the type must be a
struct, not a union), or a dictionary representing an anonymous type.
All branches of the union must be complex types, and the top-level
members of the union dictionary on the wire will be combination of
diff --git a/qemu-options.hx b/qemu-options.hx
index 9f33361..b780ed1 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -569,7 +569,7 @@ These options have the same definition as they have in @option{-hdachs}.
@var{discard} is one of "ignore" (or "off") or "unmap" (or "on") and controls whether @dfn{discard} (also known as @dfn{trim} or @dfn{unmap}) requests are ignored or passed to the filesystem. Some machine types may not support discard requests.
@item format=@var{format}
Specify which disk @var{format} will be used rather than detecting
-the format. Can be used to specifiy format=raw to avoid interpreting
+the format. Can be used to specify format=raw to avoid interpreting
an untrusted format header.
@item serial=@var{serial}
This option specifies the serial number to assign to the device.
@@ -894,7 +894,7 @@ mouse. Also overrides the PS/2 mouse emulation when activated.
@item disk:[format=@var{format}]:@var{file}
Mass storage device based on file. The optional @var{format} argument
-will be used rather than detecting the format. Can be used to specifiy
+will be used rather than detecting the format. Can be used to specify
@code{format=raw} to avoid interpreting an untrusted format header.
@item host:@var{bus}.@var{addr}
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 04/52] qga: spelling fix
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (2 preceding siblings ...)
2016-06-05 7:42 ` [Qemu-devel] [PULL 03/52] docs: "specify" spell fix Michael Tokarev
@ 2016-06-05 7:42 ` Michael Tokarev
2016-06-05 7:42 ` [Qemu-devel] [PULL 05/52] fsdev: " Michael Tokarev
` (48 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:42 UTC (permalink / raw)
To: qemu-devel; +Cc: Michael Tokarev, qemu-trivial
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
qga/commands-posix.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 2ae3725..f0057f5 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -1242,8 +1242,8 @@ int64_t qmp_guest_fsfreeze_freeze_list(bool has_mountpoints,
goto error;
}
- /* we try to cull filesytems we know won't work in advance, but other
- * filesytems may not implement fsfreeze for less obvious reasons.
+ /* we try to cull filesystems we know won't work in advance, but other
+ * filesystems may not implement fsfreeze for less obvious reasons.
* these will report EOPNOTSUPP. we simply ignore these when tallying
* the number of frozen filesystems.
*
@@ -1392,10 +1392,10 @@ qmp_guest_fstrim(bool has_minimum, int64_t minimum, Error **errp)
continue;
}
- /* We try to cull filesytems we know won't work in advance, but other
- * filesytems may not implement fstrim for less obvious reasons. These
- * will report EOPNOTSUPP; while in some other cases ENOTTY will be
- * reported (e.g. CD-ROMs).
+ /* We try to cull filesystems we know won't work in advance, but other
+ * filesystems may not implement fstrim for less obvious reasons.
+ * These will report EOPNOTSUPP; while in some other cases ENOTTY
+ * will be reported (e.g. CD-ROMs).
* Any other error means an unexpected error.
*/
r.start = 0;
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 05/52] fsdev: spelling fix
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (3 preceding siblings ...)
2016-06-05 7:42 ` [Qemu-devel] [PULL 04/52] qga: spelling fix Michael Tokarev
@ 2016-06-05 7:42 ` Michael Tokarev
2016-06-05 7:42 ` [Qemu-devel] [PULL 06/52] target-moxie: Remove unused struct elements Michael Tokarev
` (47 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:42 UTC (permalink / raw)
To: qemu-devel; +Cc: Michael Tokarev, qemu-trivial
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
fsdev/virtfs-proxy-helper.texi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fsdev/virtfs-proxy-helper.texi b/fsdev/virtfs-proxy-helper.texi
index 6eb2d50..f4cbb60 100644
--- a/fsdev/virtfs-proxy-helper.texi
+++ b/fsdev/virtfs-proxy-helper.texi
@@ -15,7 +15,7 @@ provide access to files beyond 9p export path.
2) Running QEMU with root privilege could be a security issue.
-To overcome above issues, following approach is used: A new filesytem
+To overcome above issues, following approach is used: A new filesystem
type 'proxy' is introduced. Proxy FS uses chroot + socket combination
for securing the vulnerability known with following symbolic links.
Intention of adding a new filesystem type is to allow qemu to run
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 06/52] target-moxie: Remove unused struct elements
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (4 preceding siblings ...)
2016-06-05 7:42 ` [Qemu-devel] [PULL 05/52] fsdev: " Michael Tokarev
@ 2016-06-05 7:42 ` Michael Tokarev
2016-06-05 7:42 ` [Qemu-devel] [PULL 07/52] po/Makefile: call rm -f directly Michael Tokarev
` (46 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:42 UTC (permalink / raw)
To: qemu-devel; +Cc: Stefan Weil, qemu-trivial, Michael Tokarev
From: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
target-moxie/mmu.h | 5 -----
1 file changed, 5 deletions(-)
diff --git a/target-moxie/mmu.h b/target-moxie/mmu.h
index abc7929..284a44d 100644
--- a/target-moxie/mmu.h
+++ b/target-moxie/mmu.h
@@ -6,11 +6,6 @@
typedef struct {
uint32_t phy;
uint32_t pfn;
- unsigned g:1;
- unsigned v:1;
- unsigned k:1;
- unsigned w:1;
- unsigned e:1;
int cause_op;
} MoxieMMUResult;
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 07/52] po/Makefile: call rm -f directly
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (5 preceding siblings ...)
2016-06-05 7:42 ` [Qemu-devel] [PULL 06/52] target-moxie: Remove unused struct elements Michael Tokarev
@ 2016-06-05 7:42 ` Michael Tokarev
2016-06-05 7:42 ` [Qemu-devel] [PULL 08/52] gdbstub: set listen backlog to 1 Michael Tokarev
` (45 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:42 UTC (permalink / raw)
To: qemu-devel; +Cc: Jan Vesely, qemu-trivial, Michael Tokarev
From: Jan Vesely <jano.vesely@gmail.com>
Default variables are undefined in rules.mak and this is what the rest
of the build system uses.
Fixes make clean in ./po/
Signed-off-by: Jan Vesely <jano.vesely@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
po/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/po/Makefile b/po/Makefile
index b271f79..7bab09d 100644
--- a/po/Makefile
+++ b/po/Makefile
@@ -32,7 +32,7 @@ update: $(SRCS)
build: $(OBJS)
clean:
- $(RM) $(OBJS)
+ rm -f $(OBJS)
install: $(OBJS)
for obj in $(OBJS); do \
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 08/52] gdbstub: set listen backlog to 1
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (6 preceding siblings ...)
2016-06-05 7:42 ` [Qemu-devel] [PULL 07/52] po/Makefile: call rm -f directly Michael Tokarev
@ 2016-06-05 7:42 ` Michael Tokarev
2016-06-05 7:42 ` [Qemu-devel] [PULL 09/52] scripts: add muldiv64() checking coccinelle scripts Michael Tokarev
` (44 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:42 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Wu, qemu-trivial, Michael Tokarev
From: Peter Wu <peter@lekensteyn.nl>
Avoid possible connection drops on Linux (when tcp_syncookies is
disabled) or fallbacks to SYN cookies with the following kernel warning:
TCP: request_sock_TCP: Possible SYN flooding on port 1234. Sending cookies. Check SNMP counters.
Since Linux 4.4 (ef547f2ac16b "tcp: remove max_qlen_log"), a backlog of
zero is really treated as the "queue length for completely established
sockets waiting to be accepted" (listen(2)). This is apparently a valid
interpretation of an "implementation-defined minimum value" for a
backlog value of 0 (listen(3p)). Previous kernels would use 8 as
minimum value, but that is no longer the case.
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
gdbstub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdbstub.c b/gdbstub.c
index b9e3710..ffcad0e 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1629,7 +1629,7 @@ static int gdbserver_open(int port)
close(fd);
return -1;
}
- ret = listen(fd, 0);
+ ret = listen(fd, 1);
if (ret < 0) {
perror("listen");
close(fd);
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 09/52] scripts: add muldiv64() checking coccinelle scripts
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (7 preceding siblings ...)
2016-06-05 7:42 ` [Qemu-devel] [PULL 08/52] gdbstub: set listen backlog to 1 Michael Tokarev
@ 2016-06-05 7:42 ` Michael Tokarev
2016-06-05 7:42 ` [Qemu-devel] [PULL 10/52] The only 64bit parameter of muldiv64() is the first one Michael Tokarev
` (43 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:42 UTC (permalink / raw)
To: qemu-devel; +Cc: Laurent Vivier, qemu-trivial, Michael Tokarev
From: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
scripts/coccinelle/overflow_muldiv64.cocci | 16 ++++++++++++++++
scripts/coccinelle/remove_muldiv64.cocci | 6 ++++++
scripts/coccinelle/simplify_muldiv64.cocci | 11 +++++++++++
scripts/coccinelle/swap_muldiv64.cocci | 13 +++++++++++++
4 files changed, 46 insertions(+)
create mode 100644 scripts/coccinelle/overflow_muldiv64.cocci
create mode 100644 scripts/coccinelle/remove_muldiv64.cocci
create mode 100644 scripts/coccinelle/simplify_muldiv64.cocci
create mode 100644 scripts/coccinelle/swap_muldiv64.cocci
diff --git a/scripts/coccinelle/overflow_muldiv64.cocci b/scripts/coccinelle/overflow_muldiv64.cocci
new file mode 100644
index 0000000..08ec4a8
--- /dev/null
+++ b/scripts/coccinelle/overflow_muldiv64.cocci
@@ -0,0 +1,16 @@
+// Find muldiv64(i64, i64, x) for potential overflow
+@filter@
+typedef uint64_t;
+typedef int64_t;
+{ uint64_t, int64_t, long, unsigned long } a, b;
+expression c;
+position p;
+@@
+
+muldiv64(a,b,c)@p
+
+@script:python@
+p << filter.p;
+@@
+
+cocci.print_main("potential muldiv64() overflow", p)
diff --git a/scripts/coccinelle/remove_muldiv64.cocci b/scripts/coccinelle/remove_muldiv64.cocci
new file mode 100644
index 0000000..4c10bd5
--- /dev/null
+++ b/scripts/coccinelle/remove_muldiv64.cocci
@@ -0,0 +1,6 @@
+// replace muldiv64(a, 1, b) by "a / b"
+@@
+expression a, b;
+@@
+-muldiv64(a, 1, b)
++a / b
diff --git a/scripts/coccinelle/simplify_muldiv64.cocci b/scripts/coccinelle/simplify_muldiv64.cocci
new file mode 100644
index 0000000..3d7c974
--- /dev/null
+++ b/scripts/coccinelle/simplify_muldiv64.cocci
@@ -0,0 +1,11 @@
+// replace muldiv64(i32, i32, x) by (uint64_t)i32 * i32 / x
+@@
+typedef uint32_t;
+typedef int32_t;
+{ uint32_t, int32_t, int, unsigned int } a, b;
+typedef uint64_t;
+expression c;
+@@
+
+-muldiv64(a,b,c)
++(uint64_t) a * b / c
diff --git a/scripts/coccinelle/swap_muldiv64.cocci b/scripts/coccinelle/swap_muldiv64.cocci
new file mode 100644
index 0000000..b48b0d0
--- /dev/null
+++ b/scripts/coccinelle/swap_muldiv64.cocci
@@ -0,0 +1,13 @@
+// replace muldiv64(i32, i64, x) by muldiv64(i64, i32, x)
+@@
+typedef uint64_t;
+typedef int64_t;
+typedef uint32_t;
+typedef int32_t;
+{ uint32_t, int32_t, int, unsigned int } a;
+{ uint64_t, int64_t, long, unsigned long } b;
+expression c;
+@@
+
+-muldiv64(a,b,c)
++muldiv64(b,a,c)
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 10/52] The only 64bit parameter of muldiv64() is the first one.
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (8 preceding siblings ...)
2016-06-05 7:42 ` [Qemu-devel] [PULL 09/52] scripts: add muldiv64() checking coccinelle scripts Michael Tokarev
@ 2016-06-05 7:42 ` Michael Tokarev
2016-06-05 7:42 ` [Qemu-devel] [PULL 11/52] remove useless muldiv64() Michael Tokarev
` (42 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:42 UTC (permalink / raw)
To: qemu-devel; +Cc: Laurent Vivier, qemu-trivial, Michael Tokarev
From: Laurent Vivier <lvivier@redhat.com>
muldiv64() is "uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c)"
Some time it is used as muldiv64(uint32_t a, uint64_t b, uint32_t c)"
This patch is the result of coccinelle script
scripts/coccinelle/swap_muldiv64.cocci to reorder arguments.
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/timer/omap_gptimer.c | 4 ++--
hw/usb/hcd-ohci.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/timer/omap_gptimer.c b/hw/timer/omap_gptimer.c
index 3a43863..5e3e8a6 100644
--- a/hw/timer/omap_gptimer.c
+++ b/hw/timer/omap_gptimer.c
@@ -133,8 +133,8 @@ static inline void omap_gp_timer_update(struct omap_gp_timer_s *timer)
timer_mod(timer->timer, timer->time + expires);
if (timer->ce && timer->match_val >= timer->val) {
- matches = muldiv64(timer->match_val - timer->val,
- timer->ticks_per_sec, timer->rate);
+ matches = muldiv64(timer->ticks_per_sec,
+ timer->match_val - timer->val, timer->rate);
timer_mod(timer->match, timer->time + matches);
} else
timer_del(timer->match);
diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
index 16d9ff7..25cc53f 100644
--- a/hw/usb/hcd-ohci.c
+++ b/hw/usb/hcd-ohci.c
@@ -1474,7 +1474,7 @@ static uint32_t ohci_get_frame_remaining(OHCIState *ohci)
if (tks >= usb_frame_time)
return (ohci->frt << 31);
- tks = muldiv64(1, tks, usb_bit_time);
+ tks = muldiv64(tks, 1, usb_bit_time);
fr = (uint16_t)(ohci->fi - tks);
return (ohci->frt << 31) | fr;
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 11/52] remove useless muldiv64()
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (9 preceding siblings ...)
2016-06-05 7:42 ` [Qemu-devel] [PULL 10/52] The only 64bit parameter of muldiv64() is the first one Michael Tokarev
@ 2016-06-05 7:42 ` Michael Tokarev
2016-06-05 7:42 ` [Qemu-devel] [PULL 12/52] replace muldiv64(a, b, c) by (uint64_t)a * b / c Michael Tokarev
` (41 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:42 UTC (permalink / raw)
To: qemu-devel; +Cc: Laurent Vivier, qemu-trivial, Michael Tokarev
From: Laurent Vivier <lvivier@redhat.com>
muldiv64(a, 1, b) is like "a / b".
This patch is the result of coccinelle script
scripts/coccinelle/remove_muldiv64.cocci.
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/usb/hcd-ohci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
index 25cc53f..fa57038 100644
--- a/hw/usb/hcd-ohci.c
+++ b/hw/usb/hcd-ohci.c
@@ -1474,7 +1474,7 @@ static uint32_t ohci_get_frame_remaining(OHCIState *ohci)
if (tks >= usb_frame_time)
return (ohci->frt << 31);
- tks = muldiv64(tks, 1, usb_bit_time);
+ tks = tks / usb_bit_time;
fr = (uint16_t)(ohci->fi - tks);
return (ohci->frt << 31) | fr;
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 12/52] replace muldiv64(a, b, c) by (uint64_t)a * b / c
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (10 preceding siblings ...)
2016-06-05 7:42 ` [Qemu-devel] [PULL 11/52] remove useless muldiv64() Michael Tokarev
@ 2016-06-05 7:42 ` Michael Tokarev
2016-06-05 7:42 ` [Qemu-devel] [PULL 13/52] ppc: Remove a potential overflow in muldiv64() Michael Tokarev
` (40 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:42 UTC (permalink / raw)
To: qemu-devel; +Cc: Laurent Vivier, qemu-trivial, Michael Tokarev
From: Laurent Vivier <lvivier@redhat.com>
When "a" and "b" are 32bit values, we don't have to cast
them to 128bit, 64bit is enough.
This patch is the result of coccinelle script
scripts/coccinelle/simplify_muldiv64.cocci
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
For xtensa PIC:
Acked-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/audio/gus.c | 2 +-
hw/xtensa/pic_cpu.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/audio/gus.c b/hw/audio/gus.c
index 9dd6947..6c02646 100644
--- a/hw/audio/gus.c
+++ b/hw/audio/gus.c
@@ -144,7 +144,7 @@ static void GUS_callback (void *opaque, int free)
s->left = samples;
reset:
- gus_irqgen (&s->emu, muldiv64 (net, 1000000, s->freq));
+ gus_irqgen (&s->emu, (uint64_t)net * 1000000 / s->freq);
}
int GUS_irqrequest (GUSEmuState *emu, int hwirq, int n)
diff --git a/hw/xtensa/pic_cpu.c b/hw/xtensa/pic_cpu.c
index ccf65fd..2bed64f 100644
--- a/hw/xtensa/pic_cpu.c
+++ b/hw/xtensa/pic_cpu.c
@@ -122,8 +122,8 @@ void xtensa_rearm_ccompare_timer(CPUXtensaState *env)
}
env->wake_ccount = wake_ccount;
timer_mod(env->ccompare_timer, env->halt_clock +
- muldiv64(wake_ccount - env->sregs[CCOUNT],
- 1000000, env->config->clock_freq_khz));
+ (uint64_t)(wake_ccount - env->sregs[CCOUNT]) *
+ 1000000 / env->config->clock_freq_khz);
}
static void xtensa_ccompare_cb(void *opaque)
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 13/52] ppc: Remove a potential overflow in muldiv64()
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (11 preceding siblings ...)
2016-06-05 7:42 ` [Qemu-devel] [PULL 12/52] replace muldiv64(a, b, c) by (uint64_t)a * b / c Michael Tokarev
@ 2016-06-05 7:42 ` Michael Tokarev
2016-06-05 7:42 ` [Qemu-devel] [PULL 14/52] Fix linking relocatable objects on Sparc Michael Tokarev
` (39 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:42 UTC (permalink / raw)
To: qemu-devel; +Cc: Laurent Vivier, qemu-trivial, Michael Tokarev
From: Laurent Vivier <lvivier@redhat.com>
The coccinelle script:
scripts/coccinelle/overflow_muldiv64.cocci
gives us a list of potential overflows in muldiv64()
(the two first parameters are 64bit values).
This patch fixes one, as the fix seems obvious:
replace muldiv64(a, b, c) by muldiv64(b, a, c)
as "a" and "b" are 64bit values but a <= NANOSECONDS_PER_SECOND.
(10^9 -> 30bit value).
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/ppc/ppc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c
index cdf9f25..1bcf740 100644
--- a/hw/ppc/ppc.c
+++ b/hw/ppc/ppc.c
@@ -880,7 +880,7 @@ static int timebase_post_load(void *opaque, int version_id)
host_ns = qemu_clock_get_ns(QEMU_CLOCK_HOST);
ns_diff = MAX(0, host_ns - tb_remote->time_of_the_day_ns);
migration_duration_ns = MIN(NANOSECONDS_PER_SECOND, ns_diff);
- migration_duration_tb = muldiv64(migration_duration_ns, freq,
+ migration_duration_tb = muldiv64(freq, migration_duration_ns,
NANOSECONDS_PER_SECOND);
guest_tb = tb_remote->guest_timebase + MIN(0, migration_duration_tb);
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 14/52] Fix linking relocatable objects on Sparc
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (12 preceding siblings ...)
2016-06-05 7:42 ` [Qemu-devel] [PULL 13/52] ppc: Remove a potential overflow in muldiv64() Michael Tokarev
@ 2016-06-05 7:42 ` Michael Tokarev
2016-06-05 7:42 ` [Qemu-devel] [PULL 15/52] qemu-options.hx: Specify the units for -machine kvm_shadow_mem Michael Tokarev
` (38 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:42 UTC (permalink / raw)
To: qemu-devel; +Cc: James Clarke, qemu-trivial, Michael Tokarev
From: James Clarke <jrtc27@jrtc27.com>
On Sparc, gcc implicitly passes --relax to the linker, but -r is
incompatible with this. Therefore, if --no-relax is supported, it should
be passed to the linker.
Signed-off-by: James Clarke <jrtc27@jrtc27.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
configure | 13 +++++++++++++
rules.mak | 2 +-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index b5aab72..360b7a5 100755
--- a/configure
+++ b/configure
@@ -4526,6 +4526,18 @@ if compile_prog "" "" ; then
have_fsxattr=yes
fi
+#################################################
+# Sparc implicitly links with --relax, which is
+# incompatible with -r. It does no harm to give
+# it on other platforms too.
+
+cat > $TMPC << EOF
+int foo(void) { return 0; }
+EOF
+if compile_prog "" "-nostdlib -Wl,-r -Wl,--no-relax"; then
+ LD_REL_FLAGS="-Wl,--no-relax"
+fi
+
##########################################
# End of CC checks
# After here, no more $cc or $ld runs
@@ -5529,6 +5541,7 @@ else
fi
echo "LDFLAGS=$LDFLAGS" >> $config_host_mak
echo "LDFLAGS_NOPIE=$LDFLAGS_NOPIE" >> $config_host_mak
+echo "LD_REL_FLAGS=$LD_REL_FLAGS" >> $config_host_mak
echo "LIBS+=$LIBS" >> $config_host_mak
echo "LIBS_TOOLS+=$libs_tools" >> $config_host_mak
echo "EXESUF=$EXESUF" >> $config_host_mak
diff --git a/rules.mak b/rules.mak
index 4a8f464..dca5718 100644
--- a/rules.mak
+++ b/rules.mak
@@ -95,7 +95,7 @@ module-common.o: CFLAGS += $(DSO_OBJ_CFLAGS)
$(if $(findstring /,$@),$(call quiet-command,cp $@ $(subst /,-,$@), " CP $(subst /,-,$@)"))
-LD_REL := $(CC) -nostdlib -Wl,-r
+LD_REL := $(CC) -nostdlib -Wl,-r $(LD_REL_FLAGS)
%.mo:
$(call quiet-command,$(LD_REL) -o $@ $^," LD -r $(TARGET_DIR)$@")
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 15/52] qemu-options.hx: Specify the units for -machine kvm_shadow_mem
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (13 preceding siblings ...)
2016-06-05 7:42 ` [Qemu-devel] [PULL 14/52] Fix linking relocatable objects on Sparc Michael Tokarev
@ 2016-06-05 7:42 ` Michael Tokarev
2016-06-05 7:42 ` [Qemu-devel] [PULL 16/52] configure: Use $(..) instead of deprecated `..` Michael Tokarev
` (37 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:42 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, qemu-trivial, Michael Tokarev
From: Peter Maydell <peter.maydell@linaro.org>
The -machine kvm_shadow_mem option takes a size in bytes; say
so explicitly in its documentation.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reported-by: Tobi (github.com/tobimensch)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
qemu-options.hx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qemu-options.hx b/qemu-options.hx
index b780ed1..272630f 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -35,7 +35,7 @@ DEF("machine", HAS_ARG, QEMU_OPTION_machine, \
" kernel_irqchip=on|off controls accelerated irqchip support\n"
" kernel_irqchip=on|off|split controls accelerated irqchip support (default=off)\n"
" vmport=on|off|auto controls emulation of vmport (default: auto)\n"
- " kvm_shadow_mem=size of KVM shadow MMU\n"
+ " kvm_shadow_mem=size of KVM shadow MMU in bytes\n"
" dump-guest-core=on|off include guest memory in a core dump (default=on)\n"
" mem-merge=on|off controls memory merge support (default: on)\n"
" iommu=on|off controls emulated Intel IOMMU (VT-d) support (default=off)\n"
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 16/52] configure: Use $(..) instead of deprecated `..`
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (14 preceding siblings ...)
2016-06-05 7:42 ` [Qemu-devel] [PULL 15/52] qemu-options.hx: Specify the units for -machine kvm_shadow_mem Michael Tokarev
@ 2016-06-05 7:42 ` Michael Tokarev
2016-06-05 7:42 ` [Qemu-devel] [PULL 17/52] scripts: " Michael Tokarev
` (36 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:42 UTC (permalink / raw)
To: qemu-devel; +Cc: Stefan Weil, qemu-trivial, Michael Tokarev
From: Stefan Weil <sw@weilnetz.de>
This fixes these warnings from shellcheck:
^-- SC2006: Use $(..) instead of deprecated `..`
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
configure | 174 +++++++++++++++++++++++++++++++-------------------------------
1 file changed, 87 insertions(+), 87 deletions(-)
diff --git a/configure b/configure
index 360b7a5..f37909d 100755
--- a/configure
+++ b/configure
@@ -164,7 +164,7 @@ have_backend () {
}
# default parameters
-source_path=`dirname "$0"`
+source_path=$(dirname "$0")
cpu=""
iasl="iasl"
interp_prefix="/usr/gnemul/qemu-%M"
@@ -323,7 +323,7 @@ jemalloc="no"
# parse CC options first
for opt do
- optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
+ optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)')
case "$opt" in
--cross-prefix=*) cross_prefix="$optarg"
;;
@@ -398,7 +398,7 @@ if test "$debug_info" = "yes"; then
fi
# make source path absolute
-source_path=`cd "$source_path"; pwd`
+source_path=$(cd "$source_path"; pwd)
# running configure in the source tree?
# we know that's the case if configure is there.
@@ -443,7 +443,7 @@ elif check_define __sun__ ; then
elif check_define __HAIKU__ ; then
targetos='Haiku'
else
- targetos=`uname -s`
+ targetos=$(uname -s)
fi
# Some host OSes need non-standard checks for which CPU to use.
@@ -461,7 +461,7 @@ Darwin)
fi
;;
SunOS)
- # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
+ # $(uname -m) returns i86pc even on an x86_64 box, so default based on isainfo
if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
cpu="x86_64"
fi
@@ -507,7 +507,7 @@ elif check_define __aarch64__ ; then
elif check_define __hppa__ ; then
cpu="hppa"
else
- cpu=`uname -m`
+ cpu=$(uname -m)
fi
ARCH=
@@ -627,7 +627,7 @@ SunOS)
ld="gld"
smbd="${SMBD-/usr/sfw/sbin/smbd}"
needs_libsunmath="no"
- solarisrev=`uname -r | cut -f2 -d.`
+ solarisrev=$(uname -r | cut -f2 -d.)
if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
if test "$solarisrev" -le 9 ; then
if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then
@@ -722,7 +722,7 @@ fi
werror=""
for opt do
- optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
+ optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)')
case "$opt" in
--help|-h) show_help=yes
;;
@@ -846,9 +846,9 @@ for opt do
;;
--audio-drv-list=*) audio_drv_list="$optarg"
;;
- --block-drv-rw-whitelist=*|--block-drv-whitelist=*) block_drv_rw_whitelist=`echo "$optarg" | sed -e 's/,/ /g'`
+ --block-drv-rw-whitelist=*|--block-drv-whitelist=*) block_drv_rw_whitelist=$(echo "$optarg" | sed -e 's/,/ /g')
;;
- --block-drv-ro-whitelist=*) block_drv_ro_whitelist=`echo "$optarg" | sed -e 's/,/ /g'`
+ --block-drv-ro-whitelist=*) block_drv_ro_whitelist=$(echo "$optarg" | sed -e 's/,/ /g')
;;
--enable-debug-tcg) debug_tcg="yes"
;;
@@ -943,7 +943,7 @@ for opt do
;;
--enable-cocoa)
cocoa="yes" ;
- audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
+ audio_drv_list="coreaudio $(echo $audio_drv_list | sed s,coreaudio,,g)"
;;
--disable-system) softmmu="no"
;;
@@ -1388,7 +1388,7 @@ fi
# Consult white-list to determine whether to enable werror
# by default. Only enable by default for git builds
-z_version=`cut -f3 -d. $source_path/VERSION`
+z_version=$(cut -f3 -d. $source_path/VERSION)
if test -z "$werror" ; then
if test -d "$source_path/.git" -a \
@@ -1617,7 +1617,7 @@ if test "$solaris" = "yes" ; then
"install fileutils from www.blastwave.org using pkg-get -i fileutils" \
"to get ginstall which is used by default (which lives in /opt/csw/bin)"
fi
- if test "`path_of $install`" = "/usr/sbin/install" ; then
+ if test "$(path_of $install)" = "/usr/sbin/install" ; then
error_exit "Solaris /usr/sbin/install is not an appropriate install program." \
"try ginstall from the GNU fileutils available from www.blastwave.org" \
"using pkg-get -i fileutils, or use --install=/usr/ucb/install"
@@ -1636,7 +1636,7 @@ fi
if test -z "${target_list+xxx}" ; then
target_list="$default_target_list"
else
- target_list=`echo "$target_list" | sed -e 's/,/ /g'`
+ target_list=$(echo "$target_list" | sed -e 's/,/ /g')
fi
# Check that we recognised the target name; this allows a more
@@ -1886,8 +1886,8 @@ if test "$seccomp" != "no" ; then
if test "$libseccomp_minver" != "" &&
$pkg_config --atleast-version=$libseccomp_minver libseccomp ; then
- libs_softmmu="$libs_softmmu `$pkg_config --libs libseccomp`"
- QEMU_CFLAGS="$QEMU_CFLAGS `$pkg_config --cflags libseccomp`"
+ libs_softmmu="$libs_softmmu $($pkg_config --libs libseccomp)"
+ QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags libseccomp)"
seccomp="yes"
else
if test "$seccomp" = "yes" ; then
@@ -2127,8 +2127,8 @@ fi
x11_cflags=
x11_libs=-lX11
if $pkg_config --exists "x11"; then
- x11_cflags=`$pkg_config --cflags x11`
- x11_libs=`$pkg_config --libs x11`
+ x11_cflags=$($pkg_config --cflags x11)
+ x11_libs=$($pkg_config --libs x11)
fi
##########################################
@@ -2155,9 +2155,9 @@ if test "$gtk" != "no"; then
gtkversion="2.18.0"
fi
if $pkg_config --exists "$gtkpackage >= $gtkversion"; then
- gtk_cflags=`$pkg_config --cflags $gtkpackage`
- gtk_libs=`$pkg_config --libs $gtkpackage`
- gtk_version=`$pkg_config --modversion $gtkpackage`
+ gtk_cflags=$($pkg_config --cflags $gtkpackage)
+ gtk_libs=$($pkg_config --libs $gtkpackage)
+ gtk_version=$($pkg_config --modversion $gtkpackage)
if $pkg_config --exists "$gtkx11package >= $gtkversion"; then
gtk_cflags="$gtk_cflags $x11_cflags"
gtk_libs="$gtk_libs $x11_libs"
@@ -2195,8 +2195,8 @@ gnutls_gcrypt=no
gnutls_nettle=no
if test "$gnutls" != "no"; then
if gnutls_works; then
- gnutls_cflags=`$pkg_config --cflags gnutls`
- gnutls_libs=`$pkg_config --libs gnutls`
+ gnutls_cflags=$($pkg_config --cflags gnutls)
+ gnutls_libs=$($pkg_config --libs gnutls)
libs_softmmu="$gnutls_libs $libs_softmmu"
libs_tools="$gnutls_libs $libs_tools"
QEMU_CFLAGS="$QEMU_CFLAGS $gnutls_cflags"
@@ -2220,7 +2220,7 @@ if test "$gnutls" != "no"; then
gnutls_gcrypt=no
gnutls_nettle=yes
elif $pkg_config --exists 'gnutls >= 2.12'; then
- case `$pkg_config --libs --static gnutls` in
+ case $($pkg_config --libs --static gnutls) in
*gcrypt*)
gnutls_gcrypt=yes
gnutls_nettle=no
@@ -2281,7 +2281,7 @@ has_libgcrypt_config() {
if test -n "$cross_prefix"
then
- host=`libgcrypt-config --host`
+ host=$(libgcrypt-config --host)
if test "$host-" != $cross_prefix
then
return 1
@@ -2293,8 +2293,8 @@ has_libgcrypt_config() {
if test "$gcrypt" != "no"; then
if has_libgcrypt_config; then
- gcrypt_cflags=`libgcrypt-config --cflags`
- gcrypt_libs=`libgcrypt-config --libs`
+ gcrypt_cflags=$(libgcrypt-config --cflags)
+ gcrypt_libs=$(libgcrypt-config --libs)
# Debian has remove -lgpg-error from libgcrypt-config
# as it "spreads unnecessary dependencies" which in
# turn breaks static builds...
@@ -2334,9 +2334,9 @@ fi
if test "$nettle" != "no"; then
if $pkg_config --exists "nettle"; then
- nettle_cflags=`$pkg_config --cflags nettle`
- nettle_libs=`$pkg_config --libs nettle`
- nettle_version=`$pkg_config --modversion nettle`
+ nettle_cflags=$($pkg_config --cflags nettle)
+ nettle_libs=$($pkg_config --libs nettle)
+ nettle_version=$($pkg_config --modversion nettle)
libs_softmmu="$nettle_libs $libs_softmmu"
libs_tools="$nettle_libs $libs_tools"
QEMU_CFLAGS="$QEMU_CFLAGS $nettle_cflags"
@@ -2373,8 +2373,8 @@ tasn1=yes
tasn1_cflags=""
tasn1_libs=""
if $pkg_config --exists "libtasn1"; then
- tasn1_cflags=`$pkg_config --cflags libtasn1`
- tasn1_libs=`$pkg_config --libs libtasn1`
+ tasn1_cflags=$($pkg_config --cflags libtasn1)
+ tasn1_libs=$($pkg_config --libs libtasn1)
else
tasn1=no
fi
@@ -2404,9 +2404,9 @@ if test "$vte" != "no"; then
vteminversion="0.24.0"
fi
if $pkg_config --exists "$vtepackage >= $vteminversion"; then
- vte_cflags=`$pkg_config --cflags $vtepackage`
- vte_libs=`$pkg_config --libs $vtepackage`
- vteversion=`$pkg_config --modversion $vtepackage`
+ vte_cflags=$($pkg_config --cflags $vtepackage)
+ vte_libs=$($pkg_config --libs $vtepackage)
+ vteversion=$($pkg_config --modversion $vtepackage)
libs_softmmu="$vte_libs $libs_softmmu"
vte="yes"
elif test "$vte" = "yes"; then
@@ -2447,16 +2447,16 @@ else
error_exit "Unknown sdlabi $sdlabi, must be 1.2 or 2.0"
fi
-if test "`basename $sdl_config`" != $sdlconfigname && ! has ${sdl_config}; then
+if test "$(basename $sdl_config)" != $sdlconfigname && ! has ${sdl_config}; then
sdl_config=$sdlconfigname
fi
if $pkg_config $sdlname --exists; then
sdlconfig="$pkg_config $sdlname"
- sdlversion=`$sdlconfig --modversion 2>/dev/null`
+ sdlversion=$($sdlconfig --modversion 2>/dev/null)
elif has ${sdl_config}; then
sdlconfig="$sdl_config"
- sdlversion=`$sdlconfig --version`
+ sdlversion=$($sdlconfig --version)
else
if test "$sdl" = "yes" ; then
feature_not_found "sdl" "Install SDL devel"
@@ -2474,14 +2474,14 @@ if test "$sdl" != "no" ; then
#undef main /* We don't want SDL to override our main() */
int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
EOF
- sdl_cflags=`$sdlconfig --cflags 2> /dev/null`
+ sdl_cflags=$($sdlconfig --cflags 2>/dev/null)
if test "$static" = "yes" ; then
- sdl_libs=`$sdlconfig --static-libs 2>/dev/null`
+ sdl_libs=$($sdlconfig --static-libs 2>/dev/null)
else
- sdl_libs=`$sdlconfig --libs 2> /dev/null`
+ sdl_libs=$($sdlconfig --libs 2>/dev/null)
fi
if compile_prog "$sdl_cflags" "$sdl_libs" ; then
- if test `echo $sdlversion | sed 's/[^0-9]//g'` -lt 121 ; then
+ if test $(echo $sdlversion | sed 's/[^0-9]//g') -lt 121 ; then
sdl_too_old=yes
else
sdl=yes
@@ -2490,8 +2490,8 @@ EOF
# static link with sdl ? (note: sdl.pc's --static --libs is broken)
if test "$sdl" = "yes" -a "$static" = "yes" ; then
if test $? = 0 && echo $sdl_libs | grep -- -laa > /dev/null; then
- sdl_libs="$sdl_libs `aalib-config --static-libs 2>/dev/null`"
- sdl_cflags="$sdl_cflags `aalib-config --cflags 2>/dev/null`"
+ sdl_libs="$sdl_libs $(aalib-config --static-libs 2>/dev/null)"
+ sdl_cflags="$sdl_cflags $(aalib-config --cflags 2>/dev/null)"
fi
if compile_prog "$sdl_cflags" "$sdl_libs" ; then
:
@@ -2608,8 +2608,8 @@ int main(void) {
}
EOF
if $pkg_config libpng --exists; then
- vnc_png_cflags=`$pkg_config libpng --cflags`
- vnc_png_libs=`$pkg_config libpng --libs`
+ vnc_png_cflags=$($pkg_config libpng --cflags)
+ vnc_png_libs=$($pkg_config libpng --libs)
else
vnc_png_cflags=""
vnc_png_libs="-lpng"
@@ -2803,7 +2803,7 @@ EOF
fi
}
-audio_drv_list=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
+audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/,/ /g')
for drv in $audio_drv_list; do
case $drv in
alsa)
@@ -2915,8 +2915,8 @@ if test "$curl" != "no" ; then
#include <curl/curl.h>
int main(void) { curl_easy_init(); curl_multi_setopt(0, 0, 0); return 0; }
EOF
- curl_cflags=`$curlconfig --cflags 2>/dev/null`
- curl_libs=`$curlconfig --libs 2>/dev/null`
+ curl_cflags=$($curlconfig --cflags 2>/dev/null)
+ curl_libs=$($curlconfig --libs 2>/dev/null)
if compile_prog "$curl_cflags" "$curl_libs" ; then
curl=yes
else
@@ -2934,8 +2934,8 @@ if test "$bluez" != "no" ; then
#include <bluetooth/bluetooth.h>
int main(void) { return bt_error(0); }
EOF
- bluez_cflags=`$pkg_config --cflags bluez 2> /dev/null`
- bluez_libs=`$pkg_config --libs bluez 2> /dev/null`
+ bluez_cflags=$($pkg_config --cflags bluez 2>/dev/null)
+ bluez_libs=$($pkg_config --libs bluez 2>/dev/null)
if compile_prog "$bluez_cflags" "$bluez_libs" ; then
bluez=yes
libs_softmmu="$bluez_libs $libs_softmmu"
@@ -2958,8 +2958,8 @@ fi
for i in $glib_modules; do
if $pkg_config --atleast-version=$glib_req_ver $i; then
- glib_cflags=`$pkg_config --cflags $i`
- glib_libs=`$pkg_config --libs $i`
+ glib_cflags=$($pkg_config --cflags $i)
+ glib_libs=$($pkg_config --libs $i)
CFLAGS="$glib_cflags $CFLAGS"
LIBS="$glib_libs $LIBS"
libs_qga="$glib_libs $libs_qga"
@@ -3048,8 +3048,8 @@ if test "$pixman" = "none"; then
pixman_libs=
elif test "$pixman" = "system"; then
# pixman version has been checked above
- pixman_cflags=`$pkg_config --cflags pixman-1`
- pixman_libs=`$pkg_config --libs pixman-1`
+ pixman_cflags=$($pkg_config --cflags pixman-1)
+ pixman_libs=$($pkg_config --libs pixman-1)
else
if test ! -d ${source_path}/pixman/pixman; then
error_exit "pixman >= 0.21.8 not present. Your options:" \
@@ -3165,8 +3165,8 @@ fi
min_libssh2_version=1.2.8
if test "$libssh2" != "no" ; then
if $pkg_config --atleast-version=$min_libssh2_version libssh2; then
- libssh2_cflags=`$pkg_config libssh2 --cflags`
- libssh2_libs=`$pkg_config libssh2 --libs`
+ libssh2_cflags=$($pkg_config libssh2 --cflags)
+ libssh2_libs=$($pkg_config libssh2 --libs)
libssh2=yes
else
if test "$libssh2" = "yes" ; then
@@ -3417,8 +3417,8 @@ fi
if test "$glusterfs" != "no" ; then
if $pkg_config --atleast-version=3 glusterfs-api; then
glusterfs="yes"
- glusterfs_cflags=`$pkg_config --cflags glusterfs-api`
- glusterfs_libs=`$pkg_config --libs glusterfs-api`
+ glusterfs_cflags=$($pkg_config --cflags glusterfs-api)
+ glusterfs_libs=$($pkg_config --libs glusterfs-api)
if $pkg_config --atleast-version=4 glusterfs-api; then
glusterfs_xlator_opt="yes"
fi
@@ -4225,12 +4225,12 @@ int main(void) { return 0; }
EOF
if compile_prog "" "" ; then
if $pkg_config lttng-ust --exists; then
- lttng_ust_libs=`$pkg_config --libs lttng-ust`
+ lttng_ust_libs=$($pkg_config --libs lttng-ust)
else
lttng_ust_libs="-llttng-ust"
fi
if $pkg_config liburcu-bp --exists; then
- urcu_bp_libs=`$pkg_config --libs liburcu-bp`
+ urcu_bp_libs=$($pkg_config --libs liburcu-bp)
else
urcu_bp_libs="-lurcu-bp"
fi
@@ -4682,10 +4682,10 @@ if test "$guest_agent_msi" = "yes"; then
fi
if test "$QEMU_GA_VERSION" = ""; then
- QEMU_GA_VERSION=`cat $source_path/VERSION`
+ QEMU_GA_VERSION=$(cat $source_path/VERSION)
fi
- QEMU_GA_MSI_MINGW_DLL_PATH="-D Mingw_dlls=`$pkg_config --variable=prefix glib-2.0`/bin"
+ QEMU_GA_MSI_MINGW_DLL_PATH="-D Mingw_dlls=$($pkg_config --variable=prefix glib-2.0)/bin"
case "$cpu" in
x86_64)
@@ -4759,16 +4759,16 @@ QEMU_CFLAGS="$pixman_cflags $fdt_cflags $QEMU_CFLAGS"
libs_softmmu="$pixman_libs $libs_softmmu"
echo "Install prefix $prefix"
-echo "BIOS directory `eval echo $qemu_datadir`"
-echo "binary directory `eval echo $bindir`"
-echo "library directory `eval echo $libdir`"
-echo "module directory `eval echo $qemu_moddir`"
-echo "libexec directory `eval echo $libexecdir`"
-echo "include directory `eval echo $includedir`"
-echo "config directory `eval echo $sysconfdir`"
+echo "BIOS directory $(eval echo $qemu_datadir)"
+echo "binary directory $(eval echo $bindir)"
+echo "library directory $(eval echo $libdir)"
+echo "module directory $(eval echo $qemu_moddir)"
+echo "libexec directory $(eval echo $libexecdir)"
+echo "include directory $(eval echo $includedir)"
+echo "config directory $(eval echo $sysconfdir)"
if test "$mingw32" = "no" ; then
-echo "local state directory `eval echo $local_statedir`"
-echo "Manual directory `eval echo $mandir`"
+echo "local state directory $(eval echo $local_statedir)"
+echo "Manual directory $(eval echo $mandir)"
echo "ELF interp prefix $interp_prefix"
else
echo "local state directory queried at runtime"
@@ -4803,16 +4803,16 @@ if test "$darwin" = "yes" ; then
echo "Cocoa support $cocoa"
fi
echo "pixman $pixman"
-echo "SDL support $sdl `echo_version $sdl $sdlversion`"
-echo "GTK support $gtk `echo_version $gtk $gtk_version`"
+echo "SDL support $sdl $(echo_version $sdl $sdlversion)"
+echo "GTK support $gtk $(echo_version $gtk $gtk_version)"
echo "GTK GL support $gtk_gl"
-echo "VTE support $vte `echo_version $vte $vteversion`"
+echo "VTE support $vte $(echo_version $vte $vteversion)"
echo "GNUTLS support $gnutls"
echo "GNUTLS hash $gnutls_hash"
echo "GNUTLS rnd $gnutls_rnd"
echo "libgcrypt $gcrypt"
echo "libgcrypt kdf $gcrypt_kdf"
-echo "nettle $nettle `echo_version $nettle $nettle_version`"
+echo "nettle $nettle $(echo_version $nettle $nettle_version)"
echo "nettle kdf $nettle_kdf"
echo "libtasn1 $tasn1"
echo "curses support $curses"
@@ -4863,7 +4863,7 @@ echo "Trace backends $trace_backends"
if have_backend "simple"; then
echo "Trace output file $trace_file-<pid>"
fi
-echo "spice support $spice `echo_version $spice $spice_protocol_version/$spice_server_version`"
+echo "spice support $spice $(echo_version $spice $spice_protocol_version/$spice_server_version)"
echo "rbd support $rbd"
echo "xfsctl support $xfs"
echo "smartcard support $smartcard"
@@ -4942,7 +4942,7 @@ if test "$bigendian" = "yes" ; then
fi
if test "$mingw32" = "yes" ; then
echo "CONFIG_WIN32=y" >> $config_host_mak
- rc_version=`cat $source_path/VERSION`
+ rc_version=$(cat $source_path/VERSION)
version_major=${rc_version%%.*}
rc_version=${rc_version#*.}
version_minor=${rc_version%%.*}
@@ -5018,7 +5018,7 @@ if test "$cap_ng" = "yes" ; then
fi
echo "CONFIG_AUDIO_DRIVERS=$audio_drv_list" >> $config_host_mak
for drv in $audio_drv_list; do
- def=CONFIG_`echo $drv | LC_ALL=C tr '[a-z]' '[A-Z]'`
+ def=CONFIG_$(echo $drv | LC_ALL=C tr '[a-z]' '[A-Z]')
echo "$def=y" >> $config_host_mak
done
if test "$audio_pt_int" = "yes" ; then
@@ -5050,7 +5050,7 @@ fi
if test "$xfs" = "yes" ; then
echo "CONFIG_XFS=y" >> $config_host_mak
fi
-qemu_version=`head $source_path/VERSION`
+qemu_version=$(head $source_path/VERSION)
echo "VERSION=$qemu_version" >>$config_host_mak
echo "PKGVERSION=$pkgversion" >>$config_host_mak
echo "SRC_PATH=$source_path" >> $config_host_mak
@@ -5061,7 +5061,7 @@ fi
if test "$modules" = "yes"; then
# $shacmd can generate a hash started with digit, which the compiler doesn't
# like as an symbol. So prefix it with an underscore
- echo "CONFIG_STAMP=_`(echo $qemu_version; echo $pkgversion; cat $0) | $shacmd - | cut -f1 -d\ `" >> $config_host_mak
+ echo "CONFIG_STAMP=_$( (echo $qemu_version; echo $pkgversion; cat $0) | $shacmd - | cut -f1 -d\ )" >> $config_host_mak
echo "CONFIG_MODULES=y" >> $config_host_mak
fi
if test "$sdl" = "yes" ; then
@@ -5590,7 +5590,7 @@ fi
for target in $target_list; do
target_dir="$target"
config_target_mak=$target_dir/config-target.mak
-target_name=`echo $target | cut -d '-' -f 1`
+target_name=$(echo $target | cut -d '-' -f 1)
target_bigendian="no"
case "$target_name" in
@@ -5630,7 +5630,7 @@ mkdir -p $target_dir
echo "# Automatically generated by configure - do not modify" > $config_target_mak
bflt="no"
-interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_name/g"`
+interp_prefix1=$(echo "$interp_prefix" | sed "s/%M/$target_name/g")
gdb_xml_files=""
TARGET_ARCH="$target_name"
@@ -5756,7 +5756,7 @@ upper() {
echo "$@"| LC_ALL=C tr '[a-z]' '[A-Z]'
}
-target_arch_name="`upper $TARGET_ARCH`"
+target_arch_name="$(upper $TARGET_ARCH)"
echo "TARGET_$target_arch_name=y" >> $config_target_mak
echo "TARGET_NAME=$target_name" >> $config_target_mak
echo "TARGET_BASE_ARCH=$TARGET_BASE_ARCH" >> $config_target_mak
@@ -5972,11 +5972,11 @@ for bios_file in \
$source_path/pc-bios/u-boot.* \
$source_path/pc-bios/palcode-*
do
- FILES="$FILES pc-bios/`basename $bios_file`"
+ FILES="$FILES pc-bios/$(basename $bios_file)"
done
-for test_file in `find $source_path/tests/acpi-test-data -type f`
+for test_file in $(find $source_path/tests/acpi-test-data -type f)
do
- FILES="$FILES tests/acpi-test-data`echo $test_file | sed -e 's/.*acpi-test-data//'`"
+ FILES="$FILES tests/acpi-test-data$(echo $test_file | sed -e 's/.*acpi-test-data//')"
done
mkdir -p $DIRS
for f in $FILES ; do
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 17/52] scripts: Use $(..) instead of deprecated `..`
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (15 preceding siblings ...)
2016-06-05 7:42 ` [Qemu-devel] [PULL 16/52] configure: Use $(..) instead of deprecated `..` Michael Tokarev
@ 2016-06-05 7:42 ` Michael Tokarev
2016-06-05 7:42 ` [Qemu-devel] [PULL 18/52] ICH9: fix typo Michael Tokarev
` (35 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:42 UTC (permalink / raw)
To: qemu-devel; +Cc: Stefan Weil, qemu-trivial, Michael Tokarev
From: Stefan Weil <sw@weilnetz.de>
This fixes these warnings from shellcheck:
^-- SC2006: Use $(..) instead of deprecated `..`
Update also a comment using the same pattern.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
scripts/clean-includes | 2 +-
scripts/create_config | 6 +++---
scripts/feature_to_c.sh | 6 +++---
scripts/make_device_config.sh | 4 ++--
scripts/qemu-binfmt-conf.sh | 2 +-
| 2 +-
6 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/scripts/clean-includes b/scripts/clean-includes
index 72b47f1..adffedd 100755
--- a/scripts/clean-includes
+++ b/scripts/clean-includes
@@ -39,7 +39,7 @@
# However some caution is required regarding files that might be part
# of the guest agent or standalone tests.
-# for i in `git ls-tree --name-only HEAD` ; do test -f $i && \
+# for i in $(git ls-tree --name-only HEAD) ; do test -f $i && \
# grep -E '^# *include' $i | head -1 | grep 'osdep.h' ; test $? != 0 && \
# echo $i ; done
diff --git a/scripts/create_config b/scripts/create_config
index b2d2ebb..b31ca9b 100755
--- a/scripts/create_config
+++ b/scripts/create_config
@@ -16,7 +16,7 @@ case $line in
qemu_*dir=*) # qemu-specific directory configuration
name=${line%=*}
value=${line#*=}
- define_name=`echo $name | LC_ALL=C tr '[a-z]' '[A-Z]'`
+ define_name=$(echo $name | LC_ALL=C tr '[a-z]' '[A-Z]')
eval "define_value=\"$value\""
echo "#define CONFIG_$define_name \"$define_value\""
# save for the next definitions
@@ -72,7 +72,7 @@ case $line in
;;
ARCH=*) # configuration
arch=${line#*=}
- arch_name=`echo $arch | LC_ALL=C tr '[a-z]' '[A-Z]'`
+ arch_name=$(echo $arch | LC_ALL=C tr '[a-z]' '[A-Z]')
echo "#define HOST_$arch_name 1"
;;
HOST_USB=*)
@@ -92,7 +92,7 @@ case $line in
;;
TARGET_BASE_ARCH=*) # configuration
target_base_arch=${line#*=}
- base_arch_name=`echo $target_base_arch | LC_ALL=C tr '[a-z]' '[A-Z]'`
+ base_arch_name=$(echo $target_base_arch | LC_ALL=C tr '[a-z]' '[A-Z]')
echo "#define TARGET_$base_arch_name 1"
;;
TARGET_XML_FILES=*)
diff --git a/scripts/feature_to_c.sh b/scripts/feature_to_c.sh
index e4387b7..c8ce9b8 100644
--- a/scripts/feature_to_c.sh
+++ b/scripts/feature_to_c.sh
@@ -33,7 +33,7 @@ if test -e "$output"; then
fi
for input; do
- arrayname=xml_feature_`echo $input | sed 's,.*/,,; s/[-.]/_/g'`
+ arrayname=xml_feature_$(echo $input | sed 's,.*/,,; s/[-.]/_/g')
${AWK:-awk} 'BEGIN { n = 0
printf "#include \"qemu/osdep.h\"\n"
@@ -67,8 +67,8 @@ echo >> $output
echo "const char *const xml_builtin[][2] = {" >> $output
for input; do
- basename=`echo $input | sed 's,.*/,,'`
- arrayname=xml_feature_`echo $input | sed 's,.*/,,; s/[-.]/_/g'`
+ basename=$(echo $input | sed 's,.*/,,')
+ arrayname=xml_feature_$(echo $input | sed 's,.*/,,; s/[-.]/_/g')
echo " { \"$basename\", $arrayname }," >> $output
done
diff --git a/scripts/make_device_config.sh b/scripts/make_device_config.sh
index c1afb3f..354af31 100644
--- a/scripts/make_device_config.sh
+++ b/scripts/make_device_config.sh
@@ -7,7 +7,7 @@
src=$1
dep=$2
target=$3
-src_dir=`dirname $src`
+src_dir=$(dirname $src)
all_includes=
process_includes () {
@@ -20,7 +20,7 @@ process_includes () {
f=$src
while [ -n "$f" ] ; do
- f=`cat $f | tr -d '\r' | awk '/^include / {printf "'$src_dir'/%s ", $2}'`
+ f=$(cat $f | tr -d '\r' | awk '/^include / {printf "'$src_dir'/%s ", $2}')
[ $? = 0 ] || exit 1
all_includes="$all_includes $f"
done
diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh
index 289b1a3..f5bba70 100644
--- a/scripts/qemu-binfmt-conf.sh
+++ b/scripts/qemu-binfmt-conf.sh
@@ -10,7 +10,7 @@ if [ ! -f /proc/sys/fs/binfmt_misc/register ]; then
fi
# probe cpu type
-cpu=`uname -m`
+cpu=$(uname -m)
case "$cpu" in
i386|i486|i586|i686|i86pc|BePC|x86_64)
cpu="i386"
--git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh
index f7d62d9..08c4c4a 100755
--- a/scripts/update-linux-headers.sh
+++ b/scripts/update-linux-headers.sh
@@ -10,7 +10,7 @@
# This work is licensed under the terms of the GNU GPL version 2.
# See the COPYING file in the top-level directory.
-tmpdir=`mktemp -d`
+tmpdir=$(mktemp -d)
linux="$1"
output="$2"
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 18/52] ICH9: fix typo
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (16 preceding siblings ...)
2016-06-05 7:42 ` [Qemu-devel] [PULL 17/52] scripts: " Michael Tokarev
@ 2016-06-05 7:42 ` Michael Tokarev
2016-06-05 7:42 ` [Qemu-devel] [PULL 19/52] monitor: Typo fix Michael Tokarev
` (34 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:42 UTC (permalink / raw)
To: qemu-devel; +Cc: Cao jin, qemu-trivial, Michael Tokarev
From: Cao jin <caoj.fnst@cn.fujitsu.com>
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/isa/lpc_ich9.c | 4 ++--
include/hw/i386/ich9.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
index 4f8ca45..1d27ea3 100644
--- a/hw/isa/lpc_ich9.c
+++ b/hw/isa/lpc_ich9.c
@@ -97,8 +97,8 @@ static void ich9_cc_update(ICH9LPCState *lpc)
/*
* D30: DMI2PCI bridge
- * It is arbitrarily decided how INTx lines of PCI devicesbehind the bridge
- * are connected to pirq lines. Our choice is PIRQ[E-H].
+ * It is arbitrarily decided how INTx lines of PCI devices behind
+ * the bridge are connected to pirq lines. Our choice is PIRQ[E-H].
* INT[A-D] are connected to PIRQ[E-H]
*/
for (pci_intx = 0; pci_intx < PCI_NUM_PINS; pci_intx++) {
diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h
index d04dcdc..88233c3 100644
--- a/include/hw/i386/ich9.h
+++ b/include/hw/i386/ich9.h
@@ -35,7 +35,7 @@ typedef struct ICH9LPCState {
/* (pci device, intx) -> pirq
* In real chipset case, the unused slots are never used
- * as ICH9 supports only D25-D32 irq routing.
+ * as ICH9 supports only D25-D31 irq routing.
* On the other hand in qemu case, any slot/function can be populated
* via command line option.
* So fallback interrupt routing for any devices in any slots is necessary.
@@ -181,7 +181,7 @@ Object *ich9_lpc_find(void);
#define ICH9_SATA1_DEV 31
#define ICH9_SATA1_FUNC 2
-/* D30:F1 power management I/O registers
+/* D31:F0 power management I/O registers
offset from the address ICH9_LPC_PMBASE */
/* ICH9 LPC PM I/O registers are 128 ports and 128-aligned */
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 19/52] monitor: Typo fix
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (17 preceding siblings ...)
2016-06-05 7:42 ` [Qemu-devel] [PULL 18/52] ICH9: fix typo Michael Tokarev
@ 2016-06-05 7:42 ` Michael Tokarev
2016-06-05 7:42 ` [Qemu-devel] [PULL 20/52] qdev: Clean up around properties Michael Tokarev
` (33 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:42 UTC (permalink / raw)
To: qemu-devel; +Cc: Eric Blake, qemu-trivial, Michael Tokarev
From: Eric Blake <eblake@redhat.com>
s/partinal/partial/
Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
monitor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/monitor.c b/monitor.c
index 404d594..a27e115 100644
--- a/monitor.c
+++ b/monitor.c
@@ -320,7 +320,7 @@ static void monitor_flush_locked(Monitor *mon)
return;
}
if (rc > 0) {
- /* partinal write */
+ /* partial write */
QString *tmp = qstring_from_str(buf + rc);
QDECREF(mon->outbuf);
mon->outbuf = tmp;
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 20/52] qdev: Clean up around properties
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (18 preceding siblings ...)
2016-06-05 7:42 ` [Qemu-devel] [PULL 19/52] monitor: Typo fix Michael Tokarev
@ 2016-06-05 7:42 ` Michael Tokarev
2016-06-05 7:42 ` [Qemu-devel] [PULL 21/52] fw_cfg: follow CODING_STYLE Michael Tokarev
` (32 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:42 UTC (permalink / raw)
To: qemu-devel; +Cc: Cao jin, qemu-trivial, Michael Tokarev
From: Cao jin <caoj.fnst@cn.fujitsu.com>
include:
1. remove unnecessary declaration of static function
2. fix inconsistency between comment and function name, and typo OOM->QOM
2. update comments of functions, use uniform format(GTK-Doc style)
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/core/qdev.c | 30 +++++++++++++++++++-----------
include/hw/qdev-properties.h | 10 ++++++++--
2 files changed, 27 insertions(+), 13 deletions(-)
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 853162b..0a05a52 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -58,9 +58,6 @@ const char *qdev_fw_name(DeviceState *dev)
return object_get_typename(OBJECT(dev));
}
-static void qdev_property_add_legacy(DeviceState *dev, Property *prop,
- Error **errp);
-
static void bus_remove_child(BusState *bus, DeviceState *child)
{
BusChild *kid;
@@ -733,13 +730,20 @@ static void qdev_get_legacy_property(Object *obj, Visitor *v,
}
/**
- * @qdev_add_legacy_property - adds a legacy property
+ * qdev_property_add_legacy:
+ * @dev: Device to add the property to.
+ * @prop: The qdev property definition.
+ * @errp: location to store error information.
+ *
+ * Add a legacy QOM property to @dev for qdev property @prop.
+ * On error, store error in @errp.
*
- * Do not use this is new code! Properties added through this interface will
- * be given names and types in the "legacy" namespace.
+ * Legacy properties are string versions of QOM properties. The format of
+ * the string depends on the property type. Legacy properties are only
+ * needed for "info qtree".
*
- * Legacy properties are string versions of other OOM properties. The format
- * of the string depends on the property type.
+ * Do not use this is new code! QOM Properties added through this interface
+ * will be given names in the "legacy" namespace.
*/
static void qdev_property_add_legacy(DeviceState *dev, Property *prop,
Error **errp)
@@ -762,10 +766,14 @@ static void qdev_property_add_legacy(DeviceState *dev, Property *prop,
}
/**
- * @qdev_property_add_static - add a @Property to a device.
+ * qdev_property_add_static:
+ * @dev: Device to add the property to.
+ * @prop: The qdev property definition.
+ * @errp: location to store error information.
*
- * Static properties access data in a struct. The actual type of the
- * property and the field depends on the property type.
+ * Add a static QOM property to @dev for qdev property @prop.
+ * On error, store error in @errp. Static properties access data in a struct.
+ * The type of the QOM property is derived from prop->info.
*/
void qdev_property_add_static(DeviceState *dev, Property *prop,
Error **errp)
diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h
index 0586cac..034b75a 100644
--- a/include/hw/qdev-properties.h
+++ b/include/hw/qdev-properties.h
@@ -197,8 +197,14 @@ void error_set_from_qdev_prop_error(Error **errp, int ret, DeviceState *dev,
Property *prop, const char *value);
/**
- * @qdev_property_add_static - add a @Property to a device referencing a
- * field in a struct.
+ * qdev_property_add_static:
+ * @dev: Device to add the property to.
+ * @prop: The qdev property definition.
+ * @errp: location to store error information.
+ *
+ * Add a static QOM property to @dev for qdev property @prop.
+ * On error, store error in @errp. Static properties access data in a struct.
+ * The type of the QOM property is derived from prop->info.
*/
void qdev_property_add_static(DeviceState *dev, Property *prop, Error **errp);
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 21/52] fw_cfg: follow CODING_STYLE
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (19 preceding siblings ...)
2016-06-05 7:42 ` [Qemu-devel] [PULL 20/52] qdev: Clean up around properties Michael Tokarev
@ 2016-06-05 7:42 ` Michael Tokarev
2016-06-05 7:42 ` [Qemu-devel] [PULL 22/52] replay: Clean up includes Michael Tokarev
` (31 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:42 UTC (permalink / raw)
To: qemu-devel; +Cc: Cao jin, qemu-trivial, Michael Tokarev
From: Cao jin <caoj.fnst@cn.fujitsu.com>
Replace tab with 4 spaces; brace the indented statement.
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Acked-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/nvram/fw_cfg.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index cdbdfb5..74a0079 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -729,15 +729,20 @@ static int get_fw_cfg_order(FWCfgState *s, const char *name)
{
int i;
- if (s->fw_cfg_order_override > 0)
- return s->fw_cfg_order_override;
+ if (s->fw_cfg_order_override > 0) {
+ return s->fw_cfg_order_override;
+ }
for (i = 0; i < ARRAY_SIZE(fw_cfg_order); i++) {
- if (fw_cfg_order[i].name == NULL)
- continue;
- if (strcmp(name, fw_cfg_order[i].name) == 0)
- return fw_cfg_order[i].order;
+ if (fw_cfg_order[i].name == NULL) {
+ continue;
+ }
+
+ if (strcmp(name, fw_cfg_order[i].name) == 0) {
+ return fw_cfg_order[i].order;
+ }
}
+
/* Stick unknown stuff at the end. */
error_report("warning: Unknown firmware file in legacy mode: %s\n", name);
return FW_CFG_ORDER_OVERRIDE_LAST;
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 22/52] replay: Clean up includes
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (20 preceding siblings ...)
2016-06-05 7:42 ` [Qemu-devel] [PULL 21/52] fw_cfg: follow CODING_STYLE Michael Tokarev
@ 2016-06-05 7:42 ` Michael Tokarev
2016-06-05 7:43 ` [Qemu-devel] [PULL 23/52] hw: " Michael Tokarev
` (30 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:42 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, qemu-trivial, Michael Tokarev
From: Peter Maydell <peter.maydell@linaro.org>
Clean up includes so that osdep.h is included first and headers
which it implies are not included manually.
This commit was created with scripts/clean-includes.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
replay/replay-char.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/replay/replay-char.c b/replay/replay-char.c
index 23b6922..edf46ab 100755
--- a/replay/replay-char.c
+++ b/replay/replay-char.c
@@ -9,10 +9,6 @@
*
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
#include "qemu/osdep.h"
#include "qemu/error-report.h"
#include "sysemu/replay.h"
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 23/52] hw: Clean up includes
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (21 preceding siblings ...)
2016-06-05 7:42 ` [Qemu-devel] [PULL 22/52] replay: Clean up includes Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-05 7:43 ` [Qemu-devel] [PULL 24/52] docs: Fix a couple of typos in throttle.txt Michael Tokarev
` (29 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, qemu-trivial, Michael Tokarev
From: Peter Maydell <peter.maydell@linaro.org>
Clean up includes so that osdep.h is included first and headers
which it implies are not included manually.
This commit was created with scripts/clean-includes.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/intc/aspeed_vic.c | 1 -
hw/timer/mc146818rtc.c | 1 -
include/exec/hwaddr.h | 1 -
include/qemu/fifo32.h | 1 -
4 files changed, 4 deletions(-)
diff --git a/hw/intc/aspeed_vic.c b/hw/intc/aspeed_vic.c
index 725d5b6..2370e74 100644
--- a/hw/intc/aspeed_vic.c
+++ b/hw/intc/aspeed_vic.c
@@ -28,7 +28,6 @@
*/
#include "qemu/osdep.h"
-#include <inttypes.h>
#include "hw/intc/aspeed_vic.h"
#include "qemu/bitops.h"
#include "qemu/log.h"
diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c
index 2ac0fd3..a11b8b4 100644
--- a/hw/timer/mc146818rtc.c
+++ b/hw/timer/mc146818rtc.c
@@ -22,7 +22,6 @@
* THE SOFTWARE.
*/
#include "qemu/osdep.h"
-#include "config-target.h"
#include "qemu/cutils.h"
#include "qemu/bcd.h"
#include "hw/hw.h"
diff --git a/include/exec/hwaddr.h b/include/exec/hwaddr.h
index bb41588..a71c93c 100644
--- a/include/exec/hwaddr.h
+++ b/include/exec/hwaddr.h
@@ -3,7 +3,6 @@
#ifndef HWADDR_H
#define HWADDR_H
-#include <inttypes.h>
#define HWADDR_BITS 64
/* hwaddr is the type of a physical address (its size can
diff --git a/include/qemu/fifo32.h b/include/qemu/fifo32.h
index 2e5a0cc..4e9fd1b 100644
--- a/include/qemu/fifo32.h
+++ b/include/qemu/fifo32.h
@@ -15,7 +15,6 @@
#ifndef FIFO32_H
#define FIFO32_H
-#include "qemu/osdep.h"
#include "qemu/fifo8.h"
typedef struct {
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 24/52] docs: Fix a couple of typos in throttle.txt
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (22 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 23/52] hw: " Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-08 9:00 ` Alberto Garcia
2016-06-05 7:43 ` [Qemu-devel] [PULL 25/52] Fix configure test for PBKDF2 in nettle Michael Tokarev
` (28 subsequent siblings)
52 siblings, 1 reply; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel; +Cc: Alberto Garcia, qemu-trivial, Michael Tokarev
From: Alberto Garcia <berto@igalia.com>
Signed-off-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
docs/throttle.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/throttle.txt b/docs/throttle.txt
index 06ed9b3..26d4d51 100644
--- a/docs/throttle.txt
+++ b/docs/throttle.txt
@@ -39,7 +39,7 @@ the parameters for both cases:
| throttling.bps-write | bps_wr |
|-----------------------+-----------------------|
-It is possible to set limits for both IOPS and bps and the same time,
+It is possible to set limits for both IOPS and bps at the same time,
and for each case we can decide whether to have separate read and
write limits or not, but note that if iops-total is set then neither
iops-read nor iops-write can be set. The same applies to bps-total and
@@ -235,7 +235,7 @@ consider the following values:
- Water leaks from the bucket at a rate of 100 IOPS.
- Water can be added to the bucket at a rate of 2000 IOPS.
- The size of the bucket is 2000 x 60 = 120000
- - If 'iops-total-max-length' is unset then the bucket size is 100.
+ - If 'iops-total-max' is unset then the bucket size is 100 x 60.
The bucket is initially empty, therefore water can be added until it's
full at a rate of 2000 IOPS (the burst rate). Once the bucket is full
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* Re: [Qemu-devel] [PULL 24/52] docs: Fix a couple of typos in throttle.txt
2016-06-05 7:43 ` [Qemu-devel] [PULL 24/52] docs: Fix a couple of typos in throttle.txt Michael Tokarev
@ 2016-06-08 9:00 ` Alberto Garcia
2016-06-08 9:44 ` Michael Tokarev
0 siblings, 1 reply; 60+ messages in thread
From: Alberto Garcia @ 2016-06-08 9:00 UTC (permalink / raw)
To: Michael Tokarev, qemu-devel; +Cc: qemu-trivial
On Sun 05 Jun 2016 09:43:01 AM CEST, Michael Tokarev wrote:
> - Water leaks from the bucket at a rate of 100 IOPS.
> - Water can be added to the bucket at a rate of 2000 IOPS.
> - The size of the bucket is 2000 x 60 = 120000
> - - If 'iops-total-max-length' is unset then the bucket size is 100.
> + - If 'iops-total-max' is unset then the bucket size is 100 x 60.
Sorry, I should have noticed this here in the pull request, but this is
wrong.
If 'iops-total-max' is unset the bucket size is 100. It's not 100 x 60
because you can only set 'iops-total-max-length = 60' when
'iops-total-max' is set as well.
I'll send a new patch fixing this.
Berto
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [Qemu-devel] [PULL 24/52] docs: Fix a couple of typos in throttle.txt
2016-06-08 9:00 ` Alberto Garcia
@ 2016-06-08 9:44 ` Michael Tokarev
2016-06-08 10:23 ` Alberto Garcia
0 siblings, 1 reply; 60+ messages in thread
From: Michael Tokarev @ 2016-06-08 9:44 UTC (permalink / raw)
To: Alberto Garcia, qemu-devel; +Cc: qemu-trivial
08.06.2016 12:00, Alberto Garcia wrote:
> On Sun 05 Jun 2016 09:43:01 AM CEST, Michael Tokarev wrote:
>
>> - Water leaks from the bucket at a rate of 100 IOPS.
>> - Water can be added to the bucket at a rate of 2000 IOPS.
>> - The size of the bucket is 2000 x 60 = 120000
>> - - If 'iops-total-max-length' is unset then the bucket size is 100.
>> + - If 'iops-total-max' is unset then the bucket size is 100 x 60.
>
> Sorry, I should have noticed this here in the pull request, but this is
> wrong.
This has been discussed before, and it looks like the original
version which I applied was actually right... :)
I can just drop this patch from the pull request, since it hasn't
been applied yet. Esp. since the subject line is now wrong too :)
Thanks,
/mjt
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [Qemu-devel] [PULL 24/52] docs: Fix a couple of typos in throttle.txt
2016-06-08 9:44 ` Michael Tokarev
@ 2016-06-08 10:23 ` Alberto Garcia
0 siblings, 0 replies; 60+ messages in thread
From: Alberto Garcia @ 2016-06-08 10:23 UTC (permalink / raw)
To: Michael Tokarev, qemu-devel; +Cc: qemu-trivial
On Wed 08 Jun 2016 11:44:35 AM CEST, Michael Tokarev wrote:
> 08.06.2016 12:00, Alberto Garcia wrote:
>> On Sun 05 Jun 2016 09:43:01 AM CEST, Michael Tokarev wrote:
>>
>>> - Water leaks from the bucket at a rate of 100 IOPS.
>>> - Water can be added to the bucket at a rate of 2000 IOPS.
>>> - The size of the bucket is 2000 x 60 = 120000
>>> - - If 'iops-total-max-length' is unset then the bucket size is 100.
>>> + - If 'iops-total-max' is unset then the bucket size is 100 x 60.
>>
>> Sorry, I should have noticed this here in the pull request, but this is
>> wrong.
>
> This has been discussed before, and it looks like the original version
> which I applied was actually right... :)
>
> I can just drop this patch from the pull request, since it hasn't
> been applied yet. Esp. since the subject line is now wrong too :)
It's been applied already:
https://github.com/qemu/qemu/commit/0bab0ebb17759c926bd48fd396bd8cbb2c8e4a3e
I'll send a follow-up patch.
Berto
^ permalink raw reply [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 25/52] Fix configure test for PBKDF2 in nettle
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (23 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 24/52] docs: Fix a couple of typos in throttle.txt Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-05 7:43 ` [Qemu-devel] [PULL 26/52] e1000: Removing unnecessary if statement Michael Tokarev
` (27 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel; +Cc: Steven Luo, qemu-trivial, qemu-stable, Michael Tokarev
From: Steven Luo <steven+qemu@steven676.net>
On my Debian jessie system, including nettle/pbkdf2.h does not cause
NULL to be defined, which causes the test to fail to compile. Include
stddef.h to bring in a definition of NULL.
Cc: qemu-trivial@nongnu.org
Cc: qemu-stable@nongnu.org
Signed-off-by: Steven Luo <steven+qemu@steven676.net>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
configure | 1 +
1 file changed, 1 insertion(+)
diff --git a/configure b/configure
index f37909d..fd71618 100755
--- a/configure
+++ b/configure
@@ -2343,6 +2343,7 @@ if test "$nettle" != "no"; then
nettle="yes"
cat > $TMPC << EOF
+#include <stddef.h>
#include <nettle/pbkdf2.h>
int main(void) {
pbkdf2_hmac_sha256(8, NULL, 1000, 8, NULL, 8, NULL);
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 26/52] e1000: Removing unnecessary if statement
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (24 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 25/52] Fix configure test for PBKDF2 in nettle Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-05 7:43 ` [Qemu-devel] [PULL 27/52] pc: cleanup unused struct PcRomPciInfo Michael Tokarev
` (26 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel; +Cc: Sameeh Jubran, qemu-trivial, Michael Tokarev
From: Sameeh Jubran <sameeh@daynix.com>
Since mit_delay can never be 0 this if statement is
superfluous.
Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/net/e1000.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/hw/net/e1000.c b/hw/net/e1000.c
index 36e3dbe..1202371 100644
--- a/hw/net/e1000.c
+++ b/hw/net/e1000.c
@@ -311,11 +311,9 @@ set_interrupt_cause(E1000State *s, int index, uint32_t val)
*/
mit_delay = (mit_delay < 500) ? 500 : mit_delay;
- if (mit_delay) {
- s->mit_timer_on = 1;
- timer_mod(s->mit_timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) +
- mit_delay * 256);
- }
+ s->mit_timer_on = 1;
+ timer_mod(s->mit_timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) +
+ mit_delay * 256);
s->mit_ide = 0;
}
}
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 27/52] pc: cleanup unused struct PcRomPciInfo
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (25 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 26/52] e1000: Removing unnecessary if statement Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-05 7:43 ` [Qemu-devel] [PULL 28/52] clean-includes: Add glib.h to list of unneeded includes Michael Tokarev
` (25 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel; +Cc: Igor Mammedov, qemu-trivial, Michael Tokarev
From: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/i386/pc.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index e29ccc8..b0a4bec 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1149,14 +1149,6 @@ void pc_cpus_init(PCMachineState *pcms)
smbios_set_cpuid(cpu->env.cpuid_version, cpu->env.features[FEAT_1_EDX]);
}
-/* pci-info ROM file. Little endian format */
-typedef struct PcRomPciInfo {
- uint64_t w32_min;
- uint64_t w32_max;
- uint64_t w64_min;
- uint64_t w64_max;
-} PcRomPciInfo;
-
static
void pc_machine_done(Notifier *notifier, void *data)
{
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 28/52] clean-includes: Add glib.h to list of unneeded includes
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (26 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 27/52] pc: cleanup unused struct PcRomPciInfo Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-05 7:43 ` [Qemu-devel] [PULL 29/52] tests: Remove unnecessary glib.h includes Michael Tokarev
` (24 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, qemu-trivial, Michael Tokarev
From: Peter Maydell <peter.maydell@linaro.org>
osdep.h pulls in glib.h via glib-compat.h, so add it to the list of
includes that we remove. (This then means we must avoid running
clean-includes on glib-compat.h or it will delete the glib.h include.)
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Tested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
scripts/clean-includes | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/clean-includes b/scripts/clean-includes
index adffedd..37b73b5 100755
--- a/scripts/clean-includes
+++ b/scripts/clean-includes
@@ -104,6 +104,7 @@ for f in "$@"; do
;;
*include/qemu/osdep.h | \
*include/qemu/compiler.h | \
+ *include/glib-compat.h | \
*include/standard-headers/ )
# Removing include lines from osdep.h itself would be counterproductive.
echo "SKIPPING $f (special case header)"
@@ -143,7 +144,7 @@ for f in "$@"; do
<setjmp.h> <stdarg.h> <stddef.h> <stdbool.h> <stdint.h> <sys/types.h>
<stdlib.h> <stdio.h> <string.h> <strings.h> <inttypes.h>
<limits.h> <unistd.h> <time.h> <ctype.h> <errno.h> <fcntl.h>
- <sys/stat.h> <sys/time.h> <assert.h> <signal.h>
+ <sys/stat.h> <sys/time.h> <assert.h> <signal.h> <glib.h>
"sysemu/os-posix.h, sysemu/os-win32.h "glib-compat.h"
"qemu/typedefs.h"
))' "$f"
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 29/52] tests: Remove unnecessary glib.h includes
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (27 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 28/52] clean-includes: Add glib.h to list of unneeded includes Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-05 7:43 ` [Qemu-devel] [PULL 30/52] qga: " Michael Tokarev
` (23 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, qemu-trivial, Michael Tokarev
From: Peter Maydell <peter.maydell@linaro.org>
Remove glib.h includes, as it is provided by osdep.h.
This commit was created with scripts/clean-includes.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Tested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
tests/ac97-test.c | 1 -
tests/ahci-test.c | 1 -
tests/bios-tables-test.c | 1 -
tests/boot-order-test.c | 1 -
tests/check-qdict.c | 1 -
tests/check-qfloat.c | 1 -
tests/check-qint.c | 1 -
tests/check-qjson.c | 1 -
tests/check-qlist.c | 1 -
tests/check-qnull.c | 1 -
tests/check-qom-interface.c | 1 -
tests/check-qom-proplist.c | 1 -
tests/check-qstring.c | 1 -
tests/device-introspect-test.c | 1 -
tests/display-vga-test.c | 1 -
tests/drive_del-test.c | 1 -
tests/ds1338-test.c | 2 --
tests/e1000-test.c | 1 -
tests/eepro100-test.c | 1 -
tests/endianness-test.c | 1 -
tests/es1370-test.c | 1 -
tests/fdc-test.c | 1 -
tests/fw_cfg-test.c | 1 -
tests/hd-geo-test.c | 1 -
tests/i440fx-test.c | 1 -
tests/i82801b11-test.c | 1 -
tests/ide-test.c | 1 -
tests/intel-hda-test.c | 1 -
tests/ioh3420-test.c | 1 -
tests/ipmi-bt-test.c | 1 -
tests/ipmi-kcs-test.c | 1 -
tests/ipoctal232-test.c | 1 -
tests/ivshmem-test.c | 1 -
tests/libqos/ahci.c | 1 -
tests/libqos/fw_cfg.c | 1 -
tests/libqos/i2c-imx.c | 1 -
tests/libqos/i2c-omap.c | 1 -
tests/libqos/libqos.c | 1 -
tests/libqos/malloc-generic.c | 1 -
tests/libqos/malloc-pc.c | 1 -
tests/libqos/malloc.c | 1 -
tests/libqos/pci-pc.c | 1 -
tests/libqos/pci.c | 1 -
tests/libqos/usb.c | 1 -
tests/libqos/virtio-mmio.c | 1 -
tests/libqos/virtio-pci.c | 1 -
tests/libqos/virtio.c | 1 -
tests/libqtest.c | 1 -
tests/m48t59-test.c | 1 -
tests/ne2000-test.c | 1 -
tests/nvme-test.c | 1 -
tests/pc-cpu-test.c | 1 -
tests/pcnet-test.c | 1 -
tests/pvpanic-test.c | 1 -
tests/pxe-test.c | 1 -
tests/q35-test.c | 1 -
tests/qom-test.c | 1 -
tests/rcutorture.c | 1 -
tests/rtc-test.c | 1 -
tests/rtl8139-test.c | 1 -
tests/spapr-phb-test.c | 1 -
tests/tco-test.c | 1 -
tests/test-aio.c | 1 -
tests/test-base64.c | 1 -
tests/test-bitops.c | 1 -
tests/test-blockjob-txn.c | 1 -
tests/test-coroutine.c | 1 -
tests/test-crypto-cipher.c | 1 -
tests/test-crypto-hash.c | 1 -
tests/test-crypto-secret.c | 1 -
tests/test-cutils.c | 1 -
tests/test-filter-mirror.c | 1 -
tests/test-filter-redirector.c | 1 -
tests/test-hbitmap.c | 1 -
tests/test-int128.c | 1 -
tests/test-io-task.c | 1 -
tests/test-iov.c | 1 -
tests/test-logging.c | 1 -
tests/test-mul64.c | 1 -
tests/test-netfilter.c | 1 -
tests/test-opts-visitor.c | 1 -
tests/test-qdev-global-props.c | 1 -
tests/test-qemu-opts.c | 1 -
tests/test-qga.c | 1 -
tests/test-qmp-commands.c | 1 -
tests/test-qmp-event.c | 1 -
tests/test-qmp-input-strict.c | 1 -
tests/test-qmp-input-visitor.c | 1 -
tests/test-qmp-output-visitor.c | 1 -
tests/test-rcu-list.c | 1 -
tests/test-rfifolock.c | 1 -
tests/test-string-input-visitor.c | 1 -
tests/test-string-output-visitor.c | 1 -
tests/test-thread-pool.c | 1 -
tests/test-throttle.c | 1 -
tests/test-timed-average.c | 1 -
tests/test-visitor-serialization.c | 1 -
tests/test-vmstate.c | 1 -
tests/test-write-threshold.c | 1 -
tests/test-x86-cpuid.c | 1 -
tests/tmp105-test.c | 1 -
tests/tpci200-test.c | 1 -
tests/usb-hcd-ehci-test.c | 1 -
tests/usb-hcd-ohci-test.c | 1 -
tests/usb-hcd-uhci-test.c | 1 -
tests/usb-hcd-xhci-test.c | 1 -
tests/vhost-user-test.c | 1 -
tests/virtio-9p-test.c | 1 -
tests/virtio-balloon-test.c | 1 -
tests/virtio-blk-test.c | 1 -
tests/virtio-console-test.c | 1 -
tests/virtio-net-test.c | 1 -
tests/virtio-rng-test.c | 1 -
tests/virtio-scsi-test.c | 1 -
tests/virtio-serial-test.c | 1 -
tests/vmxnet3-test.c | 1 -
tests/wdt_ib700-test.c | 1 -
117 files changed, 118 deletions(-)
diff --git a/tests/ac97-test.c b/tests/ac97-test.c
index 75cab8f..e0d177b 100644
--- a/tests/ac97-test.c
+++ b/tests/ac97-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
/* Tests only initialization so far. TODO: Replace with functional tests */
diff --git a/tests/ahci-test.c b/tests/ahci-test.c
index 6869f7f..57dc44c 100644
--- a/tests/ahci-test.c
+++ b/tests/ahci-test.c
@@ -24,7 +24,6 @@
#include "qemu/osdep.h"
#include <getopt.h>
-#include <glib.h>
#include "libqtest.h"
#include "libqos/libqos-pc.h"
diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
index 0352814..e4c6a3c 100644
--- a/tests/bios-tables-test.c
+++ b/tests/bios-tables-test.c
@@ -11,7 +11,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include <glib/gstdio.h>
#include "qemu-common.h"
#include "libqtest.h"
diff --git a/tests/boot-order-test.c b/tests/boot-order-test.c
index a6d8bd5..fc1e794 100644
--- a/tests/boot-order-test.c
+++ b/tests/boot-order-test.c
@@ -11,7 +11,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqos/fw_cfg.h"
#include "libqtest.h"
diff --git a/tests/check-qdict.c b/tests/check-qdict.c
index a43056c..42da1e6 100644
--- a/tests/check-qdict.c
+++ b/tests/check-qdict.c
@@ -10,7 +10,6 @@
* See the COPYING.LIB file in the top-level directory.
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qapi/qmp/qint.h"
#include "qapi/qmp/qdict.h"
diff --git a/tests/check-qfloat.c b/tests/check-qfloat.c
index 3102608..1da2cda 100644
--- a/tests/check-qfloat.c
+++ b/tests/check-qfloat.c
@@ -11,7 +11,6 @@
*
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qapi/qmp/qfloat.h"
#include "qemu-common.h"
diff --git a/tests/check-qint.c b/tests/check-qint.c
index c86f7df..b6e4555 100644
--- a/tests/check-qint.c
+++ b/tests/check-qint.c
@@ -10,7 +10,6 @@
* See the COPYING.LIB file in the top-level directory.
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qapi/qmp/qint.h"
#include "qemu-common.h"
diff --git a/tests/check-qjson.c b/tests/check-qjson.c
index 99de6f5..0e158f6 100644
--- a/tests/check-qjson.c
+++ b/tests/check-qjson.c
@@ -11,7 +11,6 @@
*
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qapi/qmp/qstring.h"
#include "qapi/qmp/qint.h"
diff --git a/tests/check-qlist.c b/tests/check-qlist.c
index f231d5f..e16da5e 100644
--- a/tests/check-qlist.c
+++ b/tests/check-qlist.c
@@ -10,7 +10,6 @@
* See the COPYING.LIB file in the top-level directory.
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qapi/qmp/qint.h"
#include "qapi/qmp/qlist.h"
diff --git a/tests/check-qnull.c b/tests/check-qnull.c
index fd9c68f..05d562d 100644
--- a/tests/check-qnull.c
+++ b/tests/check-qnull.c
@@ -7,7 +7,6 @@
* See the COPYING.LIB file in the top-level directory.
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qapi/qmp/qobject.h"
#include "qemu-common.h"
diff --git a/tests/check-qom-interface.c b/tests/check-qom-interface.c
index 09354de..719ddcf 100644
--- a/tests/check-qom-interface.c
+++ b/tests/check-qom-interface.c
@@ -10,7 +10,6 @@
* See the COPYING.LIB file in the top-level directory.
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qom/object.h"
#include "qemu/module.h"
diff --git a/tests/check-qom-proplist.c b/tests/check-qom-proplist.c
index ffffd87..42defe7 100644
--- a/tests/check-qom-proplist.c
+++ b/tests/check-qom-proplist.c
@@ -19,7 +19,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qapi/error.h"
#include "qom/object.h"
diff --git a/tests/check-qstring.c b/tests/check-qstring.c
index 9877b42..239e9d9 100644
--- a/tests/check-qstring.c
+++ b/tests/check-qstring.c
@@ -10,7 +10,6 @@
* See the COPYING.LIB file in the top-level directory.
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qapi/qmp/qstring.h"
#include "qemu-common.h"
diff --git a/tests/device-introspect-test.c b/tests/device-introspect-test.c
index 4477926..37debc1 100644
--- a/tests/device-introspect-test.c
+++ b/tests/device-introspect-test.c
@@ -18,7 +18,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu-common.h"
#include "qapi/qmp/qstring.h"
#include "libqtest.h"
diff --git a/tests/display-vga-test.c b/tests/display-vga-test.c
index 5706d33..06b244e 100644
--- a/tests/display-vga-test.c
+++ b/tests/display-vga-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
static void pci_cirrus(void)
diff --git a/tests/drive_del-test.c b/tests/drive_del-test.c
index fe03236..74e43c2 100644
--- a/tests/drive_del-test.c
+++ b/tests/drive_del-test.c
@@ -11,7 +11,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
static void drive_add(void)
diff --git a/tests/ds1338-test.c b/tests/ds1338-test.c
index 2792415..26968bc 100644
--- a/tests/ds1338-test.c
+++ b/tests/ds1338-test.c
@@ -21,8 +21,6 @@
#include "libqtest.h"
#include "libqos/i2c.h"
-#include <glib.h>
-
#define IMX25_I2C_0_BASE 0x43F80000
#define DS1338_ADDR 0x68
diff --git a/tests/e1000-test.c b/tests/e1000-test.c
index a42b381..59cab68 100644
--- a/tests/e1000-test.c
+++ b/tests/e1000-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
/* Tests only initialization so far. TODO: Replace with functional tests */
diff --git a/tests/eepro100-test.c b/tests/eepro100-test.c
index e17eed0..ed23258 100644
--- a/tests/eepro100-test.c
+++ b/tests/eepro100-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
static void test_device(gconstpointer data)
diff --git a/tests/endianness-test.c b/tests/endianness-test.c
index cc5bccd..2197972 100644
--- a/tests/endianness-test.c
+++ b/tests/endianness-test.c
@@ -12,7 +12,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
#include "qemu/bswap.h"
diff --git a/tests/es1370-test.c b/tests/es1370-test.c
index 824dc31..199fe19 100644
--- a/tests/es1370-test.c
+++ b/tests/es1370-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
/* Tests only initialization so far. TODO: Replace with functional tests */
diff --git a/tests/fdc-test.c b/tests/fdc-test.c
index 53df1d0..738c6b4 100644
--- a/tests/fdc-test.c
+++ b/tests/fdc-test.c
@@ -24,7 +24,6 @@
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
#include "qemu-common.h"
diff --git a/tests/fw_cfg-test.c b/tests/fw_cfg-test.c
index b4392c2..688342b 100644
--- a/tests/fw_cfg-test.c
+++ b/tests/fw_cfg-test.c
@@ -11,7 +11,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
#include "hw/nvram/fw_cfg_keys.h"
diff --git a/tests/hd-geo-test.c b/tests/hd-geo-test.c
index c8e669a..12ee392 100644
--- a/tests/hd-geo-test.c
+++ b/tests/hd-geo-test.c
@@ -16,7 +16,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu-common.h"
#include "libqtest.h"
diff --git a/tests/i440fx-test.c b/tests/i440fx-test.c
index 05029e9..bff999c 100644
--- a/tests/i440fx-test.c
+++ b/tests/i440fx-test.c
@@ -13,7 +13,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include <sys/mman.h>
#include "libqtest.h"
diff --git a/tests/i82801b11-test.c b/tests/i82801b11-test.c
index c3b5ebb..a6e3159 100644
--- a/tests/i82801b11-test.c
+++ b/tests/i82801b11-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
/* Tests only initialization so far. TODO: Replace with functional tests */
diff --git a/tests/ide-test.c b/tests/ide-test.c
index 67e5c1f..fed1b2e 100644
--- a/tests/ide-test.c
+++ b/tests/ide-test.c
@@ -24,7 +24,6 @@
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
#include "libqos/libqos.h"
diff --git a/tests/intel-hda-test.c b/tests/intel-hda-test.c
index 1be6add..b0ca7e0 100644
--- a/tests/intel-hda-test.c
+++ b/tests/intel-hda-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
#define HDA_ID "hda0"
diff --git a/tests/ioh3420-test.c b/tests/ioh3420-test.c
index 93eb2f7..b54c4b9 100644
--- a/tests/ioh3420-test.c
+++ b/tests/ioh3420-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
/* Tests only initialization so far. TODO: Replace with functional tests */
diff --git a/tests/ipmi-bt-test.c b/tests/ipmi-bt-test.c
index 812907f..be9005e 100644
--- a/tests/ipmi-bt-test.c
+++ b/tests/ipmi-bt-test.c
@@ -29,7 +29,6 @@
#include <netinet/ip.h>
#include <netinet/tcp.h>
-#include <glib.h>
#include "libqtest.h"
#include "qemu-common.h"
diff --git a/tests/ipmi-kcs-test.c b/tests/ipmi-kcs-test.c
index 42c4b97..3750389 100644
--- a/tests/ipmi-kcs-test.c
+++ b/tests/ipmi-kcs-test.c
@@ -24,7 +24,6 @@
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
diff --git a/tests/ipoctal232-test.c b/tests/ipoctal232-test.c
index 846aaf5..6849141 100644
--- a/tests/ipoctal232-test.c
+++ b/tests/ipoctal232-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
/* Tests only initialization so far. TODO: Replace with functional tests */
diff --git a/tests/ivshmem-test.c b/tests/ivshmem-test.c
index c027ff1..010860a 100644
--- a/tests/ivshmem-test.c
+++ b/tests/ivshmem-test.c
@@ -9,7 +9,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include <glib/gstdio.h>
#include <sys/mman.h>
#include "contrib/ivshmem-server/ivshmem-server.h"
diff --git a/tests/libqos/ahci.c b/tests/libqos/ahci.c
index ac6c155..f3be5500 100644
--- a/tests/libqos/ahci.c
+++ b/tests/libqos/ahci.c
@@ -23,7 +23,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
#include "libqos/ahci.h"
diff --git a/tests/libqos/fw_cfg.c b/tests/libqos/fw_cfg.c
index 76894d5..4d9dc3f 100644
--- a/tests/libqos/fw_cfg.c
+++ b/tests/libqos/fw_cfg.c
@@ -13,7 +13,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqos/fw_cfg.h"
#include "libqtest.h"
#include "qemu/bswap.h"
diff --git a/tests/libqos/i2c-imx.c b/tests/libqos/i2c-imx.c
index 51c3468..1c4b431 100644
--- a/tests/libqos/i2c-imx.c
+++ b/tests/libqos/i2c-imx.c
@@ -20,7 +20,6 @@
#include "qemu/osdep.h"
#include "libqos/i2c.h"
-#include <glib.h>
#include "libqtest.h"
diff --git a/tests/libqos/i2c-omap.c b/tests/libqos/i2c-omap.c
index 2028f2f..f603fdf 100644
--- a/tests/libqos/i2c-omap.c
+++ b/tests/libqos/i2c-omap.c
@@ -9,7 +9,6 @@
#include "qemu/osdep.h"
#include "libqos/i2c.h"
-#include <glib.h>
#include "qemu/bswap.h"
#include "libqtest.h"
diff --git a/tests/libqos/libqos.c b/tests/libqos/libqos.c
index 79b0b29..c7ba441 100644
--- a/tests/libqos/libqos.c
+++ b/tests/libqos/libqos.c
@@ -1,5 +1,4 @@
#include "qemu/osdep.h"
-#include <glib.h>
#include <sys/wait.h>
#include "libqtest.h"
diff --git a/tests/libqos/malloc-generic.c b/tests/libqos/malloc-generic.c
index 6000df2..33ce90b 100644
--- a/tests/libqos/malloc-generic.c
+++ b/tests/libqos/malloc-generic.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqos/malloc-generic.h"
#include "libqos/malloc.h"
diff --git a/tests/libqos/malloc-pc.c b/tests/libqos/malloc-pc.c
index eee706b..dd2b900 100644
--- a/tests/libqos/malloc-pc.c
+++ b/tests/libqos/malloc-pc.c
@@ -17,7 +17,6 @@
#include "hw/nvram/fw_cfg_keys.h"
#include "qemu-common.h"
-#include <glib.h>
#define PAGE_SIZE (4096)
diff --git a/tests/libqos/malloc.c b/tests/libqos/malloc.c
index 793fe69..b8eff5f 100644
--- a/tests/libqos/malloc.c
+++ b/tests/libqos/malloc.c
@@ -14,7 +14,6 @@
#include "libqos/malloc.h"
#include "qemu-common.h"
#include "qemu/host-utils.h"
-#include <glib.h>
typedef QTAILQ_HEAD(MemList, MemBlock) MemList;
diff --git a/tests/libqos/pci-pc.c b/tests/libqos/pci-pc.c
index 77f15e5..1ae2d37 100644
--- a/tests/libqos/pci-pc.c
+++ b/tests/libqos/pci-pc.c
@@ -19,7 +19,6 @@
#include "qemu-common.h"
#include "qemu/host-utils.h"
-#include <glib.h>
#define ACPI_PCIHP_ADDR 0xae00
#define PCI_EJ_BASE 0x0008
diff --git a/tests/libqos/pci.c b/tests/libqos/pci.c
index 0e104e1..ed78d91 100644
--- a/tests/libqos/pci.c
+++ b/tests/libqos/pci.c
@@ -14,7 +14,6 @@
#include "libqos/pci.h"
#include "hw/pci/pci_regs.h"
-#include <glib.h>
void qpci_device_foreach(QPCIBus *bus, int vendor_id, int device_id,
void (*func)(QPCIDevice *dev, int devfn, void *data),
diff --git a/tests/libqos/usb.c b/tests/libqos/usb.c
index 87efb90..f794d92 100644
--- a/tests/libqos/usb.c
+++ b/tests/libqos/usb.c
@@ -12,7 +12,6 @@
* See the COPYING file in the top-level directory.
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
#include "hw/usb/uhci-regs.h"
#include "libqos/usb.h"
diff --git a/tests/libqos/virtio-mmio.c b/tests/libqos/virtio-mmio.c
index a4382f3..e15b480 100644
--- a/tests/libqos/virtio-mmio.c
+++ b/tests/libqos/virtio-mmio.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
#include "libqos/virtio.h"
#include "libqos/virtio-mmio.h"
diff --git a/tests/libqos/virtio-pci.c b/tests/libqos/virtio-pci.c
index fde2ff0..9d45e20 100644
--- a/tests/libqos/virtio-pci.c
+++ b/tests/libqos/virtio-pci.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
#include "libqos/virtio.h"
#include "libqos/virtio-pci.h"
diff --git a/tests/libqos/virtio.c b/tests/libqos/virtio.c
index 613dece..d792635 100644
--- a/tests/libqos/virtio.c
+++ b/tests/libqos/virtio.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
#include "libqos/virtio.h"
diff --git a/tests/libqtest.c b/tests/libqtest.c
index b12a9e4..5c82348 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -17,7 +17,6 @@
#include "qemu/osdep.h"
#include "libqtest.h"
-#include <glib.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <sys/un.h>
diff --git a/tests/m48t59-test.c b/tests/m48t59-test.c
index a751fd3..0f921ef 100644
--- a/tests/m48t59-test.c
+++ b/tests/m48t59-test.c
@@ -13,7 +13,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
diff --git a/tests/ne2000-test.c b/tests/ne2000-test.c
index 3727875..b7cf3dd 100644
--- a/tests/ne2000-test.c
+++ b/tests/ne2000-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
/* Tests only initialization so far. TODO: Replace with functional tests */
diff --git a/tests/nvme-test.c b/tests/nvme-test.c
index ec06893..c8bece4 100644
--- a/tests/nvme-test.c
+++ b/tests/nvme-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
/* Tests only initialization so far. TODO: Replace with functional tests */
diff --git a/tests/pc-cpu-test.c b/tests/pc-cpu-test.c
index 6b34ca5..4428cea 100644
--- a/tests/pc-cpu-test.c
+++ b/tests/pc-cpu-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu-common.h"
#include "libqtest.h"
diff --git a/tests/pcnet-test.c b/tests/pcnet-test.c
index 2ddf496..efb1ef4 100644
--- a/tests/pcnet-test.c
+++ b/tests/pcnet-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
/* Tests only initialization so far. TODO: Replace with functional tests */
diff --git a/tests/pvpanic-test.c b/tests/pvpanic-test.c
index d435833..3bfa678 100644
--- a/tests/pvpanic-test.c
+++ b/tests/pvpanic-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
static void test_panic(void)
diff --git a/tests/pxe-test.c b/tests/pxe-test.c
index 875e4c4..b2cc355 100644
--- a/tests/pxe-test.c
+++ b/tests/pxe-test.c
@@ -12,7 +12,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include <glib/gstdio.h>
#include "qemu-common.h"
#include "libqtest.h"
diff --git a/tests/q35-test.c b/tests/q35-test.c
index a105f10..71538fc 100644
--- a/tests/q35-test.c
+++ b/tests/q35-test.c
@@ -10,7 +10,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
#include "libqos/pci.h"
#include "libqos/pci-pc.h"
diff --git a/tests/qom-test.c b/tests/qom-test.c
index bd5cdde..23493a2 100644
--- a/tests/qom-test.c
+++ b/tests/qom-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu-common.h"
#include "qemu/cutils.h"
diff --git a/tests/rcutorture.c b/tests/rcutorture.c
index 244f0f2..4002ecf 100644
--- a/tests/rcutorture.c
+++ b/tests/rcutorture.c
@@ -61,7 +61,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu/atomic.h"
#include "qemu/rcu.h"
#include "qemu/thread.h"
diff --git a/tests/rtc-test.c b/tests/rtc-test.c
index fa7029a..a086efd 100644
--- a/tests/rtc-test.c
+++ b/tests/rtc-test.c
@@ -12,7 +12,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
#include "hw/timer/mc146818rtc_regs.h"
diff --git a/tests/rtl8139-test.c b/tests/rtl8139-test.c
index 54e5aa7..13de7ee 100644
--- a/tests/rtl8139-test.c
+++ b/tests/rtl8139-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
#include "libqos/pci-pc.h"
#include "qemu/timer.h"
diff --git a/tests/spapr-phb-test.c b/tests/spapr-phb-test.c
index f53911d..21004a7 100644
--- a/tests/spapr-phb-test.c
+++ b/tests/spapr-phb-test.c
@@ -8,7 +8,6 @@
* See the COPYING file in the top-level directory.
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
diff --git a/tests/tco-test.c b/tests/tco-test.c
index ac11175..0d13aa8 100644
--- a/tests/tco-test.c
+++ b/tests/tco-test.c
@@ -7,7 +7,6 @@
* See the COPYING file in the top-level directory.
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
#include "libqos/pci.h"
diff --git a/tests/test-aio.c b/tests/test-aio.c
index 687dfa0..982339c 100644
--- a/tests/test-aio.c
+++ b/tests/test-aio.c
@@ -11,7 +11,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "block/aio.h"
#include "qapi/error.h"
#include "qemu/timer.h"
diff --git a/tests/test-base64.c b/tests/test-base64.c
index 922e839..ec122ce 100644
--- a/tests/test-base64.c
+++ b/tests/test-base64.c
@@ -19,7 +19,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qapi/error.h"
#include "qemu/base64.h"
diff --git a/tests/test-bitops.c b/tests/test-bitops.c
index 5050950..eb19a36 100644
--- a/tests/test-bitops.c
+++ b/tests/test-bitops.c
@@ -7,7 +7,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu/bitops.h"
typedef struct {
diff --git a/tests/test-blockjob-txn.c b/tests/test-blockjob-txn.c
index 828389b..d3030f1 100644
--- a/tests/test-blockjob-txn.c
+++ b/tests/test-blockjob-txn.c
@@ -11,7 +11,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qapi/error.h"
#include "qemu/main-loop.h"
#include "block/blockjob.h"
diff --git a/tests/test-coroutine.c b/tests/test-coroutine.c
index dd4ced9..91f252c 100644
--- a/tests/test-coroutine.c
+++ b/tests/test-coroutine.c
@@ -12,7 +12,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu/coroutine.h"
#include "qemu/coroutine_int.h"
diff --git a/tests/test-crypto-cipher.c b/tests/test-crypto-cipher.c
index 66d1c63..1b5130d 100644
--- a/tests/test-crypto-cipher.c
+++ b/tests/test-crypto-cipher.c
@@ -19,7 +19,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "crypto/init.h"
#include "crypto/cipher.h"
diff --git a/tests/test-crypto-hash.c b/tests/test-crypto-hash.c
index 735d6d7..6e0e89f 100644
--- a/tests/test-crypto-hash.c
+++ b/tests/test-crypto-hash.c
@@ -19,7 +19,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "crypto/init.h"
#include "crypto/hash.h"
diff --git a/tests/test-crypto-secret.c b/tests/test-crypto-secret.c
index aa26c20..0b1fe8d 100644
--- a/tests/test-crypto-secret.c
+++ b/tests/test-crypto-secret.c
@@ -19,7 +19,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "crypto/init.h"
#include "crypto/secret.h"
diff --git a/tests/test-cutils.c b/tests/test-cutils.c
index fb8f5b5..64e3e95 100644
--- a/tests/test-cutils.c
+++ b/tests/test-cutils.c
@@ -26,7 +26,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu/cutils.h"
diff --git a/tests/test-filter-mirror.c b/tests/test-filter-mirror.c
index f60bf2a..ffaaffa 100644
--- a/tests/test-filter-mirror.c
+++ b/tests/test-filter-mirror.c
@@ -9,7 +9,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
#include "qemu/iov.h"
#include "qemu/sockets.h"
diff --git a/tests/test-filter-redirector.c b/tests/test-filter-redirector.c
index b93012c..280e4b6 100644
--- a/tests/test-filter-redirector.c
+++ b/tests/test-filter-redirector.c
@@ -51,7 +51,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
#include "qemu/iov.h"
#include "qemu/sockets.h"
diff --git a/tests/test-hbitmap.c b/tests/test-hbitmap.c
index abe1427..71d0098 100644
--- a/tests/test-hbitmap.c
+++ b/tests/test-hbitmap.c
@@ -10,7 +10,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu/hbitmap.h"
#define LOG_BITS_PER_LONG (BITS_PER_LONG == 32 ? 5 : 6)
diff --git a/tests/test-int128.c b/tests/test-int128.c
index cacf6be..4390123 100644
--- a/tests/test-int128.c
+++ b/tests/test-int128.c
@@ -7,7 +7,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu/int128.h"
/* clang doesn't support __noclone__ but it does have a mechanism for
diff --git a/tests/test-io-task.c b/tests/test-io-task.c
index 5a97750..a36cb82 100644
--- a/tests/test-io-task.c
+++ b/tests/test-io-task.c
@@ -19,7 +19,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "io/task.h"
#include "qapi/error.h"
diff --git a/tests/test-iov.c b/tests/test-iov.c
index 3f25268..46ae25e 100644
--- a/tests/test-iov.c
+++ b/tests/test-iov.c
@@ -1,5 +1,4 @@
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu-common.h"
#include "qemu/iov.h"
#include "qemu/sockets.h"
diff --git a/tests/test-logging.c b/tests/test-logging.c
index ac8deed..5ef5bb8 100644
--- a/tests/test-logging.c
+++ b/tests/test-logging.c
@@ -25,7 +25,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu-common.h"
#include "include/qemu/log.h"
diff --git a/tests/test-mul64.c b/tests/test-mul64.c
index 1282ec5..9be775d 100644
--- a/tests/test-mul64.c
+++ b/tests/test-mul64.c
@@ -7,7 +7,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu/host-utils.h"
diff --git a/tests/test-netfilter.c b/tests/test-netfilter.c
index 7d105c3..8b5a9b2 100644
--- a/tests/test-netfilter.c
+++ b/tests/test-netfilter.c
@@ -9,7 +9,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
/* add a netfilter to a netdev and then remove it */
diff --git a/tests/test-opts-visitor.c b/tests/test-opts-visitor.c
index 008e677..d75b114 100644
--- a/tests/test-opts-visitor.c
+++ b/tests/test-opts-visitor.c
@@ -11,7 +11,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu/config-file.h" /* qemu_add_opts() */
#include "qemu/option.h" /* qemu_opts_parse() */
diff --git a/tests/test-qdev-global-props.c b/tests/test-qdev-global-props.c
index f0cc31e..48e5b73 100644
--- a/tests/test-qdev-global-props.c
+++ b/tests/test-qdev-global-props.c
@@ -23,7 +23,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "hw/qdev.h"
#include "qom/object.h"
diff --git a/tests/test-qemu-opts.c b/tests/test-qemu-opts.c
index 32abed5..a505a3e 100644
--- a/tests/test-qemu-opts.c
+++ b/tests/test-qemu-opts.c
@@ -12,7 +12,6 @@
#include "qapi/qmp/qstring.h"
#include "qemu/config-file.h"
-#include <glib.h>
static QemuOptsList opts_list_01 = {
.name = "opts_list_01",
diff --git a/tests/test-qga.c b/tests/test-qga.c
index 72a89de..9c9039f 100644
--- a/tests/test-qga.c
+++ b/tests/test-qga.c
@@ -1,6 +1,5 @@
#include "qemu/osdep.h"
#include <locale.h>
-#include <glib.h>
#include <glib/gstdio.h>
#include <sys/socket.h>
#include <sys/un.h>
diff --git a/tests/test-qmp-commands.c b/tests/test-qmp-commands.c
index 5c3edd7..e8f619d 100644
--- a/tests/test-qmp-commands.c
+++ b/tests/test-qmp-commands.c
@@ -1,5 +1,4 @@
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu-common.h"
#include "qapi/qmp/types.h"
#include "test-qmp-commands.h"
diff --git a/tests/test-qmp-event.c b/tests/test-qmp-event.c
index a296fdb..633dc87 100644
--- a/tests/test-qmp-event.c
+++ b/tests/test-qmp-event.c
@@ -12,7 +12,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu-common.h"
#include "test-qapi-types.h"
diff --git a/tests/test-qmp-input-strict.c b/tests/test-qmp-input-strict.c
index 4602529..d5f57c5 100644
--- a/tests/test-qmp-input-strict.c
+++ b/tests/test-qmp-input-strict.c
@@ -12,7 +12,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu-common.h"
#include "qapi/error.h"
diff --git a/tests/test-qmp-input-visitor.c b/tests/test-qmp-input-visitor.c
index cee07ce..3b6b39e 100644
--- a/tests/test-qmp-input-visitor.c
+++ b/tests/test-qmp-input-visitor.c
@@ -11,7 +11,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu-common.h"
#include "qapi/error.h"
diff --git a/tests/test-qmp-output-visitor.c b/tests/test-qmp-output-visitor.c
index 1f80e69..f8a7a27 100644
--- a/tests/test-qmp-output-visitor.c
+++ b/tests/test-qmp-output-visitor.c
@@ -11,7 +11,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu-common.h"
#include "qapi/error.h"
diff --git a/tests/test-rcu-list.c b/tests/test-rcu-list.c
index 79d3750..1514d7e 100644
--- a/tests/test-rcu-list.c
+++ b/tests/test-rcu-list.c
@@ -21,7 +21,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu/atomic.h"
#include "qemu/rcu.h"
#include "qemu/thread.h"
diff --git a/tests/test-rfifolock.c b/tests/test-rfifolock.c
index 9a3cb24..471a811 100644
--- a/tests/test-rfifolock.c
+++ b/tests/test-rfifolock.c
@@ -11,7 +11,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu-common.h"
#include "qemu/rfifolock.h"
diff --git a/tests/test-string-input-visitor.c b/tests/test-string-input-visitor.c
index 5a56920..7fe7a9c 100644
--- a/tests/test-string-input-visitor.c
+++ b/tests/test-string-input-visitor.c
@@ -11,7 +11,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu-common.h"
#include "qapi/error.h"
diff --git a/tests/test-string-output-visitor.c b/tests/test-string-output-visitor.c
index 1ecd75b..edff523 100644
--- a/tests/test-string-output-visitor.c
+++ b/tests/test-string-output-visitor.c
@@ -11,7 +11,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu-common.h"
#include "qapi/error.h"
diff --git a/tests/test-thread-pool.c b/tests/test-thread-pool.c
index 88dc731..b0e1f32 100644
--- a/tests/test-thread-pool.c
+++ b/tests/test-thread-pool.c
@@ -1,5 +1,4 @@
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu-common.h"
#include "block/aio.h"
#include "block/thread-pool.h"
diff --git a/tests/test-throttle.c b/tests/test-throttle.c
index c02be80..e9ac0a0 100644
--- a/tests/test-throttle.c
+++ b/tests/test-throttle.c
@@ -13,7 +13,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include <math.h>
#include "block/aio.h"
#include "qapi/error.h"
diff --git a/tests/test-timed-average.c b/tests/test-timed-average.c
index 1cc4ab3..e2bcf5f 100644
--- a/tests/test-timed-average.c
+++ b/tests/test-timed-average.c
@@ -11,7 +11,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu/timed-average.h"
diff --git a/tests/test-visitor-serialization.c b/tests/test-visitor-serialization.c
index 7b14b5a..777469f 100644
--- a/tests/test-visitor-serialization.c
+++ b/tests/test-visitor-serialization.c
@@ -12,7 +12,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include <float.h>
#include "qemu-common.h"
diff --git a/tests/test-vmstate.c b/tests/test-vmstate.c
index d19b16a..41fd841 100644
--- a/tests/test-vmstate.c
+++ b/tests/test-vmstate.c
@@ -23,7 +23,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu-common.h"
#include "migration/migration.h"
diff --git a/tests/test-write-threshold.c b/tests/test-write-threshold.c
index fdbc802..97ca12f 100644
--- a/tests/test-write-threshold.c
+++ b/tests/test-write-threshold.c
@@ -7,7 +7,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "block/block_int.h"
#include "block/write-threshold.h"
diff --git a/tests/test-x86-cpuid.c b/tests/test-x86-cpuid.c
index 8eb0bc6..ff22500 100644
--- a/tests/test-x86-cpuid.c
+++ b/tests/test-x86-cpuid.c
@@ -23,7 +23,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "hw/i386/topology.h"
diff --git a/tests/tmp105-test.c b/tests/tmp105-test.c
index 235cae0..a7940a4 100644
--- a/tests/tmp105-test.c
+++ b/tests/tmp105-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
#include "libqos/i2c.h"
diff --git a/tests/tpci200-test.c b/tests/tpci200-test.c
index cb2b00c..0321ec2 100644
--- a/tests/tpci200-test.c
+++ b/tests/tpci200-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
/* Tests only initialization so far. TODO: Replace with functional tests */
diff --git a/tests/usb-hcd-ehci-test.c b/tests/usb-hcd-ehci-test.c
index a0f13ef..eb247ad 100644
--- a/tests/usb-hcd-ehci-test.c
+++ b/tests/usb-hcd-ehci-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
#include "libqos/pci-pc.h"
#include "hw/usb/uhci-regs.h"
diff --git a/tests/usb-hcd-ohci-test.c b/tests/usb-hcd-ohci-test.c
index efd6669..4758813 100644
--- a/tests/usb-hcd-ohci-test.c
+++ b/tests/usb-hcd-ohci-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
#include "libqos/usb.h"
diff --git a/tests/usb-hcd-uhci-test.c b/tests/usb-hcd-uhci-test.c
index 71ff2ea..5cd59ad 100644
--- a/tests/usb-hcd-uhci-test.c
+++ b/tests/usb-hcd-uhci-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
#include "libqos/usb.h"
#include "hw/usb/uhci-regs.h"
diff --git a/tests/usb-hcd-xhci-test.c b/tests/usb-hcd-xhci-test.c
index 7e2e212..22513e9 100644
--- a/tests/usb-hcd-xhci-test.c
+++ b/tests/usb-hcd-xhci-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
#include "libqos/usb.h"
diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
index 6961596..2724fe9 100644
--- a/tests/vhost-user-test.c
+++ b/tests/vhost-user-test.c
@@ -9,7 +9,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
#include "qemu/option.h"
diff --git a/tests/virtio-9p-test.c b/tests/virtio-9p-test.c
index 59d0f1f..1e39335 100644
--- a/tests/virtio-9p-test.c
+++ b/tests/virtio-9p-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
#include "qemu-common.h"
diff --git a/tests/virtio-balloon-test.c b/tests/virtio-balloon-test.c
index b010ce9..0d0046b 100644
--- a/tests/virtio-balloon-test.c
+++ b/tests/virtio-balloon-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
/* Tests only initialization so far. TODO: Replace with functional tests */
diff --git a/tests/virtio-blk-test.c b/tests/virtio-blk-test.c
index 3a66630..8272ba8 100644
--- a/tests/virtio-blk-test.c
+++ b/tests/virtio-blk-test.c
@@ -9,7 +9,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
#include "libqos/virtio.h"
#include "libqos/virtio-pci.h"
diff --git a/tests/virtio-console-test.c b/tests/virtio-console-test.c
index 0b9c2a5..6d6414d 100644
--- a/tests/virtio-console-test.c
+++ b/tests/virtio-console-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
/* Tests only initialization so far. TODO: Replace with functional tests */
diff --git a/tests/virtio-net-test.c b/tests/virtio-net-test.c
index 04cfcd5..e5c1448 100644
--- a/tests/virtio-net-test.c
+++ b/tests/virtio-net-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
#include "qemu-common.h"
#include "qemu/sockets.h"
diff --git a/tests/virtio-rng-test.c b/tests/virtio-rng-test.c
index 771dbd7..e1b2640 100644
--- a/tests/virtio-rng-test.c
+++ b/tests/virtio-rng-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
#include "libqos/pci.h"
diff --git a/tests/virtio-scsi-test.c b/tests/virtio-scsi-test.c
index d78747a..5f1a8ae 100644
--- a/tests/virtio-scsi-test.c
+++ b/tests/virtio-scsi-test.c
@@ -9,7 +9,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
#include "block/scsi.h"
#include "libqos/virtio.h"
diff --git a/tests/virtio-serial-test.c b/tests/virtio-serial-test.c
index 480d4ab..b14d943 100644
--- a/tests/virtio-serial-test.c
+++ b/tests/virtio-serial-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
/* Tests only initialization so far. TODO: Replace with functional tests */
diff --git a/tests/vmxnet3-test.c b/tests/vmxnet3-test.c
index 6ef0e2f..159c0ad 100644
--- a/tests/vmxnet3-test.c
+++ b/tests/vmxnet3-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
/* Tests only initialization so far. TODO: Replace with functional tests */
diff --git a/tests/wdt_ib700-test.c b/tests/wdt_ib700-test.c
index efe3370..9c1d78b 100644
--- a/tests/wdt_ib700-test.c
+++ b/tests/wdt_ib700-test.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "libqtest.h"
#include "qemu/timer.h"
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 30/52] qga: Remove unnecessary glib.h includes
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (28 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 29/52] tests: Remove unnecessary glib.h includes Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-05 7:43 ` [Qemu-devel] [PULL 31/52] all: " Michael Tokarev
` (22 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, qemu-trivial, Michael Tokarev
From: Peter Maydell <peter.maydell@linaro.org>
Remove glib.h includes, as it is provided by osdep.h.
This commit was created with scripts/clean-includes.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Tested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
qga/channel-posix.c | 1 -
qga/channel-win32.c | 1 -
qga/channel.h | 1 -
qga/commands-posix.c | 1 -
qga/commands-win32.c | 1 -
qga/commands.c | 1 -
qga/guest-agent-command-state.c | 1 -
qga/main.c | 1 -
qga/service-win32.c | 1 -
9 files changed, 9 deletions(-)
diff --git a/qga/channel-posix.c b/qga/channel-posix.c
index 63458c6..bb65d8b 100644
--- a/qga/channel-posix.c
+++ b/qga/channel-posix.c
@@ -1,5 +1,4 @@
#include "qemu/osdep.h"
-#include <glib.h>
#include <termios.h>
#include "qapi/error.h"
#include "qemu/sockets.h"
diff --git a/qga/channel-win32.c b/qga/channel-win32.c
index 68168d1..21f9dee 100644
--- a/qga/channel-win32.c
+++ b/qga/channel-win32.c
@@ -1,5 +1,4 @@
#include "qemu/osdep.h"
-#include <glib.h>
#include <windows.h>
#include <io.h>
#include "qga/guest-agent-core.h"
diff --git a/qga/channel.h b/qga/channel.h
index 3704ea9..ae8cf0f 100644
--- a/qga/channel.h
+++ b/qga/channel.h
@@ -12,7 +12,6 @@
#ifndef QGA_CHANNEL_H
#define QGA_CHANNEL_H
-#include <glib.h>
typedef struct GAChannel GAChannel;
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index f0057f5..eaef7be 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -12,7 +12,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include <sys/ioctl.h>
#include <sys/wait.h>
#include <dirent.h>
diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index d76327f..c1a8588 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -12,7 +12,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include <wtypes.h>
#include <powrprof.h>
#include <winsock2.h>
diff --git a/qga/commands.c b/qga/commands.c
index 3144464..50fd26a 100644
--- a/qga/commands.c
+++ b/qga/commands.c
@@ -11,7 +11,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qga/guest-agent-core.h"
#include "qga-qmp-commands.h"
#include "qapi/qmp/qerror.h"
diff --git a/qga/guest-agent-command-state.c b/qga/guest-agent-command-state.c
index 20b9b22..4de229c 100644
--- a/qga/guest-agent-command-state.c
+++ b/qga/guest-agent-command-state.c
@@ -10,7 +10,6 @@
* See the COPYING file in the top-level directory.
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qga/guest-agent-core.h"
struct GACommandState {
diff --git a/qga/main.c b/qga/main.c
index c5527821..4c3b2c7 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -11,7 +11,6 @@
* See the COPYING file in the top-level directory.
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include <getopt.h>
#include <glib/gstdio.h>
#ifndef _WIN32
diff --git a/qga/service-win32.c b/qga/service-win32.c
index 7243758..fd434e3 100644
--- a/qga/service-win32.c
+++ b/qga/service-win32.c
@@ -11,7 +11,6 @@
* See the COPYING file in the top-level directory.
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include <windows.h>
#include "qga/service-win32.h"
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 31/52] all: Remove unnecessary glib.h includes
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (29 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 30/52] qga: " Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-05 7:43 ` [Qemu-devel] [PULL 32/52] docs/multi-thread-compression: Fix wrong command string Michael Tokarev
` (21 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, qemu-trivial, Michael Tokarev
From: Peter Maydell <peter.maydell@linaro.org>
Remove glib.h includes, as it is provided by osdep.h.
This commit was created with scripts/clean-includes.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Tested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
block/dmg.c | 1 -
block/vhdx.c | 1 -
block/vmdk.c | 1 -
fsdev/9p-iov-marshal.c | 1 -
fsdev/9p-marshal.c | 1 -
hw/9pfs/9p.h | 1 -
hw/i386/acpi-build.c | 1 -
hw/i386/pc_piix.c | 1 -
include/hw/acpi/aml-build.h | 1 -
include/hw/acpi/bios-linker-loader.h | 1 -
include/qemu/bitmap.h | 1 -
include/qemu/rcu.h | 1 -
include/qom/object.h | 1 -
include/sysemu/tpm_backend_int.h | 1 -
memory_mapping.c | 1 -
migration/postcopy-ram.c | 1 -
page_cache.c | 1 -
qapi/qmp-registry.c | 1 -
qemu-bridge-helper.c | 1 -
slirp/dnssearch.c | 1 -
slirp/slirp.h | 1 -
ui/sdl_zoom.c | 1 -
ui/vnc-palette.c | 1 -
util/coroutine-gthread.c | 1 -
util/hbitmap.c | 1 -
util/memfd.c | 1 -
util/oslib-win32.c | 1 -
util/uri.c | 1 -
vl.c | 1 -
29 files changed, 29 deletions(-)
diff --git a/block/dmg.c b/block/dmg.c
index 1ea5f22..06eb513 100644
--- a/block/dmg.c
+++ b/block/dmg.c
@@ -32,7 +32,6 @@
#ifdef CONFIG_BZIP2
#include <bzlib.h>
#endif
-#include <glib.h>
enum {
/* Limit chunk sizes to prevent unreasonable amounts of memory being used
diff --git a/block/vhdx.c b/block/vhdx.c
index c0d24a2..f5605a2 100644
--- a/block/vhdx.c
+++ b/block/vhdx.c
@@ -27,7 +27,6 @@
#include "migration/migration.h"
#include <uuid/uuid.h>
-#include <glib.h>
/* Options for VHDX creation */
diff --git a/block/vmdk.c b/block/vmdk.c
index 372e5ed..2205cc8 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -34,7 +34,6 @@
#include "migration/migration.h"
#include "qemu/cutils.h"
#include <zlib.h>
-#include <glib.h>
#define VMDK3_MAGIC (('C' << 24) | ('O' << 16) | ('W' << 8) | 'D')
#define VMDK4_MAGIC (('K' << 24) | ('D' << 16) | ('M' << 8) | 'V')
diff --git a/fsdev/9p-iov-marshal.c b/fsdev/9p-iov-marshal.c
index fb40bdf..fce1ee9 100644
--- a/fsdev/9p-iov-marshal.c
+++ b/fsdev/9p-iov-marshal.c
@@ -12,7 +12,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include <glib/gprintf.h>
#include <utime.h>
#include <sys/uio.h>
diff --git a/fsdev/9p-marshal.c b/fsdev/9p-marshal.c
index 183d366..f56ef0e 100644
--- a/fsdev/9p-marshal.c
+++ b/fsdev/9p-marshal.c
@@ -12,7 +12,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include <glib/gprintf.h>
#include <dirent.h>
#include <utime.h>
diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h
index 1a19418..83cba5f 100644
--- a/hw/9pfs/9p.h
+++ b/hw/9pfs/9p.h
@@ -4,7 +4,6 @@
#include <dirent.h>
#include <utime.h>
#include <sys/resource.h>
-#include <glib.h>
#include "standard-headers/linux/virtio_9p.h"
#include "hw/virtio/virtio.h"
#include "fsdev/file-op-9p.h"
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 279f0d7..d0ffc25 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -23,7 +23,6 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "acpi-build.h"
-#include <glib.h>
#include "qemu-common.h"
#include "qemu/bitmap.h"
#include "qemu/error-report.h"
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 24e7042..a6a6604 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -23,7 +23,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "hw/hw.h"
#include "hw/loader.h"
diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h
index 7eb51c7..0b01376 100644
--- a/include/hw/acpi/aml-build.h
+++ b/include/hw/acpi/aml-build.h
@@ -1,7 +1,6 @@
#ifndef HW_ACPI_GEN_UTILS_H
#define HW_ACPI_GEN_UTILS_H
-#include <glib.h>
#include "hw/acpi/acpi-defs.h"
/* Reserve RAM space for tables: add another order of magnitude. */
diff --git a/include/hw/acpi/bios-linker-loader.h b/include/hw/acpi/bios-linker-loader.h
index 82f1af6..80afcce 100644
--- a/include/hw/acpi/bios-linker-loader.h
+++ b/include/hw/acpi/bios-linker-loader.h
@@ -1,7 +1,6 @@
#ifndef BIOS_LINKER_LOADER_H
#define BIOS_LINKER_LOADER_H
-#include <glib.h>
GArray *bios_linker_loader_init(void);
diff --git a/include/qemu/bitmap.h b/include/qemu/bitmap.h
index 0e33fa5..ec5146f 100644
--- a/include/qemu/bitmap.h
+++ b/include/qemu/bitmap.h
@@ -12,7 +12,6 @@
#ifndef BITMAP_H
#define BITMAP_H
-#include <glib.h>
#include "qemu/bitops.h"
diff --git a/include/qemu/rcu.h b/include/qemu/rcu.h
index 56d3a68..83ae280 100644
--- a/include/qemu/rcu.h
+++ b/include/qemu/rcu.h
@@ -23,7 +23,6 @@
* IBM's contributions to this file may be relicensed under LGPLv2 or later.
*/
-#include <glib.h>
#include "qemu/thread.h"
#include "qemu/queue.h"
diff --git a/include/qom/object.h b/include/qom/object.h
index 21bb5ff..99de539 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -14,7 +14,6 @@
#ifndef QEMU_OBJECT_H
#define QEMU_OBJECT_H
-#include <glib.h>
#include "qapi-types.h"
#include "qemu/queue.h"
diff --git a/include/sysemu/tpm_backend_int.h b/include/sysemu/tpm_backend_int.h
index 40f693a..cc0dcb3 100644
--- a/include/sysemu/tpm_backend_int.h
+++ b/include/sysemu/tpm_backend_int.h
@@ -22,7 +22,6 @@
#ifndef TPM_TPM_BACKEND_H
#define TPM_TPM_BACKEND_H
-#include <glib.h>
typedef struct TPMBackendThread {
GThreadPool *pool;
diff --git a/memory_mapping.c b/memory_mapping.c
index 2354b2b..e3e0d95 100644
--- a/memory_mapping.c
+++ b/memory_mapping.c
@@ -13,7 +13,6 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
-#include <glib.h>
#include "qemu-common.h"
#include "cpu.h"
diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
index cf7dcd2..47250b6 100644
--- a/migration/postcopy-ram.c
+++ b/migration/postcopy-ram.c
@@ -17,7 +17,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu-common.h"
#include "migration/migration.h"
diff --git a/page_cache.c b/page_cache.c
index 37a66e4..a2809db 100644
--- a/page_cache.c
+++ b/page_cache.c
@@ -13,7 +13,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu-common.h"
#include "qemu/host-utils.h"
diff --git a/qapi/qmp-registry.c b/qapi/qmp-registry.c
index 4332a68..68b24c9 100644
--- a/qapi/qmp-registry.c
+++ b/qapi/qmp-registry.c
@@ -13,7 +13,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qapi/qmp/dispatch.h"
static QTAILQ_HEAD(QmpCommandList, QmpCommand) qmp_commands =
diff --git a/qemu-bridge-helper.c b/qemu-bridge-helper.c
index 830fb9e..5396fbf 100644
--- a/qemu-bridge-helper.c
+++ b/qemu-bridge-helper.c
@@ -15,7 +15,6 @@
#include "qemu/osdep.h"
-#include <glib.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
diff --git a/slirp/dnssearch.c b/slirp/dnssearch.c
index aed2f13..4c70a64 100644
--- a/slirp/dnssearch.c
+++ b/slirp/dnssearch.c
@@ -23,7 +23,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "slirp.h"
static const uint8_t RFC3397_OPT_DOMAIN_SEARCH = 119;
diff --git a/slirp/slirp.h b/slirp/slirp.h
index 5df755e..e3641f9 100644
--- a/slirp/slirp.h
+++ b/slirp/slirp.h
@@ -69,7 +69,6 @@ typedef char *caddr_t;
#include <sys/stropts.h>
#endif
-#include <glib.h>
#include "debug.h"
diff --git a/ui/sdl_zoom.c b/ui/sdl_zoom.c
index 72622c2..b96196b 100644
--- a/ui/sdl_zoom.c
+++ b/ui/sdl_zoom.c
@@ -13,7 +13,6 @@
#include "qemu/osdep.h"
#include "sdl_zoom.h"
-#include <glib.h>
static void sdl_zoom_rgb16(SDL_Surface *src, SDL_Surface *dst, int smooth,
SDL_Rect *dst_rect);
diff --git a/ui/vnc-palette.c b/ui/vnc-palette.c
index 3b89d1a..dc7c0ba 100644
--- a/ui/vnc-palette.c
+++ b/ui/vnc-palette.c
@@ -28,7 +28,6 @@
#include "qemu/osdep.h"
#include "vnc-palette.h"
-#include <glib.h>
static VncPaletteEntry *palette_find(const VncPalette *palette,
uint32_t color, unsigned int hash)
diff --git a/util/coroutine-gthread.c b/util/coroutine-gthread.c
index fb697eb..62bfb40 100644
--- a/util/coroutine-gthread.c
+++ b/util/coroutine-gthread.c
@@ -19,7 +19,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu-common.h"
#include "qemu/coroutine_int.h"
diff --git a/util/hbitmap.c b/util/hbitmap.c
index b22b87d..7121b11 100644
--- a/util/hbitmap.c
+++ b/util/hbitmap.c
@@ -10,7 +10,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu/hbitmap.h"
#include "qemu/host-utils.h"
#include "trace.h"
diff --git a/util/memfd.c b/util/memfd.c
index 7c40691..b374238 100644
--- a/util/memfd.c
+++ b/util/memfd.c
@@ -27,7 +27,6 @@
#include "qemu/osdep.h"
-#include <glib.h>
#include <glib/gprintf.h>
#include <sys/mman.h>
diff --git a/util/oslib-win32.c b/util/oslib-win32.c
index c926db4..6debc2b 100644
--- a/util/oslib-win32.c
+++ b/util/oslib-win32.c
@@ -31,7 +31,6 @@
*/
#include "qemu/osdep.h"
#include <windows.h>
-#include <glib.h>
#include "qapi/error.h"
#include "sysemu/sysemu.h"
#include "qemu/main-loop.h"
diff --git a/util/uri.c b/util/uri.c
index d109d6c..70a9cbc 100644
--- a/util/uri.c
+++ b/util/uri.c
@@ -52,7 +52,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qemu/uri.h"
diff --git a/vl.c b/vl.c
index 2f74fe8..fafc7df 100644
--- a/vl.c
+++ b/vl.c
@@ -51,7 +51,6 @@ int main(int argc, char **argv)
#define main qemu_main
#endif /* CONFIG_COCOA */
-#include <glib.h>
#include "qemu/error-report.h"
#include "qemu/sockets.h"
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 32/52] docs/multi-thread-compression: Fix wrong command string
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (30 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 31/52] all: " Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-05 7:43 ` [Qemu-devel] [PULL 33/52] host-utils: Prefer 'false' for bool type Michael Tokarev
` (20 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel; +Cc: Wei Jiangang, qemu-trivial, Michael Tokarev
From: Wei Jiangang <weijg.fnst@cn.fujitsu.com>
s/info_migrate_capabilities/info migrate_capabilities
Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Liang Li <liang.z.li@intel.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
docs/multi-thread-compression.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/multi-thread-compression.txt b/docs/multi-thread-compression.txt
index 3d477c3..d0caaf7 100644
--- a/docs/multi-thread-compression.txt
+++ b/docs/multi-thread-compression.txt
@@ -110,7 +110,7 @@ Usage
=====
1. Verify both the source and destination QEMU are able
to support the multiple thread compression migration:
- {qemu} info_migrate_capabilities
+ {qemu} info migrate_capabilities
{qemu} ... compress: off ...
2. Activate compression on the source:
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 33/52] host-utils: Prefer 'false' for bool type
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (31 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 32/52] docs/multi-thread-compression: Fix wrong command string Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-05 7:43 ` [Qemu-devel] [PULL 34/52] qemu-common.h: Drop WORDS_ALIGNED define Michael Tokarev
` (19 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel; +Cc: Eric Blake, qemu-trivial, Michael Tokarev
From: Eric Blake <eblake@redhat.com>
Mixing '0' and 'bool' looks stupid.
Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
include/qemu/host-utils.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/qemu/host-utils.h b/include/qemu/host-utils.h
index 1cdae0d..3de7d4e 100644
--- a/include/qemu/host-utils.h
+++ b/include/qemu/host-utils.h
@@ -486,7 +486,7 @@ static inline uint64_t revbit64(uint64_t x)
static inline bool is_power_of_2(uint64_t value)
{
if (!value) {
- return 0;
+ return false;
}
return !(value & (value - 1));
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 34/52] qemu-common.h: Drop WORDS_ALIGNED define
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (32 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 33/52] host-utils: Prefer 'false' for bool type Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-05 7:43 ` [Qemu-devel] [PULL 35/52] thunk: Drop unused NO_THUNK_TYPE_SIZE guards Michael Tokarev
` (18 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, qemu-trivial, Michael Tokarev
From: Peter Maydell <peter.maydell@linaro.org>
The WORDS_ALIGNED #define is not used anywhere, and hasn't been since
2013 when commit 612d590ebc6cef rewrote the various ld<type>_<endian>_p
functions to not use it. Remove the #define and the comment describing it.
Also remove the line in the comment about TARGET_WORDS_ALIGNED, since
it has never actually existed.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
include/exec/cpu-all.h | 5 -----
include/qemu-common.h | 4 ----
2 files changed, 9 deletions(-)
diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h
index 3911576..9f38edf 100644
--- a/include/exec/cpu-all.h
+++ b/include/exec/cpu-all.h
@@ -34,14 +34,9 @@
/* some important defines:
*
- * WORDS_ALIGNED : if defined, the host cpu can only make word aligned
- * memory accesses.
- *
* HOST_WORDS_BIGENDIAN : if defined, the host cpu is big endian and
* otherwise little endian.
*
- * (TARGET_WORDS_ALIGNED : same for target cpu (not supported yet))
- *
* TARGET_WORDS_BIGENDIAN : same for target cpu
*/
diff --git a/include/qemu-common.h b/include/qemu-common.h
index 835cbc6..1f2cb94 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -14,10 +14,6 @@
#include "qemu/fprintf-fn.h"
-#if defined(__arm__) || defined(__sparc__) || defined(__mips__) || defined(__hppa__) || defined(__ia64__)
-#define WORDS_ALIGNED
-#endif
-
#define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR)
#include "qemu/option.h"
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 35/52] thunk: Drop unused NO_THUNK_TYPE_SIZE guards
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (33 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 34/52] qemu-common.h: Drop WORDS_ALIGNED define Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-05 7:43 ` [Qemu-devel] [PULL 36/52] thunk: Rename args and fields in host-target bitmask conversion code Michael Tokarev
` (17 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, qemu-trivial, Michael Tokarev
From: Peter Maydell <peter.maydell@linaro.org>
The thunk_type_size_array() and thunk_type_align_array() functions
are only provided if NO_THUNK_TYPE_SIZE is not defined. However
nothing in the codebase defines that, and so in fact these functions
are always present. Drop the unnecessary #ifdefs.
(Over a decade ago thunk.h used to be included by some softmmu
files, which defined NO_THUNK_TYPE_SIZE, but these includes are
long gone; see for instance commit f193c7979c2f7.)
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
include/exec/user/thunk.h | 3 ---
thunk.c | 2 --
2 files changed, 5 deletions(-)
diff --git a/include/exec/user/thunk.h b/include/exec/user/thunk.h
index ad1d602..57eb358 100644
--- a/include/exec/user/thunk.h
+++ b/include/exec/user/thunk.h
@@ -71,7 +71,6 @@ void thunk_register_struct_direct(int id, const char *name,
const StructEntry *se1);
const argtype *thunk_convert(void *dst, const void *src,
const argtype *type_ptr, int to_host);
-#ifndef NO_THUNK_TYPE_SIZE
extern StructEntry *struct_entries;
@@ -178,8 +177,6 @@ static inline int thunk_type_align(const argtype *type_ptr, int is_host)
}
}
-#endif /* NO_THUNK_TYPE_SIZE */
-
unsigned int target_to_host_bitmask(unsigned int x86_mask,
const bitmask_transtbl * trans_tbl);
unsigned int host_to_target_bitmask(unsigned int alpha_mask,
diff --git a/thunk.c b/thunk.c
index f057d86..8aee299 100644
--- a/thunk.c
+++ b/thunk.c
@@ -303,7 +303,6 @@ unsigned int host_to_target_bitmask(unsigned int alpha_mask,
return(x86_mask);
}
-#ifndef NO_THUNK_TYPE_SIZE
int thunk_type_size_array(const argtype *type_ptr, int is_host)
{
return thunk_type_size(type_ptr, is_host);
@@ -313,7 +312,6 @@ int thunk_type_align_array(const argtype *type_ptr, int is_host)
{
return thunk_type_align(type_ptr, is_host);
}
-#endif /* ndef NO_THUNK_TYPE_SIZE */
void thunk_init(unsigned int max_structs)
{
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 36/52] thunk: Rename args and fields in host-target bitmask conversion code
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (34 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 35/52] thunk: Drop unused NO_THUNK_TYPE_SIZE guards Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-05 7:43 ` [Qemu-devel] [PULL 37/52] coccinelle: use macro DIV_ROUND_UP instead of (((n) + (d) - 1) /(d)) Michael Tokarev
` (16 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, qemu-trivial, Michael Tokarev
From: Peter Maydell <peter.maydell@linaro.org>
The target_to_host_bitmask() and host_to_target_bitmask() functions
and the associated struct bitmask_transtbl are completely generic,
but for historical reasons the target related fields and parameters
are named 'x86' and the host related fields are named 'alpha'.
Rename them to 'target' and 'host'.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
include/exec/user/thunk.h | 12 ++++++------
thunk.c | 30 +++++++++++++++---------------
2 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/include/exec/user/thunk.h b/include/exec/user/thunk.h
index 57eb358..f19ef4b 100644
--- a/include/exec/user/thunk.h
+++ b/include/exec/user/thunk.h
@@ -60,10 +60,10 @@ typedef struct {
/* Translation table for bitmasks... */
typedef struct bitmask_transtbl {
- unsigned int x86_mask;
- unsigned int x86_bits;
- unsigned int alpha_mask;
- unsigned int alpha_bits;
+ unsigned int target_mask;
+ unsigned int target_bits;
+ unsigned int host_mask;
+ unsigned int host_bits;
} bitmask_transtbl;
void thunk_register_struct(int id, const char *name, const argtype *types);
@@ -177,9 +177,9 @@ static inline int thunk_type_align(const argtype *type_ptr, int is_host)
}
}
-unsigned int target_to_host_bitmask(unsigned int x86_mask,
+unsigned int target_to_host_bitmask(unsigned int target_mask,
const bitmask_transtbl * trans_tbl);
-unsigned int host_to_target_bitmask(unsigned int alpha_mask,
+unsigned int host_to_target_bitmask(unsigned int host_mask,
const bitmask_transtbl * trans_tbl);
void thunk_init(unsigned int max_structs);
diff --git a/thunk.c b/thunk.c
index 8aee299..2dac366 100644
--- a/thunk.c
+++ b/thunk.c
@@ -273,34 +273,34 @@ const argtype *thunk_convert(void *dst, const void *src,
/* from em86 */
/* Utility function: Table-driven functions to translate bitmasks
- * between X86 and Alpha formats...
+ * between host and target formats
*/
-unsigned int target_to_host_bitmask(unsigned int x86_mask,
+unsigned int target_to_host_bitmask(unsigned int target_mask,
const bitmask_transtbl * trans_tbl)
{
const bitmask_transtbl *btp;
- unsigned int alpha_mask = 0;
+ unsigned int host_mask = 0;
- for(btp = trans_tbl; btp->x86_mask && btp->alpha_mask; btp++) {
- if((x86_mask & btp->x86_mask) == btp->x86_bits) {
- alpha_mask |= btp->alpha_bits;
- }
+ for (btp = trans_tbl; btp->target_mask && btp->host_mask; btp++) {
+ if ((target_mask & btp->target_mask) == btp->target_bits) {
+ host_mask |= btp->host_bits;
+ }
}
- return(alpha_mask);
+ return host_mask;
}
-unsigned int host_to_target_bitmask(unsigned int alpha_mask,
+unsigned int host_to_target_bitmask(unsigned int host_mask,
const bitmask_transtbl * trans_tbl)
{
const bitmask_transtbl *btp;
- unsigned int x86_mask = 0;
+ unsigned int target_mask = 0;
- for(btp = trans_tbl; btp->x86_mask && btp->alpha_mask; btp++) {
- if((alpha_mask & btp->alpha_mask) == btp->alpha_bits) {
- x86_mask |= btp->x86_bits;
- }
+ for (btp = trans_tbl; btp->target_mask && btp->host_mask; btp++) {
+ if ((host_mask & btp->host_mask) == btp->host_bits) {
+ target_mask |= btp->target_bits;
+ }
}
- return(x86_mask);
+ return target_mask;
}
int thunk_type_size_array(const argtype *type_ptr, int is_host)
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 37/52] coccinelle: use macro DIV_ROUND_UP instead of (((n) + (d) - 1) /(d))
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (35 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 36/52] thunk: Rename args and fields in host-target bitmask conversion code Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-05 7:43 ` [Qemu-devel] [PULL 38/52] parallels: Use DIV_ROUND_UP Michael Tokarev
` (15 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel; +Cc: Laurent Vivier, qemu-trivial, Michael Tokarev
From: Laurent Vivier <lvivier@redhat.com>
sample from http://coccinellery.org/
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
scripts/coccinelle/round.cocci | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
create mode 100644 scripts/coccinelle/round.cocci
diff --git a/scripts/coccinelle/round.cocci b/scripts/coccinelle/round.cocci
new file mode 100644
index 0000000..ed06773
--- /dev/null
+++ b/scripts/coccinelle/round.cocci
@@ -0,0 +1,19 @@
+// Use macro DIV_ROUND_UP instead of (((n) + (d) - 1) /(d))
+@@
+expression e1;
+expression e2;
+@@
+(
+- ((e1) + e2 - 1) / (e2)
++ DIV_ROUND_UP(e1,e2)
+|
+- ((e1) + (e2 - 1)) / (e2)
++ DIV_ROUND_UP(e1,e2)
+)
+
+@@
+expression e1;
+expression e2;
+@@
+-(DIV_ROUND_UP(e1,e2))
++DIV_ROUND_UP(e1,e2)
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 38/52] parallels: Use DIV_ROUND_UP
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (36 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 37/52] coccinelle: use macro DIV_ROUND_UP instead of (((n) + (d) - 1) /(d)) Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-05 7:43 ` [Qemu-devel] [PULL 39/52] qcow/qcow2: " Michael Tokarev
` (14 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel; +Cc: Laurent Vivier, qemu-trivial, qemu-block, Michael Tokarev
From: Laurent Vivier <lvivier@redhat.com>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle script
scripts/coccinelle/round.cocci
CC: qemu-block@nongnu.org
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
block/parallels.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/parallels.c b/block/parallels.c
index 99fc0f7..b9b5c6d 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -204,7 +204,7 @@ static int64_t allocate_clusters(BlockDriverState *bs, int64_t sector_num,
return -EINVAL;
}
- to_allocate = (sector_num + *pnum + s->tracks - 1) / s->tracks - idx;
+ to_allocate = DIV_ROUND_UP(sector_num + *pnum, s->tracks) - idx;
space = to_allocate * s->tracks;
if (s->data_end + space > bdrv_getlength(bs->file->bs) >> BDRV_SECTOR_BITS) {
int ret;
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 39/52] qcow/qcow2: Use DIV_ROUND_UP
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (37 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 38/52] parallels: Use DIV_ROUND_UP Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-05 7:43 ` [Qemu-devel] [PULL 40/52] qed: " Michael Tokarev
` (13 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel; +Cc: Laurent Vivier, qemu-trivial, qemu-block, Michael Tokarev
From: Laurent Vivier <lvivier@redhat.com>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle script
scripts/coccinelle/round.cocci
CC: qemu-block@nongnu.org
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
block/qcow.c | 4 ++--
block/qcow2-cluster.c | 4 ++--
block/qcow2-refcount.c | 6 ++----
3 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/block/qcow.c b/block/qcow.c
index cb4bf02..c5cf813 100644
--- a/block/qcow.c
+++ b/block/qcow.c
@@ -868,8 +868,8 @@ static int qcow_create(const char *filename, QemuOpts *opts, Error **errp)
}
tmp = g_malloc0(BDRV_SECTOR_SIZE);
- for (i = 0; i < ((sizeof(uint64_t)*l1_size + BDRV_SECTOR_SIZE - 1)/
- BDRV_SECTOR_SIZE); i++) {
+ for (i = 0; i < DIV_ROUND_UP(sizeof(uint64_t) * l1_size, BDRV_SECTOR_SIZE);
+ i++) {
ret = blk_pwrite(qcow_blk, header_size + BDRV_SECTOR_SIZE * i,
tmp, BDRV_SECTOR_SIZE, 0);
if (ret != BDRV_SECTOR_SIZE) {
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index 892e0fb..c737973 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -1868,8 +1868,8 @@ int qcow2_expand_zero_clusters(BlockDriverState *bs,
}
for (i = 0; i < s->nb_snapshots; i++) {
- int l1_sectors = (s->snapshots[i].l1_size * sizeof(uint64_t) +
- BDRV_SECTOR_SIZE - 1) / BDRV_SECTOR_SIZE;
+ int l1_sectors = DIV_ROUND_UP(s->snapshots[i].l1_size *
+ sizeof(uint64_t), BDRV_SECTOR_SIZE);
l1_table = g_realloc(l1_table, l1_sectors * BDRV_SECTOR_SIZE);
diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
index 7fa972a..66f187a 100644
--- a/block/qcow2-refcount.c
+++ b/block/qcow2-refcount.c
@@ -490,14 +490,12 @@ static int alloc_refcount_block(BlockDriverState *bs,
uint64_t table_clusters =
size_to_clusters(s, table_size * sizeof(uint64_t));
blocks_clusters = 1 +
- ((table_clusters + s->refcount_block_size - 1)
- / s->refcount_block_size);
+ DIV_ROUND_UP(table_clusters, s->refcount_block_size);
uint64_t meta_clusters = table_clusters + blocks_clusters;
last_table_size = table_size;
table_size = next_refcount_table_size(s, blocks_used +
- ((meta_clusters + s->refcount_block_size - 1)
- / s->refcount_block_size));
+ DIV_ROUND_UP(meta_clusters, s->refcount_block_size));
} while (last_table_size != table_size);
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 40/52] qed: Use DIV_ROUND_UP
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (38 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 39/52] qcow/qcow2: " Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-05 7:43 ` [Qemu-devel] [PULL 41/52] block: " Michael Tokarev
` (12 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel; +Cc: Laurent Vivier, qemu-trivial, qemu-block, Michael Tokarev
From: Laurent Vivier <lvivier@redhat.com>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle script
scripts/coccinelle/round.cocci
CC: qemu-block@nongnu.org
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
block/qed-check.c | 3 +--
block/qed.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/block/qed-check.c b/block/qed-check.c
index 622f308..dcd4f03 100644
--- a/block/qed-check.c
+++ b/block/qed-check.c
@@ -234,8 +234,7 @@ int qed_check(BDRVQEDState *s, BdrvCheckResult *result, bool fix)
}
check.result->bfi.total_clusters =
- (s->header.image_size + s->header.cluster_size - 1) /
- s->header.cluster_size;
+ DIV_ROUND_UP(s->header.image_size, s->header.cluster_size);
ret = qed_check_l1_table(&check, s->l1_table);
if (ret == 0) {
/* Only check for leaks if entire image was scanned successfully */
diff --git a/block/qed.c b/block/qed.c
index b591d4a..0f62192 100644
--- a/block/qed.c
+++ b/block/qed.c
@@ -143,8 +143,7 @@ static void qed_write_header(BDRVQEDState *s, BlockCompletionFunc cb,
* them, and write back.
*/
- int nsectors = (sizeof(QEDHeader) + BDRV_SECTOR_SIZE - 1) /
- BDRV_SECTOR_SIZE;
+ int nsectors = DIV_ROUND_UP(sizeof(QEDHeader), BDRV_SECTOR_SIZE);
size_t len = nsectors * BDRV_SECTOR_SIZE;
QEDWriteHeaderCB *write_header_cb = gencb_alloc(sizeof(*write_header_cb),
cb, opaque);
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 41/52] block: Use DIV_ROUND_UP
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (39 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 40/52] qed: " Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-05 7:43 ` [Qemu-devel] [PULL 42/52] crypto: " Michael Tokarev
` (11 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel; +Cc: Laurent Vivier, qemu-trivial, qemu-block, Michael Tokarev
From: Laurent Vivier <lvivier@redhat.com>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle script
scripts/coccinelle/round.cocci
CC: qemu-block@nongnu.org
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
block/vvfat.c | 3 +--
hw/block/tc58128.c | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/block/vvfat.c b/block/vvfat.c
index a39dbe6..6d2e21c 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -1960,8 +1960,7 @@ DLOG(fprintf(stderr, "check direntry %d:\n", i); print_direntry(direntries + i))
/* check file size with FAT */
cluster_count = get_cluster_count_for_direntry(s, direntries + i, path2);
if (cluster_count !=
- (le32_to_cpu(direntries[i].size) + s->cluster_size
- - 1) / s->cluster_size) {
+ DIV_ROUND_UP(le32_to_cpu(direntries[i].size), s->cluster_size)) {
DLOG(fprintf(stderr, "Cluster count mismatch\n"));
goto fail;
}
diff --git a/hw/block/tc58128.c b/hw/block/tc58128.c
index 7909d50..1d9f7ee 100644
--- a/hw/block/tc58128.c
+++ b/hw/block/tc58128.c
@@ -45,7 +45,7 @@ static void init_dev(tc58128_dev * dev, const char *filename)
}
} else {
/* Build first block with number of blocks */
- blocks = (ret + 528 * 32 - 1) / (528 * 32);
+ blocks = DIV_ROUND_UP(ret, 528 * 32);
dev->flash_contents[0] = blocks & 0xff;
dev->flash_contents[1] = (blocks >> 8) & 0xff;
dev->flash_contents[2] = (blocks >> 16) & 0xff;
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 42/52] crypto: Use DIV_ROUND_UP
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (40 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 41/52] block: " Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-05 7:43 ` [Qemu-devel] [PULL 43/52] xen: " Michael Tokarev
` (10 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel
Cc: Laurent Vivier, qemu-trivial, Daniel P. Berrange, Michael Tokarev
From: Laurent Vivier <lvivier@redhat.com>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle script
scripts/coccinelle/round.cocci
CC: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
crypto/block-luks.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/crypto/block-luks.c b/crypto/block-luks.c
index 17c4300..63649f1 100644
--- a/crypto/block-luks.c
+++ b/crypto/block-luks.c
@@ -1081,8 +1081,7 @@ qcrypto_block_luks_create(QCryptoBlock *block,
luks->header.key_slots[i].key_offset =
(QCRYPTO_BLOCK_LUKS_KEY_SLOT_OFFSET /
QCRYPTO_BLOCK_LUKS_SECTOR_SIZE) +
- (ROUND_UP(((splitkeylen + (QCRYPTO_BLOCK_LUKS_SECTOR_SIZE - 1)) /
- QCRYPTO_BLOCK_LUKS_SECTOR_SIZE),
+ (ROUND_UP(DIV_ROUND_UP(splitkeylen, QCRYPTO_BLOCK_LUKS_SECTOR_SIZE),
(QCRYPTO_BLOCK_LUKS_KEY_SLOT_OFFSET /
QCRYPTO_BLOCK_LUKS_SECTOR_SIZE)) * i);
}
@@ -1182,8 +1181,7 @@ qcrypto_block_luks_create(QCryptoBlock *block,
luks->header.payload_offset =
(QCRYPTO_BLOCK_LUKS_KEY_SLOT_OFFSET /
QCRYPTO_BLOCK_LUKS_SECTOR_SIZE) +
- (ROUND_UP(((splitkeylen + (QCRYPTO_BLOCK_LUKS_SECTOR_SIZE - 1)) /
- QCRYPTO_BLOCK_LUKS_SECTOR_SIZE),
+ (ROUND_UP(DIV_ROUND_UP(splitkeylen, QCRYPTO_BLOCK_LUKS_SECTOR_SIZE),
(QCRYPTO_BLOCK_LUKS_KEY_SLOT_OFFSET /
QCRYPTO_BLOCK_LUKS_SECTOR_SIZE)) *
QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS);
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 43/52] xen: Use DIV_ROUND_UP
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (41 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 42/52] crypto: " Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-05 7:43 ` [Qemu-devel] [PULL 44/52] audio: " Michael Tokarev
` (9 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel
Cc: Laurent Vivier, qemu-trivial, Stefano Stabellini, Michael Tokarev
From: Laurent Vivier <lvivier@redhat.com>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle script
scripts/coccinelle/round.cocci
CC: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/display/xenfb.c | 4 ++--
xen-hvm.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index 9866dfd..570b097 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -472,9 +472,9 @@ static int xenfb_map_fb(struct XenFB *xenfb)
xenfb->pixels = NULL;
}
- xenfb->fbpages = (xenfb->fb_len + (XC_PAGE_SIZE - 1)) / XC_PAGE_SIZE;
+ xenfb->fbpages = DIV_ROUND_UP(xenfb->fb_len, XC_PAGE_SIZE);
n_fbdirs = xenfb->fbpages * mode / 8;
- n_fbdirs = (n_fbdirs + (XC_PAGE_SIZE - 1)) / XC_PAGE_SIZE;
+ n_fbdirs = DIV_ROUND_UP(n_fbdirs, XC_PAGE_SIZE);
pgmfns = g_malloc0(sizeof(xen_pfn_t) * n_fbdirs);
fbmfns = g_malloc0(sizeof(xen_pfn_t) * xenfb->fbpages);
diff --git a/xen-hvm.c b/xen-hvm.c
index 01ee25d..a0da8d7 100644
--- a/xen-hvm.c
+++ b/xen-hvm.c
@@ -567,7 +567,7 @@ static void xen_sync_dirty_bitmap(XenIOState *state,
{
hwaddr npages = size >> TARGET_PAGE_BITS;
const int width = sizeof(unsigned long) * 8;
- unsigned long bitmap[(npages + width - 1) / width];
+ unsigned long bitmap[DIV_ROUND_UP(npages, width)];
int rc, i, j;
const XenPhysmap *physmap = NULL;
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 44/52] audio: Use DIV_ROUND_UP
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (42 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 43/52] xen: " Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-05 7:43 ` [Qemu-devel] [PULL 45/52] SPICE: " Michael Tokarev
` (8 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel; +Cc: Laurent Vivier, qemu-trivial, Gerd Hoffmann, Michael Tokarev
From: Laurent Vivier <lvivier@redhat.com>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle script
scripts/coccinelle/round.cocci
CC: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/audio/pcspk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c
index f9afc8e..d259960 100644
--- a/hw/audio/pcspk.c
+++ b/hw/audio/pcspk.c
@@ -35,7 +35,7 @@
#define PCSPK_BUF_LEN 1792
#define PCSPK_SAMPLE_RATE 32000
#define PCSPK_MAX_FREQ (PCSPK_SAMPLE_RATE >> 1)
-#define PCSPK_MIN_COUNT ((PIT_FREQ + PCSPK_MAX_FREQ - 1) / PCSPK_MAX_FREQ)
+#define PCSPK_MIN_COUNT DIV_ROUND_UP(PIT_FREQ, PCSPK_MAX_FREQ)
#define PC_SPEAKER(obj) OBJECT_CHECK(PCSpkState, (obj), TYPE_PC_SPEAKER)
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 45/52] SPICE: Use DIV_ROUND_UP
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (43 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 44/52] audio: " Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-05 7:43 ` [Qemu-devel] [PULL 46/52] rocker: " Michael Tokarev
` (7 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel; +Cc: Laurent Vivier, qemu-trivial, Gerd Hoffmann, Michael Tokarev
From: Laurent Vivier <lvivier@redhat.com>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle script
scripts/coccinelle/round.cocci
CC: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
ui/spice-display.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/spice-display.c b/ui/spice-display.c
index 0553c5e..34095fb 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -197,7 +197,7 @@ static void qemu_spice_create_one_update(SimpleSpiceDisplay *ssd,
static void qemu_spice_create_update(SimpleSpiceDisplay *ssd)
{
static const int blksize = 32;
- int blocks = (surface_width(ssd->ds) + blksize - 1) / blksize;
+ int blocks = DIV_ROUND_UP(surface_width(ssd->ds), blksize);
int dirty_top[blocks];
int y, yoff1, yoff2, x, xoff, blk, bw;
int bpp = surface_bytes_per_pixel(ssd->ds);
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 46/52] rocker: Use DIV_ROUND_UP
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (44 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 45/52] SPICE: " Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-05 7:43 ` [Qemu-devel] [PULL 47/52] usb: " Michael Tokarev
` (6 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel; +Cc: Laurent Vivier, qemu-trivial, Scott Feldman, Michael Tokarev
From: Laurent Vivier <lvivier@redhat.com>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle script
scripts/coccinelle/round.cocci
CC: Scott Feldman <sfeldma@gmail.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/net/rocker/rocker_of_dpa.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/hw/net/rocker/rocker_of_dpa.c b/hw/net/rocker/rocker_of_dpa.c
index 0a134eb..9b1e0d2 100644
--- a/hw/net/rocker/rocker_of_dpa.c
+++ b/hw/net/rocker/rocker_of_dpa.c
@@ -103,9 +103,8 @@ typedef struct of_dpa_flow_key {
/* Width of key which includes field 'f' in u64s, rounded up */
#define FLOW_KEY_WIDTH(f) \
- ((offsetof(OfDpaFlowKey, f) + \
- sizeof(((OfDpaFlowKey *)0)->f) + \
- sizeof(uint64_t) - 1) / sizeof(uint64_t))
+ DIV_ROUND_UP(offsetof(OfDpaFlowKey, f) + sizeof(((OfDpaFlowKey *)0)->f), \
+ sizeof(uint64_t))
typedef struct of_dpa_flow_action {
uint32_t goto_tbl;
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 47/52] usb: Use DIV_ROUND_UP
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (45 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 46/52] rocker: " Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-05 7:43 ` [Qemu-devel] [PULL 48/52] slirp: " Michael Tokarev
` (5 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel; +Cc: Laurent Vivier, qemu-trivial, Gerd Hoffmann, Michael Tokarev
From: Laurent Vivier <lvivier@redhat.com>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle script
scripts/coccinelle/round.cocci
CC: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/usb/redirect.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index 8d80540..8ec8484 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -542,9 +542,9 @@ static void usbredir_handle_iso_data(USBRedirDevice *dev, USBPacket *p,
start_iso.pkts_per_urb = 32;
}
- start_iso.no_urbs = (dev->endpoint[EP2I(ep)].bufpq_target_size +
- start_iso.pkts_per_urb - 1) /
- start_iso.pkts_per_urb;
+ start_iso.no_urbs = DIV_ROUND_UP(
+ dev->endpoint[EP2I(ep)].bufpq_target_size,
+ start_iso.pkts_per_urb);
/* Output endpoints pre-fill only 1/2 of the packets, keeping the rest
as overflow buffer. Also see the usbredir protocol documentation */
if (!(ep & USB_DIR_IN)) {
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 48/52] slirp: Use DIV_ROUND_UP
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (46 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 47/52] usb: " Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-05 7:43 ` [Qemu-devel] [PULL 49/52] linux-user: " Michael Tokarev
` (4 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel; +Cc: Laurent Vivier, qemu-trivial, Samuel Thibault, Michael Tokarev
From: Laurent Vivier <lvivier@redhat.com>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle script
scripts/coccinelle/round.cocci
CC: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
slirp/dnssearch.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/slirp/dnssearch.c b/slirp/dnssearch.c
index 4c70a64..8fb5633 100644
--- a/slirp/dnssearch.c
+++ b/slirp/dnssearch.c
@@ -261,7 +261,7 @@ int translate_dnssearch(Slirp *s, const char **names)
}
/* reserve extra 2 header bytes for each 255 bytes of output */
- memreq += ((memreq + MAX_OPT_LEN - 1) / MAX_OPT_LEN) * OPT_HEADER_LEN;
+ memreq += DIV_ROUND_UP(memreq, MAX_OPT_LEN) * OPT_HEADER_LEN;
result = g_malloc(memreq * sizeof(*result));
outptr = result;
@@ -288,7 +288,7 @@ int translate_dnssearch(Slirp *s, const char **names)
domain_mkxrefs(domains, domains + num_domains - 1, 0);
memreq = domain_compactify(domains, num_domains);
- blocks = (memreq + MAX_OPT_LEN - 1) / MAX_OPT_LEN;
+ blocks = DIV_ROUND_UP(memreq, MAX_OPT_LEN);
bsrc_end = memreq;
bsrc_start = (blocks - 1) * MAX_OPT_LEN;
bdst_start = bsrc_start + blocks * OPT_HEADER_LEN;
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 49/52] linux-user: Use DIV_ROUND_UP
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (47 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 48/52] slirp: " Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-05 7:43 ` [Qemu-devel] [PULL 50/52] pc-bios/s390-ccw: " Michael Tokarev
` (3 subsequent siblings)
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel; +Cc: Laurent Vivier, qemu-trivial, Riku Voipio, Michael Tokarev
From: Laurent Vivier <lvivier@redhat.com>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle script
scripts/coccinelle/round.cocci
CC: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
linux-user/syscall.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index df70255..96ec801 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -829,7 +829,7 @@ static inline abi_long copy_from_user_fdset(fd_set *fds,
int i, nw, j, k;
abi_ulong b, *target_fds;
- nw = (n + TARGET_ABI_BITS - 1) / TARGET_ABI_BITS;
+ nw = DIV_ROUND_UP(n, TARGET_ABI_BITS);
if (!(target_fds = lock_user(VERIFY_READ,
target_fds_addr,
sizeof(abi_ulong) * nw,
@@ -876,7 +876,7 @@ static inline abi_long copy_to_user_fdset(abi_ulong target_fds_addr,
abi_long v;
abi_ulong *target_fds;
- nw = (n + TARGET_ABI_BITS - 1) / TARGET_ABI_BITS;
+ nw = DIV_ROUND_UP(n, TARGET_ABI_BITS);
if (!(target_fds = lock_user(VERIFY_WRITE,
target_fds_addr,
sizeof(abi_ulong) * nw,
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 50/52] pc-bios/s390-ccw: Use DIV_ROUND_UP
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (48 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 49/52] linux-user: " Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-06 13:17 ` Laurent Vivier
2016-06-05 7:43 ` [Qemu-devel] [PULL 51/52] qemu-timer: " Michael Tokarev
` (2 subsequent siblings)
52 siblings, 1 reply; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel; +Cc: Laurent Vivier, qemu-trivial, Cornelia Huck, Michael Tokarev
From: Laurent Vivier <lvivier@redhat.com>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle script
scripts/coccinelle/round.cocci
CC: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
pc-bios/s390-ccw/bootmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c
index 611102e..ecdc52d 100644
--- a/pc-bios/s390-ccw/bootmap.c
+++ b/pc-bios/s390-ccw/bootmap.c
@@ -599,7 +599,7 @@ static void load_iso_bc_entry(IsoBcSection *load)
if (real_size) {
/* Round up blocks to load */
- blks_to_load = (real_size + ISO_SECTOR_SIZE - 1) / ISO_SECTOR_SIZE;
+ blks_to_load = DIV_ROUND_UP(real_size, ISO_SECTOR_SIZE);
sclp_print("ISO boot image size verified\n");
} else {
sclp_print("ISO boot image size could not be verified\n");
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* Re: [Qemu-devel] [PULL 50/52] pc-bios/s390-ccw: Use DIV_ROUND_UP
2016-06-05 7:43 ` [Qemu-devel] [PULL 50/52] pc-bios/s390-ccw: " Michael Tokarev
@ 2016-06-06 13:17 ` Laurent Vivier
2016-06-07 15:07 ` Michael Tokarev
0 siblings, 1 reply; 60+ messages in thread
From: Laurent Vivier @ 2016-06-06 13:17 UTC (permalink / raw)
To: Michael Tokarev, qemu-devel; +Cc: qemu-trivial, Cornelia Huck
On 05/06/2016 09:43, Michael Tokarev wrote:
> From: Laurent Vivier <lvivier@redhat.com>
>
> Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
>
> This patch is the result of coccinelle script
> scripts/coccinelle/round.cocci
>
> CC: Cornelia Huck <cornelia.huck@de.ibm.com>
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
> ---
> pc-bios/s390-ccw/bootmap.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c
> index 611102e..ecdc52d 100644
> --- a/pc-bios/s390-ccw/bootmap.c
> +++ b/pc-bios/s390-ccw/bootmap.c
> @@ -599,7 +599,7 @@ static void load_iso_bc_entry(IsoBcSection *load)
>
> if (real_size) {
> /* Round up blocks to load */
> - blks_to_load = (real_size + ISO_SECTOR_SIZE - 1) / ISO_SECTOR_SIZE;
> + blks_to_load = DIV_ROUND_UP(real_size, ISO_SECTOR_SIZE);
> sclp_print("ISO boot image size verified\n");
> } else {
> sclp_print("ISO boot image size could not be verified\n");
>
I think this one must be dropped from the pull request as s390-ccw files
have no access to the definition of DIV_ROUND_UP.
I missed that because it is not built by default and can only be built
on a s390 system (or with some tricks with a cross-compiler).
Thanks,
Laurent
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [Qemu-devel] [PULL 50/52] pc-bios/s390-ccw: Use DIV_ROUND_UP
2016-06-06 13:17 ` Laurent Vivier
@ 2016-06-07 15:07 ` Michael Tokarev
0 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-07 15:07 UTC (permalink / raw)
To: Laurent Vivier, qemu-devel; +Cc: qemu-trivial, Cornelia Huck
06.06.2016 16:17, Laurent Vivier wrote:
> On 05/06/2016 09:43, Michael Tokarev wrote:
>> From: Laurent Vivier <lvivier@redhat.com>
>>
>> Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
>>
>> This patch is the result of coccinelle script
>> scripts/coccinelle/round.cocci
>>
>> CC: Cornelia Huck <cornelia.huck@de.ibm.com>
>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
>> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
>> ---
>> pc-bios/s390-ccw/bootmap.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c
>> index 611102e..ecdc52d 100644
>> --- a/pc-bios/s390-ccw/bootmap.c
>> +++ b/pc-bios/s390-ccw/bootmap.c
>> @@ -599,7 +599,7 @@ static void load_iso_bc_entry(IsoBcSection *load)
>>
>> if (real_size) {
>> /* Round up blocks to load */
>> - blks_to_load = (real_size + ISO_SECTOR_SIZE - 1) / ISO_SECTOR_SIZE;
>> + blks_to_load = DIV_ROUND_UP(real_size, ISO_SECTOR_SIZE);
>> sclp_print("ISO boot image size verified\n");
>> } else {
>> sclp_print("ISO boot image size could not be verified\n");
>>
>
> I think this one must be dropped from the pull request as s390-ccw files
> have no access to the definition of DIV_ROUND_UP.
Dropped it now, thank you!
/mjt
> I missed that because it is not built by default and can only be built
> on a s390 system (or with some tricks with a cross-compiler).
>
> Thanks,
> Laurent
>
^ permalink raw reply [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 51/52] qemu-timer: Use DIV_ROUND_UP
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (49 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 50/52] pc-bios/s390-ccw: " Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-05 7:43 ` [Qemu-devel] [PULL 52/52] hbitmap: " Michael Tokarev
2016-06-06 9:16 ` [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Peter Maydell
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel; +Cc: Laurent Vivier, qemu-trivial, Paolo Bonzini, Michael Tokarev
From: Laurent Vivier <lvivier@redhat.com>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle script
scripts/coccinelle/round.cocci
CC: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
qemu-timer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qemu-timer.c b/qemu-timer.c
index 4441fe6..eb22e92 100644
--- a/qemu-timer.c
+++ b/qemu-timer.c
@@ -292,7 +292,7 @@ int qemu_timeout_ns_to_ms(int64_t ns)
/* Always round up, because it's better to wait too long than to wait too
* little and effectively busy-wait
*/
- ms = (ns + SCALE_MS - 1) / SCALE_MS;
+ ms = DIV_ROUND_UP(ns, SCALE_MS);
/* To avoid overflow problems, limit this to 2^31, i.e. approx 25 days */
if (ms > (int64_t) INT32_MAX) {
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* [Qemu-devel] [PULL 52/52] hbitmap: Use DIV_ROUND_UP
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (50 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 51/52] qemu-timer: " Michael Tokarev
@ 2016-06-05 7:43 ` Michael Tokarev
2016-06-06 9:16 ` [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Peter Maydell
52 siblings, 0 replies; 60+ messages in thread
From: Michael Tokarev @ 2016-06-05 7:43 UTC (permalink / raw)
To: qemu-devel; +Cc: Laurent Vivier, qemu-trivial, Paolo Bonzini, Michael Tokarev
From: Laurent Vivier <lvivier@redhat.com>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle script
scripts/coccinelle/round.cocci
CC: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
tests/test-hbitmap.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/test-hbitmap.c b/tests/test-hbitmap.c
index 71d0098..c0e9895 100644
--- a/tests/test-hbitmap.c
+++ b/tests/test-hbitmap.c
@@ -79,7 +79,7 @@ static void hbitmap_test_init(TestHBitmapData *data,
size_t n;
data->hb = hbitmap_alloc(size, granularity);
- n = (size + BITS_PER_LONG - 1) / BITS_PER_LONG;
+ n = DIV_ROUND_UP(size, BITS_PER_LONG);
if (n == 0) {
n = 1;
}
@@ -93,7 +93,7 @@ static void hbitmap_test_init(TestHBitmapData *data,
static inline size_t hbitmap_test_array_size(size_t bits)
{
- size_t n = (bits + BITS_PER_LONG - 1) / BITS_PER_LONG;
+ size_t n = DIV_ROUND_UP(bits, BITS_PER_LONG);
return n ? n : 1;
}
@@ -185,7 +185,7 @@ static void hbitmap_test_reset_all(TestHBitmapData *data)
hbitmap_reset_all(data->hb);
- n = (data->size + BITS_PER_LONG - 1) / BITS_PER_LONG;
+ n = DIV_ROUND_UP(data->size, BITS_PER_LONG);
if (n == 0) {
n = 1;
}
--
2.1.4
^ permalink raw reply related [flat|nested] 60+ messages in thread
* Re: [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05
2016-06-05 7:42 [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Michael Tokarev
` (51 preceding siblings ...)
2016-06-05 7:43 ` [Qemu-devel] [PULL 52/52] hbitmap: " Michael Tokarev
@ 2016-06-06 9:16 ` Peter Maydell
2016-06-06 11:12 ` [Qemu-devel] [PATCH v3] Fix linking relocatable objects on Sparc James Clarke
52 siblings, 1 reply; 60+ messages in thread
From: Peter Maydell @ 2016-06-06 9:16 UTC (permalink / raw)
To: Michael Tokarev; +Cc: QEMU Developers, QEMU Trivial, James Clarke
On 5 June 2016 at 08:42, Michael Tokarev <mjt@tls.msk.ru> wrote:
> This is a big pile of patches collected in -trivial queue
> for quite a while. I was busy with other stuff in recent
> months, now am trying to catch up. This is the result,
> with everything all over. Please consider pulling.
>
> /mjt
>
> The following changes since commit 6b3532b20b787cbd697a68b383232f5c3b39bd1e:
>
> Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20160603-1' into staging (2016-06-03 12:03:36 +0100)
>
> are available in the git repository at:
>
> git://git.corpit.ru/qemu.git tags/pull-trivial-patches-2016-06-05
>
> for you to fetch changes up to 275757ac23428a641983200805bedee8f7b96793:
>
> hbitmap: Use DIV_ROUND_UP (2016-06-05 10:10:48 +0300)
>
> ----------------------------------------------------------------
> trivial patches for 2016-06-05
>
> ----------------------------------------------------------------
Hi. I'm afraid this fails to configure on at least some platforms:
GEN qemu-options.def
ERROR: configure test passed without -Werror but failed with -Werror.
This is probably a bug in the configure script. The failing command
will be at the bottom of config.log.
You can run configure with --disable-werror to bypass this check.
Tail end of config.log is:
cc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings
-Wmissing-prototypes -fno-strict-aliasing -fno-common -Wendif-labels
-Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security
-Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration
-Wold-style-definition -Wtype-limits -fstack-protector-all
-I/usr/include/p11-kit-1 -I/usr/include/libpng12
-I/usr/include/libusb-1.0 -o config-temp/qemu-conf.exe
config-temp/qemu-conf.c -g -nostdlib -Wl,-r -Wl,--no-relax
config-temp/qemu-conf.c:1:5: warning: no previous prototype for 'foo'
[-Wmissing-prototypes]
int foo(void) { return 0; }
^
cc -Werror -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings
-Wmissing-prototypes -fno-strict-aliasing -fno-common -Wendif-labels
-Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security
-Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration
-Wold-style-definition -Wtype-limits -fstack-protector-all
-I/usr/include/p11-kit-1 -I/usr/include/libpng12
-I/usr/include/libusb-1.0 -o config-temp/qemu-conf.exe
config-temp/qemu-conf.c -g -nostdlib -Wl,-r -Wl,--no-relax
config-temp/qemu-conf.c:1:5: error: no previous prototype for 'foo'
[-Werror=missing-prototypes]
int foo(void) { return 0; }
^
I think the problem commit is 'Fix linking relocatable objects on Sparc',
which adds a configure test that attempts to build an executable using
something that's not a valid C program (it has no 'main' function, for
instance, though that's not why the error here.)
thanks
-- PMM
^ permalink raw reply [flat|nested] 60+ messages in thread
* [Qemu-devel] [PATCH v3] Fix linking relocatable objects on Sparc
2016-06-06 9:16 ` [Qemu-devel] [PULL 00/52] Trivial patches for 2016-06-05 Peter Maydell
@ 2016-06-06 11:12 ` James Clarke
0 siblings, 0 replies; 60+ messages in thread
From: James Clarke @ 2016-06-06 11:12 UTC (permalink / raw)
To: Peter Maydell; +Cc: Michael Tokarev, QEMU Developers, QEMU Trivial
On Sparc, gcc implicitly passes --relax to the linker, but -r is
incompatible with this. Therefore, if --no-relax is supported, it should
be passed to the linker.
Signed-off-by: James Clarke <jrtc27@jrtc27.com>
---
Hi Peter,
Sorry about that, I wasn't building in a git repository, so werror was
set to no (I was unaware of the configure script doing so). I have now
tested it with werror enabled, and it works (and could reproduce the
error with the previous version).
I reworked the test slightly to mirror what the Makefile rules actually
do, as trying to combine the compilation and ld -r steps doesn't work
when CLFAGS contains -pie, which was leading to x86_64 believing that
--no-relax was not a valid option.
I also accidentally included a whitespace change in v2; sorry for the
noise.
Regards,
James
configure | 21 +++++++++++++++++++++
rules.mak | 2 +-
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index b5aab72..70237b0 100755
--- a/configure
+++ b/configure
@@ -31,6 +31,7 @@ TMPCXX="${TMPDIR1}/${TMPB}.cxx"
TMPL="${TMPDIR1}/${TMPB}.lo"
TMPA="${TMPDIR1}/lib${TMPB}.la"
TMPE="${TMPDIR1}/${TMPB}.exe"
+TMPMO="${TMPDIR1}/${TMPB}.mo"
rm -f config.log
@@ -4526,6 +4527,25 @@ if compile_prog "" "" ; then
have_fsxattr=yes
fi
+#################################################
+# Sparc implicitly links with --relax, which is
+# incompatible with -r, so --no-relax should be
+# given. It does no harm to give it on other
+# platforms too.
+
+# Note: the prototype is needed since QEMU_CFLAGS
+# contains -Wmissing-prototypes
+cat > $TMPC << EOF
+extern int foo(void);
+int foo(void) { return 0; }
+EOF
+if ! compile_object ""; then
+ error_exit "Failed to compile object file for LD_REL_FLAGS test"
+fi
+if do_cc -nostdlib -Wl,-r -Wl,--no-relax -o $TMPMO $TMPO; then
+ LD_REL_FLAGS="-Wl,--no-relax"
+fi
+
##########################################
# End of CC checks
# After here, no more $cc or $ld runs
@@ -5529,6 +5549,7 @@ else
fi
echo "LDFLAGS=$LDFLAGS" >> $config_host_mak
echo "LDFLAGS_NOPIE=$LDFLAGS_NOPIE" >> $config_host_mak
+echo "LD_REL_FLAGS=$LD_REL_FLAGS" >> $config_host_mak
echo "LIBS+=$LIBS" >> $config_host_mak
echo "LIBS_TOOLS+=$libs_tools" >> $config_host_mak
echo "EXESUF=$EXESUF" >> $config_host_mak
diff --git a/rules.mak b/rules.mak
index 4a8f464..dca5718 100644
--- a/rules.mak
+++ b/rules.mak
@@ -95,7 +95,7 @@ module-common.o: CFLAGS += $(DSO_OBJ_CFLAGS)
$(if $(findstring /,$@),$(call quiet-command,cp $@ $(subst /,-,$@), " CP $(subst /,-,$@)"))
-LD_REL := $(CC) -nostdlib -Wl,-r
+LD_REL := $(CC) -nostdlib -Wl,-r $(LD_REL_FLAGS)
%.mo:
$(call quiet-command,$(LD_REL) -o $@ $^," LD -r $(TARGET_DIR)$@")
--
2.8.3
^ permalink raw reply related [flat|nested] 60+ messages in thread