Trivial patches for 2016-06-05
Subsystems (6)
[Qemu-devel] [PULL 06/52] target-moxie: Remove unused struct elements
In reply to Michael TokarevFrom: Stefan Weil <[email protected]>
--- target-moxie/mmu.h | 5 ----- 1 file changed, 5 deletions(-)
target-moxie/mmu.h +0 -5
@@ -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 ;
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 11/52] remove useless muldiv64()
In reply to Michael TokarevFrom: Laurent Vivier <[email protected]>
muldiv64(a, 1, b) is like "a / b".
This patch is the result of coccinelle scriptscripts/coccinelle/remove_muldiv64.cocci.
--- hw/usb/hcd-ohci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/usb/hcd-ohci.c +1 -1
@@ -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;
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 09/52] scripts: add muldiv64() checking coccinelle scripts
In reply to Michael TokarevFrom: Laurent Vivier <[email protected]>
--- 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
scripts/coccinelle/overflow_muldiv64.cocci new file +16 -0
@@ -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)
scripts/coccinelle/remove_muldiv64.cocci new file +6 -0
@@ -0,0 +1,6 @@ +// replace muldiv64(a, 1, b) by "a / b" +@@ +expression a, b; +@@ +-muldiv64(a, 1, b) ++a / b
scripts/coccinelle/simplify_muldiv64.cocci new file +11 -0
@@ -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
scripts/coccinelle/swap_muldiv64.cocci new file +13 -0
@@ -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)
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 10/52] The only 64bit parameter of muldiv64() is the first one.
In reply to Michael TokarevFrom: Laurent Vivier <[email protected]>
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.
--- hw/timer/omap_gptimer.c | 4 ++-- hw/usb/hcd-ohci.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
hw/timer/omap_gptimer.c +2 -2
@@ -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);
hw/usb/hcd-ohci.c +1 -1
@@ -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;
Signature · 1 line
2.1.4
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
----------------------------------------------------------------
Alberto Garcia (1):
docs: Fix a couple of typos in throttle.txt
Cao jin (3):
ICH9: fix typo
qdev: Clean up around properties
fw_cfg: follow CODING_STYLE
Eric Blake (2):
monitor: Typo fix
host-utils: Prefer 'false' for bool type
Igor Mammedov (1):
pc: cleanup unused struct PcRomPciInfo
James Clarke (1):
Fix linking relocatable objects on Sparc
Jan Vesely (1):
po/Makefile: call rm -f directly
Laurent Vivier (21):
scripts: add muldiv64() checking coccinelle scripts
The only 64bit parameter of muldiv64() is the first one. remove useless muldiv64()
replace muldiv64(a, b, c) by (uint64_t)a * b / c
ppc: Remove a potential overflow in muldiv64()
coccinelle: use macro DIV_ROUND_UP instead of (((n) + (d) - 1) /(d))
parallels: Use DIV_ROUND_UP
qcow/qcow2: Use DIV_ROUND_UP
qed: Use DIV_ROUND_UP
block: Use DIV_ROUND_UP
crypto: Use DIV_ROUND_UP
xen: Use DIV_ROUND_UP
audio: Use DIV_ROUND_UP
SPICE: Use DIV_ROUND_UP
rocker: Use DIV_ROUND_UP
usb: Use DIV_ROUND_UP
slirp: Use DIV_ROUND_UP
linux-user: Use DIV_ROUND_UP
pc-bios/s390-ccw: Use DIV_ROUND_UP
qemu-timer: Use DIV_ROUND_UP
hbitmap: Use DIV_ROUND_UP
Michael Tokarev (5):
s390x/virtio-ccw: fix spelling
hw/ipmi: fix spelling
docs: "specify" spell fix
qga: spelling fix
fsdev: spelling fix
Peter Maydell (10):
qemu-options.hx: Specify the units for -machine kvm_shadow_mem
replay: Clean up includes
hw: Clean up includes
clean-includes: Add glib.h to list of unneeded includes
tests: Remove unnecessary glib.h includes
qga: Remove unnecessary glib.h includes
all: Remove unnecessary glib.h includes
qemu-common.h: Drop WORDS_ALIGNED define
thunk: Drop unused NO_THUNK_TYPE_SIZE guards
thunk: Rename args and fields in host-target bitmask conversion code
Peter Wu (1):
gdbstub: set listen backlog to 1
Sameeh Jubran (1):
e1000: Removing unnecessary if statement
Stefan Weil (3):
target-moxie: Remove unused struct elements
configure: Use $(..) instead of deprecated `..`
scripts: Use $(..) instead of deprecated `..`Steven Luo (1):
Fix configure test for PBKDF2 in nettle
Wei Jiangang (1):
docs/multi-thread-compression: Fix wrong command string
block/dmg.c | 1 - block/parallels.c | 2 +- block/qcow.c | 4 +- block/qcow2-cluster.c | 4 +- block/qcow2-refcount.c | 6 +- block/qed-check.c | 3 +- block/qed.c | 3 +- block/vhdx.c | 1 - block/vmdk.c | 1 - block/vvfat.c | 3 +- configure | 188 ++++++++++++++++------------- crypto/block-luks.c | 6 +- docs/multi-thread-compression.txt | 2 +- docs/qapi-code-gen.txt | 2 +- docs/throttle.txt | 4 +- fsdev/9p-iov-marshal.c | 1 - fsdev/9p-marshal.c | 1 - fsdev/virtfs-proxy-helper.texi | 2 +- gdbstub.c | 2 +- hw/9pfs/9p.h | 1 - hw/audio/gus.c | 2 +- hw/audio/pcspk.c | 2 +- hw/block/tc58128.c | 2 +- hw/core/qdev.c | 30 +++-- hw/display/xenfb.c | 4 +- hw/i386/acpi-build.c | 1 - hw/i386/pc.c | 8 -- hw/i386/pc_piix.c | 1 - hw/intc/aspeed_vic.c | 1 - hw/ipmi/ipmi_bmc_extern.c | 2 +- hw/isa/lpc_ich9.c | 4 +- hw/net/e1000.c | 8 +- hw/net/rocker/rocker_of_dpa.c | 5 +- hw/nvram/fw_cfg.c | 17 ++- hw/ppc/ppc.c | 2 +- hw/s390x/virtio-ccw.c | 2 +- hw/timer/mc146818rtc.c | 1 - hw/timer/omap_gptimer.c | 4 +- hw/usb/hcd-ohci.c | 2 +- hw/usb/redirect.c | 6 +- hw/xtensa/pic_cpu.c | 4 +- include/exec/cpu-all.h | 5 - include/exec/hwaddr.h | 1 - include/exec/user/thunk.h | 15 +-- include/hw/acpi/aml-build.h | 1 - include/hw/acpi/bios-linker-loader.h | 1 - include/hw/i386/ich9.h | 4 +- include/hw/qdev-properties.h | 10 +- include/qemu-common.h | 4 - include/qemu/bitmap.h | 1 - include/qemu/fifo32.h | 1 - include/qemu/host-utils.h | 2 +- include/qemu/rcu.h | 1 - include/qom/object.h | 1 - include/sysemu/tpm_backend_int.h | 1 - linux-user/syscall.c | 4 +- memory_mapping.c | 1 - migration/postcopy-ram.c | 1 - monitor.c | 2 +- page_cache.c | 1 - pc-bios/s390-ccw/bootmap.c | 2 +- po/Makefile | 2 +- qapi/qmp-registry.c | 1 - qemu-bridge-helper.c | 1 - qemu-options.hx | 6 +- qemu-timer.c | 2 +- qga/channel-posix.c | 1 - qga/channel-win32.c | 1 - qga/channel.h | 1 - qga/commands-posix.c | 13 +- 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 - replay/replay-char.c | 4 - rules.mak | 2 +- scripts/clean-includes | 5 +- scripts/coccinelle/overflow_muldiv64.cocci | 16 +++ scripts/coccinelle/remove_muldiv64.cocci | 6 + scripts/coccinelle/round.cocci | 19 +++ scripts/coccinelle/simplify_muldiv64.cocci | 11 ++ scripts/coccinelle/swap_muldiv64.cocci | 13 ++ scripts/create_config | 6 +- scripts/feature_to_c.sh | 6 +- scripts/make_device_config.sh | 4 +- scripts/qemu-binfmt-conf.sh | 2 +- scripts/update-linux-headers.sh | 2 +- slirp/dnssearch.c | 5 +- slirp/slirp.h | 1 - target-moxie/mmu.h | 5 - 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 | 7 +- 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 - thunk.c | 32 +++-- ui/sdl_zoom.c | 1 - ui/spice-display.c | 2 +- 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 - xen-hvm.c | 2 +- 219 files changed, 305 insertions(+), 407 deletions(-) create mode 100644 scripts/coccinelle/overflow_muldiv64.cocci create mode 100644 scripts/coccinelle/remove_muldiv64.cocci create mode 100644 scripts/coccinelle/round.cocci create mode 100644 scripts/coccinelle/simplify_muldiv64.cocci create mode 100644 scripts/coccinelle/swap_muldiv64.cocci
[Qemu-devel] [PULL 08/52] gdbstub: set listen backlog to 1
From: Peter Wu <[email protected]>
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.
--- gdbstub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
gdbstub.c +1 -1
@@ -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);
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 19/52] monitor: Typo fix
In reply to Michael TokarevFrom: Eric Blake <[email protected]>
s/partinal/partial/
--- monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
monitor.c +1 -1
@@ -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;
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 20/52] qdev: Clean up around properties
In reply to Michael TokarevFrom: Cao jin <[email protected]>
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)
--- hw/core/qdev.c | 30 +++++++++++++++++++----------- include/hw/qdev-properties.h | 10 ++++++++-- 2 files changed, 27 insertions(+), 13 deletions(-)
hw/core/qdev.c +19 -11
@@ -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)
include/hw/qdev-properties.h +8 -2
@@ -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);
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 14/52] Fix linking relocatable objects on Sparc
In reply to Michael TokarevFrom: James Clarke <[email protected]>
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.
--- configure | 13 +++++++++++++ rules.mak | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-)
configure +13 -0
@@ -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
rules.mak +1 -1
@@ -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)$@")
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 25/52] Fix configure test for PBKDF2 in nettle
In reply to Michael TokarevFrom: Steven Luo <[email protected]>
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.
--- configure | 1 + 1 file changed, 1 insertion(+)
configure +1 -0
@@ -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);
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 31/52] all: Remove unnecessary glib.h includes
In reply to Michael TokarevFrom: Peter Maydell <[email protected]>
Remove glib.h includes, as it is provided by osdep.h.
This commit was created with scripts/clean-includes.
--- 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(-)
block/dmg.c +0 -1
@@ -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
block/vhdx.c +0 -1
@@ -27,7 +27,6 @@#include "migration/migration.h" #include <uuid/uuid.h> -#include <glib.h> /* Options for VHDX creation */
block/vmdk.c +0 -1
@@ -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')
fsdev/9p-iov-marshal.c +0 -1
@@ -12,7 +12,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include <glib/gprintf.h> #include <utime.h> #include <sys/uio.h>
fsdev/9p-marshal.c +0 -1
@@ -12,7 +12,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include <glib/gprintf.h> #include <dirent.h> #include <utime.h>
hw/9pfs/9p.h +0 -1
@@ -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"
hw/i386/acpi-build.c +0 -1
@@ -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"
hw/i386/pc_piix.c +0 -1
@@ -23,7 +23,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "hw/hw.h" #include "hw/loader.h"
include/hw/acpi/aml-build.h +0 -1
@@ -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. */
include/hw/acpi/bios-linker-loader.h +0 -1
@@ -1,7 +1,6 @@#ifndef BIOS_LINKER_LOADER_H #define BIOS_LINKER_LOADER_H -#include <glib.h> GArray *bios_linker_loader_init (void );
include/qemu/bitmap.h +0 -1
@@ -12,7 +12,6 @@#ifndef BITMAP_H #define BITMAP_H -#include <glib.h> #include "qemu/bitops.h"
include/qemu/rcu.h +0 -1
@@ -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"
include/qom/object.h +0 -1
@@ -14,7 +14,6 @@#ifndef QEMU_OBJECT_H #define QEMU_OBJECT_H -#include <glib.h> #include "qapi-types.h" #include "qemu/queue.h"
include/sysemu/tpm_backend_int.h +0 -1
@@ -22,7 +22,6 @@ #ifndef TPM_TPM_BACKEND_H #define TPM_TPM_BACKEND_H -#include <glib.h> typedef struct TPMBackendThread { GThreadPool *pool;
memory_mapping.c +0 -1
@@ -13,7 +13,6 @@#include "qemu/osdep.h" #include "qapi/error.h" -#include <glib.h> #include "qemu-common.h" #include "cpu.h"
migration/postcopy-ram.c +0 -1
@@ -17,7 +17,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "qemu-common.h" #include "migration/migration.h"
page_cache.c +0 -1
@@ -13,7 +13,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "qemu-common.h" #include "qemu/host-utils.h"
qapi/qmp-registry.c +0 -1
@@ -13,7 +13,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "qapi/qmp/dispatch.h" static QTAILQ_HEAD(QmpCommandList, QmpCommand) qmp_commands =
qemu-bridge-helper.c +0 -1
@@ -15,7 +15,6 @@#include "qemu/osdep.h" -#include <glib.h> #include <sys/ioctl.h> #include <sys/socket.h>
slirp/dnssearch.c +0 -1
@@ -23,7 +23,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "slirp.h" static const uint8_t RFC3397_OPT_DOMAIN_SEARCH =119 ;
slirp/slirp.h +0 -1
@@ -69,7 +69,6 @@ typedef char *caddr_t;#include <sys/stropts.h> #endif -#include <glib.h> #include "debug.h"
ui/sdl_zoom.c +0 -1
@@ -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);
ui/vnc-palette.c +0 -1
@@ -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)
util/coroutine-gthread.c +0 -1
@@ -19,7 +19,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "qemu-common.h" #include "qemu/coroutine_int.h"
util/hbitmap.c +0 -1
@@ -10,7 +10,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "qemu/hbitmap.h" #include "qemu/host-utils.h" #include "trace.h"
util/memfd.c +0 -1
@@ -27,7 +27,6 @@#include "qemu/osdep.h" -#include <glib.h> #include <glib/gprintf.h> #include <sys/mman.h>
util/oslib-win32.c +0 -1
@@ -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"
util/uri.c +0 -1
@@ -52,7 +52,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "qemu/uri.h"
vl.c +0 -1
@@ -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"
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 07/52] po/Makefile: call rm -f directly
In reply to Michael TokarevFrom: Jan Vesely <[email protected]>
Default variables are undefined in rules.mak and this is what the rest of the build system uses.
Fixes make clean in ./po/
--- po/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
po/Makefile +1 -1
@@ -32,7 +32,7 @@ update: $(SRCS) build: $(OBJS) clean: - $(RM) $(OBJS) + rm -f $(OBJS) install: $(OBJS) for obj in $(OBJS); do \
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 50/52] pc-bios/s390-ccw: Use DIV_ROUND_UP
In reply to Michael TokarevFrom: Laurent Vivier <[email protected]>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle scriptscripts/coccinelle/round.cocci
--- pc-bios/s390-ccw/bootmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
pc-bios/s390-ccw/bootmap.c +1 -1
@@ -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" );
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 24/52] docs: Fix a couple of typos in throttle.txt
In reply to Michael TokarevFrom: Alberto Garcia <[email protected]>
--- docs/throttle.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
docs/throttle.txt +2 -2
@@ -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
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 36/52] thunk: Rename args and fields in host-target bitmask conversion code
In reply to Michael TokarevFrom: Peter Maydell <[email protected]>
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'.
--- include/exec/user/thunk.h | 12 ++++++------ thunk.c | 30 +++++++++++++++--------------- 2 files changed, 21 insertions(+), 21 deletions(-)
include/exec/user/thunk.h +6 -6
@@ -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);
thunk.c +15 -15
@@ -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)
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 42/52] crypto: Use DIV_ROUND_UP
In reply to Michael TokarevFrom: Laurent Vivier <[email protected]>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle script scripts/coccinelle/round.cocci
--- crypto/block-luks.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
crypto/block-luks.c +2 -4
@@ -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 );
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 29/52] tests: Remove unnecessary glib.h includes
In reply to Michael TokarevFrom: Peter Maydell <[email protected]>
Remove glib.h includes, as it is provided by osdep.h.
This commit was created with scripts/clean-includes.
--- 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(-)
tests/ac97-test.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" /* Tests only initialization so far. TODO: Replace with functional tests */
tests/ahci-test.c +0 -1
@@ -24,7 +24,6 @@#include "qemu/osdep.h" #include <getopt.h> -#include <glib.h> #include "libqtest.h" #include "libqos/libqos-pc.h"
tests/bios-tables-test.c +0 -1
@@ -11,7 +11,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include <glib/gstdio.h> #include "qemu-common.h" #include "libqtest.h"
tests/boot-order-test.c +0 -1
@@ -11,7 +11,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqos/fw_cfg.h" #include "libqtest.h"
tests/check-qdict.c +0 -1
@@ -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"
tests/check-qfloat.c +0 -1
@@ -11,7 +11,6 @@* */ #include "qemu/osdep.h" -#include <glib.h> #include "qapi/qmp/qfloat.h" #include "qemu-common.h"
tests/check-qint.c +0 -1
@@ -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"
tests/check-qjson.c +0 -1
@@ -11,7 +11,6 @@* */ #include "qemu/osdep.h" -#include <glib.h> #include "qapi/qmp/qstring.h" #include "qapi/qmp/qint.h"
tests/check-qlist.c +0 -1
@@ -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"
tests/check-qnull.c +0 -1
@@ -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"
tests/check-qom-interface.c +0 -1
@@ -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"
tests/check-qom-proplist.c +0 -1
@@ -19,7 +19,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "qapi/error.h" #include "qom/object.h"
tests/check-qstring.c +0 -1
@@ -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"
tests/device-introspect-test.c +0 -1
@@ -18,7 +18,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "qemu-common.h" #include "qapi/qmp/qstring.h" #include "libqtest.h"
tests/display-vga-test.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" static void pci_cirrus (void )
tests/drive_del-test.c +0 -1
@@ -11,7 +11,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" static void drive_add (void )
tests/ds1338-test.c +0 -2
@@ -21,8 +21,6 @@#include "libqtest.h" #include "libqos/i2c.h" -#include <glib.h> -#define IMX25_I2C_0_BASE 0x43F80000#define DS1338_ADDR 0x68
tests/e1000-test.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" /* Tests only initialization so far. TODO: Replace with functional tests */
tests/eepro100-test.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" static void test_device (gconstpointer data)
tests/endianness-test.c +0 -1
@@ -12,7 +12,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" #include "qemu/bswap.h"
tests/es1370-test.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" /* Tests only initialization so far. TODO: Replace with functional tests */
tests/fdc-test.c +0 -1
@@ -24,7 +24,6 @@#include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" #include "qemu-common.h"
tests/fw_cfg-test.c +0 -1
@@ -11,7 +11,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" #include "hw/nvram/fw_cfg_keys.h"
tests/hd-geo-test.c +0 -1
@@ -16,7 +16,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "qemu-common.h" #include "libqtest.h"
tests/i440fx-test.c +0 -1
@@ -13,7 +13,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include <sys/mman.h> #include "libqtest.h"
tests/i82801b11-test.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" /* Tests only initialization so far. TODO: Replace with functional tests */
tests/ide-test.c +0 -1
@@ -24,7 +24,6 @@#include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" #include "libqos/libqos.h"
tests/intel-hda-test.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" #define HDA_ID "hda0"
tests/ioh3420-test.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" /* Tests only initialization so far. TODO: Replace with functional tests */
tests/ipmi-bt-test.c +0 -1
@@ -29,7 +29,6 @@#include <netinet/ip.h> #include <netinet/tcp.h> -#include <glib.h> #include "libqtest.h" #include "qemu-common.h"
tests/ipmi-kcs-test.c +0 -1
@@ -24,7 +24,6 @@#include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h"
tests/ipoctal232-test.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" /* Tests only initialization so far. TODO: Replace with functional tests */
tests/ivshmem-test.c +0 -1
@@ -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"
tests/libqos/ahci.c +0 -1
@@ -23,7 +23,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" #include "libqos/ahci.h"
tests/libqos/fw_cfg.c +0 -1
@@ -13,7 +13,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqos/fw_cfg.h" #include "libqtest.h" #include "qemu/bswap.h"
tests/libqos/i2c-imx.c +0 -1
@@ -20,7 +20,6 @@#include "qemu/osdep.h" #include "libqos/i2c.h" -#include <glib.h> #include "libqtest.h"
tests/libqos/i2c-omap.c +0 -1
@@ -9,7 +9,6 @@#include "qemu/osdep.h" #include "libqos/i2c.h" -#include <glib.h> #include "qemu/bswap.h" #include "libqtest.h"
tests/libqos/libqos.c +0 -1
@@ -1,5 +1,4 @@#include "qemu/osdep.h" -#include <glib.h> #include <sys/wait.h> #include "libqtest.h"
tests/libqos/malloc-generic.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqos/malloc-generic.h" #include "libqos/malloc.h"
tests/libqos/malloc-pc.c +0 -1
@@ -17,7 +17,6 @@#include "hw/nvram/fw_cfg_keys.h" #include "qemu-common.h" -#include <glib.h> #define PAGE_SIZE (4096)
tests/libqos/malloc.c +0 -1
@@ -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;
tests/libqos/pci-pc.c +0 -1
@@ -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
tests/libqos/pci.c +0 -1
@@ -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),
tests/libqos/usb.c +0 -1
@@ -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"
tests/libqos/virtio-mmio.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" #include "libqos/virtio.h" #include "libqos/virtio-mmio.h"
tests/libqos/virtio-pci.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" #include "libqos/virtio.h" #include "libqos/virtio-pci.h"
tests/libqos/virtio.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" #include "libqos/virtio.h"
tests/libqtest.c +0 -1
@@ -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>
tests/m48t59-test.c +0 -1
@@ -13,7 +13,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h"
tests/ne2000-test.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" /* Tests only initialization so far. TODO: Replace with functional tests */
tests/nvme-test.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" /* Tests only initialization so far. TODO: Replace with functional tests */
tests/pc-cpu-test.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "qemu-common.h" #include "libqtest.h"
tests/pcnet-test.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" /* Tests only initialization so far. TODO: Replace with functional tests */
tests/pvpanic-test.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" static void test_panic (void )
tests/pxe-test.c +0 -1
@@ -12,7 +12,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include <glib/gstdio.h> #include "qemu-common.h" #include "libqtest.h"
tests/q35-test.c +0 -1
@@ -10,7 +10,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" #include "libqos/pci.h" #include "libqos/pci-pc.h"
tests/qom-test.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "qemu-common.h" #include "qemu/cutils.h"
tests/rcutorture.c +0 -1
@@ -61,7 +61,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "qemu/atomic.h" #include "qemu/rcu.h" #include "qemu/thread.h"
tests/rtc-test.c +0 -1
@@ -12,7 +12,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" #include "hw/timer/mc146818rtc_regs.h"
tests/rtl8139-test.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" #include "libqos/pci-pc.h" #include "qemu/timer.h"
tests/spapr-phb-test.c +0 -1
@@ -8,7 +8,6 @@* See the COPYING file in the top-level directory. */ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h"
tests/tco-test.c +0 -1
@@ -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"
tests/test-aio.c +0 -1
@@ -11,7 +11,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "block/aio.h" #include "qapi/error.h" #include "qemu/timer.h"
tests/test-base64.c +0 -1
@@ -19,7 +19,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "qapi/error.h" #include "qemu/base64.h"
tests/test-bitops.c +0 -1
@@ -7,7 +7,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "qemu/bitops.h" typedef struct {
tests/test-blockjob-txn.c +0 -1
@@ -11,7 +11,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "qapi/error.h" #include "qemu/main-loop.h" #include "block/blockjob.h"
tests/test-coroutine.c +0 -1
@@ -12,7 +12,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "qemu/coroutine.h" #include "qemu/coroutine_int.h"
tests/test-crypto-cipher.c +0 -1
@@ -19,7 +19,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "crypto/init.h" #include "crypto/cipher.h"
tests/test-crypto-hash.c +0 -1
@@ -19,7 +19,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "crypto/init.h" #include "crypto/hash.h"
tests/test-crypto-secret.c +0 -1
@@ -19,7 +19,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "crypto/init.h" #include "crypto/secret.h"
tests/test-cutils.c +0 -1
@@ -26,7 +26,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "qemu/cutils.h"
tests/test-filter-mirror.c +0 -1
@@ -9,7 +9,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" #include "qemu/iov.h" #include "qemu/sockets.h"
tests/test-filter-redirector.c +0 -1
@@ -51,7 +51,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" #include "qemu/iov.h" #include "qemu/sockets.h"
tests/test-hbitmap.c +0 -1
@@ -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)
tests/test-int128.c +0 -1
@@ -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
tests/test-io-task.c +0 -1
@@ -19,7 +19,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "io/task.h" #include "qapi/error.h"
tests/test-iov.c +0 -1
@@ -1,5 +1,4 @@#include "qemu/osdep.h" -#include <glib.h> #include "qemu-common.h" #include "qemu/iov.h" #include "qemu/sockets.h"
tests/test-logging.c +0 -1
@@ -25,7 +25,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "qemu-common.h" #include "include/qemu/log.h"
tests/test-mul64.c +0 -1
@@ -7,7 +7,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "qemu/host-utils.h"
tests/test-netfilter.c +0 -1
@@ -9,7 +9,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" /* add a netfilter to a netdev and then remove it */
tests/test-opts-visitor.c +0 -1
@@ -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() */
tests/test-qdev-global-props.c +0 -1
@@ -23,7 +23,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "hw/qdev.h" #include "qom/object.h"
tests/test-qemu-opts.c +0 -1
@@ -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" ,
tests/test-qga.c +0 -1
@@ -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>
tests/test-qmp-commands.c +0 -1
@@ -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"
tests/test-qmp-event.c +0 -1
@@ -12,7 +12,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "qemu-common.h" #include "test-qapi-types.h"
tests/test-qmp-input-strict.c +0 -1
@@ -12,7 +12,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "qemu-common.h" #include "qapi/error.h"
tests/test-qmp-input-visitor.c +0 -1
@@ -11,7 +11,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "qemu-common.h" #include "qapi/error.h"
tests/test-qmp-output-visitor.c +0 -1
@@ -11,7 +11,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "qemu-common.h" #include "qapi/error.h"
tests/test-rcu-list.c +0 -1
@@ -21,7 +21,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "qemu/atomic.h" #include "qemu/rcu.h" #include "qemu/thread.h"
tests/test-rfifolock.c +0 -1
@@ -11,7 +11,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "qemu-common.h" #include "qemu/rfifolock.h"
tests/test-string-input-visitor.c +0 -1
@@ -11,7 +11,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "qemu-common.h" #include "qapi/error.h"
tests/test-string-output-visitor.c +0 -1
@@ -11,7 +11,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "qemu-common.h" #include "qapi/error.h"
tests/test-thread-pool.c +0 -1
@@ -1,5 +1,4 @@#include "qemu/osdep.h" -#include <glib.h> #include "qemu-common.h" #include "block/aio.h" #include "block/thread-pool.h"
tests/test-throttle.c +0 -1
@@ -13,7 +13,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include <math.h> #include "block/aio.h" #include "qapi/error.h"
tests/test-timed-average.c +0 -1
@@ -11,7 +11,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "qemu/timed-average.h"
tests/test-visitor-serialization.c +0 -1
@@ -12,7 +12,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include <float.h> #include "qemu-common.h"
tests/test-vmstate.c +0 -1
@@ -23,7 +23,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "qemu-common.h" #include "migration/migration.h"
tests/test-write-threshold.c +0 -1
@@ -7,7 +7,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "block/block_int.h" #include "block/write-threshold.h"
tests/test-x86-cpuid.c +0 -1
@@ -23,7 +23,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "hw/i386/topology.h"
tests/tmp105-test.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" #include "libqos/i2c.h"
tests/tpci200-test.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" /* Tests only initialization so far. TODO: Replace with functional tests */
tests/usb-hcd-ehci-test.c +0 -1
@@ -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"
tests/usb-hcd-ohci-test.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" #include "libqos/usb.h"
tests/usb-hcd-uhci-test.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" #include "libqos/usb.h" #include "hw/usb/uhci-regs.h"
tests/usb-hcd-xhci-test.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" #include "libqos/usb.h"
tests/vhost-user-test.c +0 -1
@@ -9,7 +9,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" #include "qemu/option.h"
tests/virtio-9p-test.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" #include "qemu-common.h"
tests/virtio-balloon-test.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" /* Tests only initialization so far. TODO: Replace with functional tests */
tests/virtio-blk-test.c +0 -1
@@ -9,7 +9,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" #include "libqos/virtio.h" #include "libqos/virtio-pci.h"
tests/virtio-console-test.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" /* Tests only initialization so far. TODO: Replace with functional tests */
tests/virtio-net-test.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" #include "qemu-common.h" #include "qemu/sockets.h"
tests/virtio-rng-test.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" #include "libqos/pci.h"
tests/virtio-scsi-test.c +0 -1
@@ -9,7 +9,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" #include "block/scsi.h" #include "libqos/virtio.h"
tests/virtio-serial-test.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" /* Tests only initialization so far. TODO: Replace with functional tests */
tests/vmxnet3-test.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" /* Tests only initialization so far. TODO: Replace with functional tests */
tests/wdt_ib700-test.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include "libqtest.h" #include "qemu/timer.h"
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 52/52] hbitmap: Use DIV_ROUND_UP
In reply to Michael TokarevFrom: Laurent Vivier <[email protected]>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle script scripts/coccinelle/round.cocci
--- tests/test-hbitmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tests/test-hbitmap.c +3 -3
@@ -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 ; }
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 13/52] ppc: Remove a potential overflow in muldiv64()
In reply to Michael TokarevFrom: Laurent Vivier <[email protected]>
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).
--- hw/ppc/ppc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ppc/ppc.c +1 -1
@@ -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);
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 30/52] qga: Remove unnecessary glib.h includes
In reply to Michael TokarevFrom: Peter Maydell <[email protected]>
Remove glib.h includes, as it is provided by osdep.h.
This commit was created with scripts/clean-includes.
--- 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(-)
qga/channel-posix.c +0 -1
@@ -1,5 +1,4 @@#include "qemu/osdep.h" -#include <glib.h> #include <termios.h> #include "qapi/error.h" #include "qemu/sockets.h"
qga/channel-win32.c +0 -1
@@ -1,5 +1,4 @@#include "qemu/osdep.h" -#include <glib.h> #include <windows.h> #include <io.h> #include "qga/guest-agent-core.h"
qga/channel.h +0 -1
@@ -12,7 +12,6 @@#ifndef QGA_CHANNEL_H #define QGA_CHANNEL_H -#include <glib.h> typedef struct GAChannel GAChannel ;
qga/commands-posix.c +0 -1
@@ -12,7 +12,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include <sys/ioctl.h> #include <sys/wait.h> #include <dirent.h>
qga/commands-win32.c +0 -1
@@ -12,7 +12,6 @@*/ #include "qemu/osdep.h" -#include <glib.h> #include <wtypes.h> #include <powrprof.h> #include <winsock2.h>
qga/commands.c +0 -1
@@ -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"
qga/guest-agent-command-state.c +0 -1
@@ -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 {
qga/main.c +0 -1
@@ -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
qga/service-win32.c +0 -1
@@ -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"
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 43/52] xen: Use DIV_ROUND_UP
In reply to Michael TokarevFrom: Laurent Vivier <[email protected]>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle script scripts/coccinelle/round.cocci
--- hw/display/xenfb.c | 4 ++-- xen-hvm.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
hw/display/xenfb.c +2 -2
@@ -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);
xen-hvm.c +1 -1
@@ -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 ;
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 35/52] thunk: Drop unused NO_THUNK_TYPE_SIZE guards
In reply to Michael TokarevFrom: Peter Maydell <[email protected]>
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.)
--- include/exec/user/thunk.h | 3 --- thunk.c | 2 -- 2 files changed, 5 deletions(-)
include/exec/user/thunk.h +0 -3
@@ -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,
thunk.c +0 -2
@@ -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) {
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 23/52] hw: Clean up includes
In reply to Michael TokarevFrom: Peter Maydell <[email protected]>
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.
--- 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(-)
hw/intc/aspeed_vic.c +0 -1
@@ -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"
hw/timer/mc146818rtc.c +0 -1
@@ -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"
include/exec/hwaddr.h +0 -1
@@ -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
include/qemu/fifo32.h +0 -1
@@ -15,7 +15,6 @@ #ifndef FIFO32_H #define FIFO32_H -#include "qemu/osdep.h" #include "qemu/fifo8.h" typedef struct {
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 04/52] qga: spelling fix
In reply to Michael Tokarev--- qga/commands-posix.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
qga/commands-posix.c +6 -6
@@ -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 ;
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 51/52] qemu-timer: Use DIV_ROUND_UP
In reply to Michael TokarevFrom: Laurent Vivier <[email protected]>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle scriptscripts/coccinelle/round.cocci
--- qemu-timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
qemu-timer.c +1 -1
@@ -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 ) {
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 02/52] hw/ipmi: fix spelling
In reply to Michael Tokarev--- hw/ipmi/ipmi_bmc_extern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ipmi/ipmi_bmc_extern.c +1 -1
@@ -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 (); }
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 12/52] replace muldiv64(a, b, c) by (uint64_t)a * b / c
In reply to Michael TokarevFrom: Laurent Vivier <[email protected]>
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 scriptscripts/coccinelle/simplify_muldiv64.cocci
For xtensa PIC:
--- hw/audio/gus.c | 2 +- hw/xtensa/pic_cpu.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
hw/audio/gus.c +1 -1
@@ -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)
hw/xtensa/pic_cpu.c +2 -2
@@ -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)
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 21/52] fw_cfg: follow CODING_STYLE
In reply to Michael TokarevFrom: Cao jin <[email protected]>
Replace tab with 4 spaces; brace the indented statement.
--- hw/nvram/fw_cfg.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-)
hw/nvram/fw_cfg.c +11 -6
@@ -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 ;
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 16/52] configure: Use $(..) instead of deprecated `..`
In reply to Michael TokarevFrom: Stefan Weil <[email protected]>
This fixes these warnings from shellcheck:
^-- SC2006: Use $(..) instead of deprecated `..`
--- configure | 174 +++++++++++++++++++++++++++++++------------------------------- 1 file changed, 87 insertions(+), 87 deletions(-)
configure +87 -87
@@ -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
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 41/52] block: Use DIV_ROUND_UP
In reply to Michael TokarevFrom: Laurent Vivier <[email protected]>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle scriptscripts/coccinelle/round.cocci
--- block/vvfat.c | 3 +-- hw/block/tc58128.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-)
block/vvfat.c +1 -2
@@ -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; }
hw/block/tc58128.c +1 -1
@@ -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 ;
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 22/52] replay: Clean up includes
In reply to Michael TokarevFrom: Peter Maydell <[email protected]>
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.
--- replay/replay-char.c | 4 ---- 1 file changed, 4 deletions(-)
replay/replay-char.c +0 -4
@@ -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"
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 45/52] SPICE: Use DIV_ROUND_UP
In reply to Michael TokarevFrom: Laurent Vivier <[email protected]>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle scriptscripts/coccinelle/round.cocci
--- ui/spice-display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
ui/spice-display.c +1 -1
@@ -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);
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 39/52] qcow/qcow2: Use DIV_ROUND_UP
In reply to Michael TokarevFrom: Laurent Vivier <[email protected]>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle scriptscripts/coccinelle/round.cocci
--- block/qcow.c | 4 ++-- block/qcow2-cluster.c | 4 ++-- block/qcow2-refcount.c | 6 ++---- 3 files changed, 6 insertions(+), 8 deletions(-)
block/qcow.c +2 -2
@@ -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 ) {
block/qcow2-cluster.c +2 -2
@@ -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 );
block/qcow2-refcount.c +2 -4
@@ -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);
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 03/52] docs: "specify" spell fix
In reply to Michael Tokarev--- docs/qapi-code-gen.txt | 2 +- qemu-options.hx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
docs/qapi-code-gen.txt +1 -1
@@ -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
qemu-options.hx +2 -2
@@ -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}
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 49/52] linux-user: Use DIV_ROUND_UP
In reply to Michael TokarevFrom: Laurent Vivier <[email protected]>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle scriptscripts/coccinelle/round.cocci
--- linux-user/syscall.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
linux-user/syscall.c +2 -2
@@ -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,
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 33/52] host-utils: Prefer 'false' for bool type
In reply to Michael TokarevFrom: Eric Blake <[email protected]>
Mixing '0' and 'bool' looks stupid.
--- include/qemu/host-utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/qemu/host-utils.h +1 -1
@@ -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 ));
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 28/52] clean-includes: Add glib.h to list of unneeded includes
In reply to Michael TokarevFrom: Peter Maydell <[email protected]>
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.)
--- scripts/clean-includes | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/clean-includes +2 -1
@@ -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"
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 48/52] slirp: Use DIV_ROUND_UP
In reply to Michael TokarevFrom: Laurent Vivier <[email protected]>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle script scripts/coccinelle/round.cocci
--- slirp/dnssearch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
slirp/dnssearch.c +2 -2
@@ -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 ;
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 40/52] qed: Use DIV_ROUND_UP
In reply to Michael TokarevFrom: Laurent Vivier <[email protected]>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle scriptscripts/coccinelle/round.cocci
--- block/qed-check.c | 3 +-- block/qed.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)
block/qed-check.c +1 -2
@@ -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 */
block/qed.c +1 -2
@@ -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);
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 37/52] coccinelle: use macro DIV_ROUND_UP instead of (((n) + (d) - 1) /(d))
In reply to Michael TokarevFrom: Laurent Vivier <[email protected]>
sample from http://coccinellery.org/
--- scripts/coccinelle/round.cocci | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 scripts/coccinelle/round.cocci
scripts/coccinelle/round.cocci new file +19 -0
@@ -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)
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 47/52] usb: Use DIV_ROUND_UP
In reply to Michael TokarevFrom: Laurent Vivier <[email protected]>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle scriptscripts/coccinelle/round.cocci
--- hw/usb/redirect.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
hw/usb/redirect.c +3 -3
@@ -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 )) {
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 44/52] audio: Use DIV_ROUND_UP
In reply to Michael TokarevFrom: Laurent Vivier <[email protected]>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle scriptscripts/coccinelle/round.cocci
--- hw/audio/pcspk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/audio/pcspk.c +1 -1
@@ -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)
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 01/52] s390x/virtio-ccw: fix spelling
In reply to Michael Tokarev--- hw/s390x/virtio-ccw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/s390x/virtio-ccw.c +1 -1
@@ -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 ;
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 46/52] rocker: Use DIV_ROUND_UP
In reply to Michael TokarevFrom: Laurent Vivier <[email protected]>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle scriptscripts/coccinelle/round.cocci
--- hw/net/rocker/rocker_of_dpa.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
hw/net/rocker/rocker_of_dpa.c +2 -3
@@ -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;
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 27/52] pc: cleanup unused struct PcRomPciInfo
In reply to Michael TokarevFrom: Igor Mammedov <[email protected]>
--- hw/i386/pc.c | 8 -------- 1 file changed, 8 deletions(-)
hw/i386/pc.c +0 -8
@@ -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) {
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 17/52] scripts: Use $(..) instead of deprecated `..`
In reply to Michael TokarevFrom: Stefan Weil <[email protected]>
This fixes these warnings from shellcheck:
^-- SC2006: Use $(..) instead of deprecated `..`
Update also a comment using the same pattern.
--- 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 +- scripts/update-linux-headers.sh | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-)
scripts/clean-includes +1 -1
@@ -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
scripts/create_config +3 -3
@@ -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=*)
scripts/feature_to_c.sh +3 -3
@@ -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
scripts/make_device_config.sh +2 -2
@@ -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
scripts/qemu-binfmt-conf.sh +1 -1
@@ -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"
scripts/update-linux-headers.sh +1 -1
@@ -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"
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 26/52] e1000: Removing unnecessary if statement
In reply to Michael TokarevFrom: Sameeh Jubran <[email protected]>
Since mit_delay can never be 0 this if statement is superfluous.
--- hw/net/e1000.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
hw/net/e1000.c +3 -5
@@ -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 ; } }
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 34/52] qemu-common.h: Drop WORDS_ALIGNED define
In reply to Michael TokarevFrom: Peter Maydell <[email protected]>
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.
--- include/exec/cpu-all.h | 5 ----- include/qemu-common.h | 4 ---- 2 files changed, 9 deletions(-)
include/exec/cpu-all.h +0 -5
@@ -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 */
include/qemu-common.h +0 -4
@@ -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"
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 32/52] docs/multi-thread-compression: Fix wrong command string
In reply to Michael TokarevFrom: Wei Jiangang <[email protected]>
s/info_migrate_capabilities/info migrate_capabilities
--- docs/multi-thread-compression.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
docs/multi-thread-compression.txt +1 -1
@@ -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:
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 38/52] parallels: Use DIV_ROUND_UP
In reply to Michael TokarevFrom: Laurent Vivier <[email protected]>
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).
This patch is the result of coccinelle scriptscripts/coccinelle/round.cocci
--- block/parallels.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block/parallels.c +1 -1
@@ -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;
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 15/52] qemu-options.hx: Specify the units for -machine kvm_shadow_mem
In reply to Michael TokarevFrom: Peter Maydell <[email protected]>
The -machine kvm_shadow_mem option takes a size in bytes; say so explicitly in its documentation.
--- qemu-options.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
qemu-options.hx +1 -1
@@ -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"
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 05/52] fsdev: spelling fix
In reply to Michael Tokarev--- fsdev/virtfs-proxy-helper.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fsdev/virtfs-proxy-helper.texi +1 -1
@@ -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
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 18/52] ICH9: fix typo
In reply to Michael TokarevFrom: Cao jin <[email protected]>
--- hw/isa/lpc_ich9.c | 4 ++-- include/hw/i386/ich9.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
hw/isa/lpc_ich9.c +2 -2
@@ -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++) {
include/hw/i386/ich9.h +2 -2
@@ -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 */
Signature · 1 line
2.1.4
Quoted 15 lines · Michael Tokarev
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.gittags/pull-trivial-patches-2016-06-05
Quoted 8 lines
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
PATCH v3 1/1 Fix linking relocatable objects on Sparc
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.
---
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(-)
configure +21 -0
@@ -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
rules.mak +1 -1
@@ -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)$@")
Signature · 1 line
2.8.3
Re: [Qemu-devel] [PULL 50/52] pc-bios/s390-ccw: Use DIV_ROUND_UP
In reply to Michael TokarevQuoted 20 lines · Michael Tokarev
From: Laurent Vivier <[email protected]>
Replace (((n) + (d) - 1) /(d)) by
DIV_ROUND_UP(n,d).This patch is the result of coccinelle script
scripts/coccinelle/round.cocciCC Cornelia Huck <[email protected]>Signed-off-by Laurent Vivier <[email protected]>Signed-off-by Michael Tokarev <[email protected]>--- pc-bios/s390-ccw/bootmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)pc-bios/s390-ccw/bootmap.c +0
-0
pc-bios/s390-ccw/bootmap.c static void load_iso_bc_entry(IsoBcSection *load) · line 605
Quoted 8 lines
pc-bios/s390-ccw/bootmap.c +1
-1@@ -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
Re: [Qemu-devel] [PULL 50/52] pc-bios/s390-ccw: Use DIV_ROUND_UP
Quoted 21 lines · Laurent Vivier
Quoted 20 lines · Michael Tokarev
From: Laurent Vivier <[email protected]>
Replace (((n) + (d) - 1) /(d)) by
DIV_ROUND_UP(n,d).This patch is the result of coccinelle script
scripts/coccinelle/round.cocciCC Cornelia Huck <[email protected]>Signed-off-by Laurent Vivier <[email protected]>Signed-off-by Michael Tokarev <[email protected]>--- pc-bios/s390-ccw/bootmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)pc-bios/s390-ccw/bootmap.c +0
-0@@ -599,7 +599,7 @@ static void load_iso_bc_entry(IsoBcSection *load)
Quoted 11 lines
pc-bios/s390-ccw/bootmap.c static void load_iso_bc_entry(IsoBcSection *load) · line 605
Quoted 8 lines
pc-bios/s390-ccw/bootmap.c +1
-1if (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
Quoted 6 lines
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
Re: [Qemu-devel] [PULL 24/52] docs: Fix a couple of typos in throttle.txt
In reply to Michael Tokarevdocs/throttle.txt consider the following values: · line 238
Quoted 5 lines · Michael Tokarev
- 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 = 120000docs/throttle.txt +1
-1- - 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
Re: [Qemu-devel] [PULL 24/52] docs: Fix a couple of typos in throttle.txt
Quoted 10 lines · Alberto Garcia
docs/throttle.txt consider the following values: · line 238
Quoted 5 lines · Michael Tokarev
- 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 = 120000docs/throttle.txt +1
-1- - 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
Re: [Qemu-devel] [PULL 24/52] docs: Fix a couple of typos in throttle.txt
Quoted 9 lines · Michael Tokarev
Quoted 8 lines · Alberto Garcia
Quoted 5 lines · Michael Tokarev
- 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 = 120000docs/throttle.txt +1
-1- - 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.
Quoted 8 lines
Quoted 2 lines
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