trivial patches for 2018-02-10

-----BEGIN PGP SIGNATURE-----
 
 iQFDBAABCAAtFiEEe3O61ovnosKJMUsicBtPaxppPlkFAlp+pRsPHG1qdEB0bHMu
 bXNrLnJ1AAoJEHAbT2saaT5ZIZMH/iNEDwBgxtCkUiJ1EPe3bg5R43blkcmMGdIt
 O2q0RxJkypr5BexMwpgkgMkCCF/c3gj7UC1cefRCC0gaV/CsLzCV5DVzZMP95BF3
 DQHrJtvqy3v+jsjJeIGD+1b9cI4Rh6HCFd/6ZIq/FCRBEpfZVCRGAaAEJ6h8xXxd
 SILTIe/IA6Xv5//7ISbRJ5SKE7W6Ou41Z/c86DS03pW273NmENcyGnJeu1hua4Xj
 bldCDRnZZ/vQ2naTbOnUTakzKqrZ9BGyU89GyTgLNnTt7SWJSaR7P6bzoBBTldeL
 fmlcC4RHNDC3FQKcJPOYI6P57IOavAKnjWPXE6QlGGDyGM71x4s=
 =jbH3
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-fetch' into staging

trivial patches for 2018-02-10

# gpg: Signature made Sat 10 Feb 2018 07:54:03 GMT
# gpg:                using RSA key 701B4F6B1A693E59
# gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>"
# gpg:                 aka "Michael Tokarev <mjt@corpit.ru>"
# gpg:                 aka "Michael Tokarev <mjt@debian.org>"
# Primary key fingerprint: 6EE1 95D1 886E 8FFB 810D  4324 457C E0A0 8044 65C5
#      Subkey fingerprint: 7B73 BAD6 8BE7 A2C2 8931  4B22 701B 4F6B 1A69 3E59

* remotes/mjt/tags/trivial-patches-fetch:
  tests/qapi: use ARRAY_SIZE macro
  tests/qapi: use QEMU_IS_ALIGNED macro
  tests/hbitmap: use ARRAY_SIZE macro
  async: use ARRAY_SIZE macro
  qga: use ARRAY_SIZE macro
  MAINTAINERS: Add qemu-binfmt-conf.sh script
  oslib-posix: check for posix_memalign in configure script
  maint: Mention web site maintenance in README
  build: fix typo in error message
  configure: Allow capstone=git only if git update is not disabled
  scripts/make-release: Don't archive .git files
  qemu-options.hx: Remove confusing spaces in parameter listings
  mailmap: set preferred spelling for Daniel Berrangé
  Drop unneeded system header includes
  machine: Polish -machine xxx,help
  scripts/argparse.py: spelling (independant)
  qapi-schema.json: spelling (independant comparation)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
master
Peter Maydell 2018-02-12 13:00:03 +00:00
commit 8e3fb8029e
18 changed files with 68 additions and 44 deletions

View File

@ -18,3 +18,7 @@ malc <av1474@comtv.ru> malc <malc@c046a42c-6fe2-441c-8c8c-71466251a162>
# There is also a: # There is also a:
# (no author) <(no author)@c046a42c-6fe2-441c-8c8c-71466251a162> # (no author) <(no author)@c046a42c-6fe2-441c-8c8c-71466251a162>
# for the cvs2svn initialization commit e63c3dc74bf. # for the cvs2svn initialization commit e63c3dc74bf.
#
# Also list preferred name forms where people have changed their
# git author config
Daniel P. Berrangé <berrange@redhat.com>

View File

@ -1761,6 +1761,7 @@ R: Laurent Vivier <laurent@vivier.eu>
S: Maintained S: Maintained
F: linux-user/ F: linux-user/
F: default-configs/*-linux-user.mak F: default-configs/*-linux-user.mak
F: scripts/qemu-binfmt-conf.sh
Tiny Code Generator (TCG) Tiny Code Generator (TCG)
------------------------- -------------------------

4
README
View File

@ -68,6 +68,10 @@ the QEMU website
https://qemu.org/Contribute/SubmitAPatch https://qemu.org/Contribute/SubmitAPatch
https://qemu.org/Contribute/TrivialPatches https://qemu.org/Contribute/TrivialPatches
The QEMU website is also maintained under source control.
git clone git://git.qemu.org/qemu-web.git
https://www.qemu.org/2017/02/04/the-new-qemu-website-is-up/
Bug reporting Bug reporting
============= =============

21
configure vendored
View File

@ -4568,7 +4568,7 @@ case "$capstone" in
"" | yes) "" | yes)
if $pkg_config capstone; then if $pkg_config capstone; then
capstone=system capstone=system
elif test -e "${source_path}/.git" ; then elif test -e "${source_path}/.git" -a $git_update = 'yes' ; then
capstone=git capstone=git
elif test -e "${source_path}/capstone/Makefile" ; then elif test -e "${source_path}/capstone/Makefile" ; then
capstone=internal capstone=internal
@ -4658,6 +4658,21 @@ if compile_prog "" "" ; then
posix_madvise=yes posix_madvise=yes
fi fi
##########################################
# check if we have posix_memalign()
posix_memalign=no
cat > $TMPC << EOF
#include <stdlib.h>
int main(void) {
void *p;
return posix_memalign(&p, 8, 8);
}
EOF
if compile_prog "" "" ; then
posix_memalign=yes
fi
########################################## ##########################################
# check if we have posix_syslog # check if we have posix_syslog
@ -5746,6 +5761,7 @@ echo "preadv support $preadv"
echo "fdatasync $fdatasync" echo "fdatasync $fdatasync"
echo "madvise $madvise" echo "madvise $madvise"
echo "posix_madvise $posix_madvise" echo "posix_madvise $posix_madvise"
echo "posix_memalign $posix_memalign"
echo "libcap-ng support $cap_ng" echo "libcap-ng support $cap_ng"
echo "vhost-net support $vhost_net" echo "vhost-net support $vhost_net"
echo "vhost-scsi support $vhost_scsi" echo "vhost-scsi support $vhost_scsi"
@ -6232,6 +6248,9 @@ fi
if test "$posix_madvise" = "yes" ; then if test "$posix_madvise" = "yes" ; then
echo "CONFIG_POSIX_MADVISE=y" >> $config_host_mak echo "CONFIG_POSIX_MADVISE=y" >> $config_host_mak
fi fi
if test "$posix_memalign" = "yes" ; then
echo "CONFIG_POSIX_MEMALIGN=y" >> $config_host_mak
fi
if test "$spice" = "yes" ; then if test "$spice" = "yes" ; then
echo "CONFIG_SPICE=y" >> $config_host_mak echo "CONFIG_SPICE=y" >> $config_host_mak

View File

@ -520,7 +520,7 @@ static void machine_class_init(ObjectClass *oc, void *data)
object_class_property_set_description(oc, "accel", object_class_property_set_description(oc, "accel",
"Accelerator list", &error_abort); "Accelerator list", &error_abort);
object_class_property_add(oc, "kernel-irqchip", "OnOffSplit", object_class_property_add(oc, "kernel-irqchip", "on|off|split",
NULL, machine_set_kernel_irqchip, NULL, machine_set_kernel_irqchip,
NULL, NULL, &error_abort); NULL, NULL, &error_abort);
object_class_property_set_description(oc, "kernel-irqchip", object_class_property_set_description(oc, "kernel-irqchip",

View File

@ -2023,7 +2023,7 @@
# #
# @static: Expand to a static CPU model, a combination of a static base # @static: Expand to a static CPU model, a combination of a static base
# model name and property delta changes. As the static base model will # model name and property delta changes. As the static base model will
# never change, the expanded CPU model will be the same, independant of # never change, the expanded CPU model will be the same, independent of
# independent of QEMU version, machine type, machine options, and # independent of QEMU version, machine type, machine options, and
# accelerator options. Therefore, the resulting model can be used by # accelerator options. Therefore, the resulting model can be used by
# tooling without having to specify a compatibility machine - e.g. when # tooling without having to specify a compatibility machine - e.g. when
@ -2102,7 +2102,7 @@
## ##
# @CpuModelCompareResult: # @CpuModelCompareResult:
# #
# An enumeration of CPU model comparation results. The result is usually # An enumeration of CPU model comparison results. The result is usually
# calculated using e.g. CPU features or CPU generations. # calculated using e.g. CPU features or CPU generations.
# #
# @incompatible: If model A is incompatible to model B, model A is not # @incompatible: If model A is incompatible to model B, model A is not

View File

@ -2522,7 +2522,7 @@ STEXI
The general form of a character device option is: The general form of a character device option is:
@table @option @table @option
@item -chardev @var{backend} ,id=@var{id} [,mux=on|off] [,@var{options}] @item -chardev @var{backend},id=@var{id}[,mux=on|off][,@var{options}]
@findex -chardev @findex -chardev
Backend is one of: Backend is one of:
@option{null}, @option{null},
@ -2541,7 +2541,7 @@ Backend is one of:
@option{tty}, @option{tty},
@option{parallel}, @option{parallel},
@option{parport}, @option{parport},
@option{spicevmc}. @option{spicevmc},
@option{spiceport}. @option{spiceport}.
The specific backend will determine the applicable options. The specific backend will determine the applicable options.
@ -2605,11 +2605,11 @@ opened.
The available backends are: The available backends are:
@table @option @table @option
@item -chardev null ,id=@var{id} @item -chardev null,id=@var{id}
A void device. This device will not emit any data, and will drop any data it A void device. This device will not emit any data, and will drop any data it
receives. The null backend does not take any options. receives. The null backend does not take any options.
@item -chardev socket ,id=@var{id} [@var{TCP options} or @var{unix options}] [,server] [,nowait] [,telnet] [,reconnect=@var{seconds}] [,tls-creds=@var{id}] @item -chardev socket,id=@var{id}[,@var{TCP options} or @var{unix options}][,server][,nowait][,telnet][,reconnect=@var{seconds}][,tls-creds=@var{id}]
Create a two-way stream socket, which can be either a TCP or a unix socket. A Create a two-way stream socket, which can be either a TCP or a unix socket. A
unix socket will be created if @option{path} is specified. Behaviour is unix socket will be created if @option{path} is specified. Behaviour is
@ -2636,7 +2636,7 @@ TCP and unix socket options are given below:
@table @option @table @option
@item TCP options: port=@var{port} [,host=@var{host}] [,to=@var{to}] [,ipv4] [,ipv6] [,nodelay] @item TCP options: port=@var{port}[,host=@var{host}][,to=@var{to}][,ipv4][,ipv6][,nodelay]
@option{host} for a listening socket specifies the local address to be bound. @option{host} for a listening socket specifies the local address to be bound.
For a connecting socket species the remote host to connect to. @option{host} is For a connecting socket species the remote host to connect to. @option{host} is
@ -2664,7 +2664,7 @@ required.
@end table @end table
@item -chardev udp ,id=@var{id} [,host=@var{host}] ,port=@var{port} [,localaddr=@var{localaddr}] [,localport=@var{localport}] [,ipv4] [,ipv6] @item -chardev udp,id=@var{id}[,host=@var{host}],port=@var{port}[,localaddr=@var{localaddr}][,localport=@var{localport}][,ipv4][,ipv6]
Sends all traffic from the guest to a remote host over UDP. Sends all traffic from the guest to a remote host over UDP.
@ -2683,12 +2683,12 @@ available local port will be used.
@option{ipv4} and @option{ipv6} specify that either IPv4 or IPv6 must be used. @option{ipv4} and @option{ipv6} specify that either IPv4 or IPv6 must be used.
If neither is specified the device may use either protocol. If neither is specified the device may use either protocol.
@item -chardev msmouse ,id=@var{id} @item -chardev msmouse,id=@var{id}
Forward QEMU's emulated msmouse events to the guest. @option{msmouse} does not Forward QEMU's emulated msmouse events to the guest. @option{msmouse} does not
take any options. take any options.
@item -chardev vc ,id=@var{id} [[,width=@var{width}] [,height=@var{height}]] [[,cols=@var{cols}] [,rows=@var{rows}]] @item -chardev vc,id=@var{id}[[,width=@var{width}][,height=@var{height}]][[,cols=@var{cols}][,rows=@var{rows}]]
Connect to a QEMU text console. @option{vc} may optionally be given a specific Connect to a QEMU text console. @option{vc} may optionally be given a specific
size. size.
@ -2699,12 +2699,12 @@ the console, in pixels.
@option{cols} and @option{rows} specify that the console be sized to fit a text @option{cols} and @option{rows} specify that the console be sized to fit a text
console with the given dimensions. console with the given dimensions.
@item -chardev ringbuf ,id=@var{id} [,size=@var{size}] @item -chardev ringbuf,id=@var{id}[,size=@var{size}]
Create a ring buffer with fixed size @option{size}. Create a ring buffer with fixed size @option{size}.
@var{size} must be a power of two and defaults to @code{64K}. @var{size} must be a power of two and defaults to @code{64K}.
@item -chardev file ,id=@var{id} ,path=@var{path} @item -chardev file,id=@var{id},path=@var{path}
Log all traffic received from the guest to a file. Log all traffic received from the guest to a file.
@ -2712,7 +2712,7 @@ Log all traffic received from the guest to a file.
created if it does not already exist, and overwritten if it does. @option{path} created if it does not already exist, and overwritten if it does. @option{path}
is required. is required.
@item -chardev pipe ,id=@var{id} ,path=@var{path} @item -chardev pipe,id=@var{id},path=@var{path}
Create a two-way connection to the guest. The behaviour differs slightly between Create a two-way connection to the guest. The behaviour differs slightly between
Windows hosts and other hosts: Windows hosts and other hosts:
@ -2729,14 +2729,14 @@ be present.
@option{path} forms part of the pipe path as described above. @option{path} is @option{path} forms part of the pipe path as described above. @option{path} is
required. required.
@item -chardev console ,id=@var{id} @item -chardev console,id=@var{id}
Send traffic from the guest to QEMU's standard output. @option{console} does not Send traffic from the guest to QEMU's standard output. @option{console} does not
take any options. take any options.
@option{console} is only available on Windows hosts. @option{console} is only available on Windows hosts.
@item -chardev serial ,id=@var{id} ,path=@option{path} @item -chardev serial,id=@var{id},path=@option{path}
Send traffic from the guest to a serial device on the host. Send traffic from the guest to a serial device on the host.
@ -2745,33 +2745,33 @@ not only serial lines.
@option{path} specifies the name of the serial device to open. @option{path} specifies the name of the serial device to open.
@item -chardev pty ,id=@var{id} @item -chardev pty,id=@var{id}
Create a new pseudo-terminal on the host and connect to it. @option{pty} does Create a new pseudo-terminal on the host and connect to it. @option{pty} does
not take any options. not take any options.
@option{pty} is not available on Windows hosts. @option{pty} is not available on Windows hosts.
@item -chardev stdio ,id=@var{id} [,signal=on|off] @item -chardev stdio,id=@var{id}[,signal=on|off]
Connect to standard input and standard output of the QEMU process. Connect to standard input and standard output of the QEMU process.
@option{signal} controls if signals are enabled on the terminal, that includes @option{signal} controls if signals are enabled on the terminal, that includes
exiting QEMU with the key sequence @key{Control-c}. This option is enabled by exiting QEMU with the key sequence @key{Control-c}. This option is enabled by
default, use @option{signal=off} to disable it. default, use @option{signal=off} to disable it.
@item -chardev braille ,id=@var{id} @item -chardev braille,id=@var{id}
Connect to a local BrlAPI server. @option{braille} does not take any options. Connect to a local BrlAPI server. @option{braille} does not take any options.
@item -chardev tty ,id=@var{id} ,path=@var{path} @item -chardev tty,id=@var{id},path=@var{path}
@option{tty} is only available on Linux, Sun, FreeBSD, NetBSD, OpenBSD and @option{tty} is only available on Linux, Sun, FreeBSD, NetBSD, OpenBSD and
DragonFlyBSD hosts. It is an alias for @option{serial}. DragonFlyBSD hosts. It is an alias for @option{serial}.
@option{path} specifies the path to the tty. @option{path} is required. @option{path} specifies the path to the tty. @option{path} is required.
@item -chardev parallel ,id=@var{id} ,path=@var{path} @item -chardev parallel,id=@var{id},path=@var{path}
@itemx -chardev parport ,id=@var{id} ,path=@var{path} @itemx -chardev parport,id=@var{id},path=@var{path}
@option{parallel} is only available on Linux, FreeBSD and DragonFlyBSD hosts. @option{parallel} is only available on Linux, FreeBSD and DragonFlyBSD hosts.
@ -2780,7 +2780,7 @@ Connect to a local parallel port.
@option{path} specifies the path to the parallel port device. @option{path} is @option{path} specifies the path to the parallel port device. @option{path} is
required. required.
@item -chardev spicevmc ,id=@var{id} ,debug=@var{debug}, name=@var{name} @item -chardev spicevmc,id=@var{id},debug=@var{debug},name=@var{name}
@option{spicevmc} is only available when spice support is built in. @option{spicevmc} is only available when spice support is built in.
@ -2790,7 +2790,7 @@ required.
Connect to a spice virtual machine channel, such as vdiport. Connect to a spice virtual machine channel, such as vdiport.
@item -chardev spiceport ,id=@var{id} ,debug=@var{debug}, name=@var{name} @item -chardev spiceport,id=@var{id},debug=@var{debug},name=@var{name}
@option{spiceport} is only available when spice support is built in. @option{spiceport} is only available when spice support is built in.
@ -2898,7 +2898,7 @@ STEXI
The general form of a TPM device option is: The general form of a TPM device option is:
@table @option @table @option
@item -tpmdev @var{backend} ,id=@var{id} [,@var{options}] @item -tpmdev @var{backend},id=@var{id}[,@var{options}]
@findex -tpmdev @findex -tpmdev
The specific backend type will determine the applicable options. The specific backend type will determine the applicable options.
@ -2913,7 +2913,7 @@ The available backends are:
@table @option @table @option
@item -tpmdev passthrough, id=@var{id}, path=@var{path}, cancel-path=@var{cancel-path} @item -tpmdev passthrough,id=@var{id},path=@var{path},cancel-path=@var{cancel-path}
(Linux-host only) Enable access to the host's TPM using the passthrough (Linux-host only) Enable access to the host's TPM using the passthrough
driver. driver.
@ -2950,7 +2950,7 @@ To create a passthrough TPM use the following two options:
Note that the @code{-tpmdev} id is @code{tpm0} and is referenced by Note that the @code{-tpmdev} id is @code{tpm0} and is referenced by
@code{tpmdev=tpm0} in the device option. @code{tpmdev=tpm0} in the device option.
@item -tpmdev emulator, id=@var{id}, chardev=@var{dev} @item -tpmdev emulator,id=@var{id},chardev=@var{dev}
(Linux-host only) Enable access to a TPM emulator using Unix domain socket based (Linux-host only) Enable access to a TPM emulator using Unix domain socket based
chardev backend. chardev backend.

View File

@ -901,7 +901,7 @@ static void build_guest_fsinfo_for_real_device(char const *syspath,
if (p && sscanf(q, "%u", &host) == 1) { if (p && sscanf(q, "%u", &host) == 1) {
has_host = true; has_host = true;
nhosts = build_hosts(syspath, p, has_ata, hosts, nhosts = build_hosts(syspath, p, has_ata, hosts,
sizeof(hosts) / sizeof(hosts[0]), errp); ARRAY_SIZE(hosts), errp);
if (nhosts < 0) { if (nhosts < 0) {
goto cleanup; goto cleanup;
} }

View File

@ -76,7 +76,7 @@ considered public as object names -- the API of the formatter objects is
still considered an implementation detail.) still considered an implementation detail.)
""" """
__version__ = '1.4.0' # we use our own version number independant of the __version__ = '1.4.0' # we use our own version number independent of the
# one in stdlib and we release this on pypi. # one in stdlib and we release this on pypi.
__external_lib__ = True # to make sure the tests really test THIS lib, __external_lib__ = True # to make sure the tests really test THIS lib,

View File

@ -28,7 +28,7 @@ error() {
echo echo
echo "and then manually update submodules prior to running make, with:" echo "and then manually update submodules prior to running make, with:"
echo echo
echo " $ scripts/git-sbumodule.sh update $modules" echo " $ scripts/git-submodule.sh update $modules"
echo echo
exit 1 exit 1
} }

View File

@ -19,11 +19,10 @@ pushd ${destination}
git checkout "v${version}" git checkout "v${version}"
git submodule update --init git submodule update --init
(cd roms/seabios && git describe --tags --long --dirty > .version) (cd roms/seabios && git describe --tags --long --dirty > .version)
rm -rf .git roms/*/.git dtc/.git pixman/.git
# FIXME: The following line is a workaround for avoiding filename collisions # FIXME: The following line is a workaround for avoiding filename collisions
# when unpacking u-boot sources on case-insensitive filesystems. Once we # when unpacking u-boot sources on case-insensitive filesystems. Once we
# update to something with u-boot commit 610eec7f0 we can drop this line. # update to something with u-boot commit 610eec7f0 we can drop this line.
tar cfj roms/u-boot.tar.bz2 -C roms u-boot && rm -rf roms/u-boot tar --exclude=.git -cjf roms/u-boot.tar.bz2 -C roms u-boot && rm -rf roms/u-boot
popd popd
tar cfj ${destination}.tar.bz2 ${destination} tar --exclude=.git -cjf ${destination}.tar.bz2 ${destination}
rm -rf ${destination} rm -rf ${destination}

View File

@ -20,8 +20,6 @@
#ifndef TARGET_I386_HAX_WINDOWS_H #ifndef TARGET_I386_HAX_WINDOWS_H
#define TARGET_I386_HAX_WINDOWS_H #define TARGET_I386_HAX_WINDOWS_H
#include <memory.h>
#include <malloc.h>
#include <winioctl.h> #include <winioctl.h>
#include <windef.h> #include <windef.h>

View File

@ -17,7 +17,6 @@
*/ */
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include <memory.h>
#include "panic.h" #include "panic.h"
#include "qemu-common.h" #include "qemu-common.h"
#include "cpu.h" #include "cpu.h"

View File

@ -813,7 +813,7 @@ static void test_hbitmap_serialize_basic(TestHBitmapData *data,
size_t buf_size; size_t buf_size;
uint8_t *buf; uint8_t *buf;
uint64_t positions[] = { 0, 1, L1 - 1, L1, L2 - 1, L2, L2 + 1, L3 - 1 }; uint64_t positions[] = { 0, 1, L1 - 1, L1, L2 - 1, L2, L2 + 1, L3 - 1 };
int num_positions = sizeof(positions) / sizeof(positions[0]); int num_positions = ARRAY_SIZE(positions);
hbitmap_test_init(data, L3, 0); hbitmap_test_init(data, L3, 0);
g_assert(hbitmap_is_serializable(data->hb)); g_assert(hbitmap_is_serializable(data->hb));
@ -838,7 +838,7 @@ static void test_hbitmap_serialize_part(TestHBitmapData *data,
size_t buf_size; size_t buf_size;
uint8_t *buf; uint8_t *buf;
uint64_t positions[] = { 0, 1, L1 - 1, L1, L2 - 1, L2, L2 + 1, L3 - 1 }; uint64_t positions[] = { 0, 1, L1 - 1, L1, L2 - 1, L2, L2 + 1, L3 - 1 };
int num_positions = sizeof(positions) / sizeof(positions[0]); int num_positions = ARRAY_SIZE(positions);
hbitmap_test_init(data, L3, 0); hbitmap_test_init(data, L3, 0);
buf_size = L2; buf_size = L2;
@ -880,7 +880,7 @@ static void test_hbitmap_serialize_zeroes(TestHBitmapData *data,
int64_t next; int64_t next;
uint64_t min_l1 = MAX(L1, 64); uint64_t min_l1 = MAX(L1, 64);
uint64_t positions[] = { 0, min_l1, L2, L3 - min_l1}; uint64_t positions[] = { 0, min_l1, L2, L3 - min_l1};
int num_positions = sizeof(positions) / sizeof(positions[0]); int num_positions = ARRAY_SIZE(positions);
hbitmap_test_init(data, L3, 0); hbitmap_test_init(data, L3, 0);

View File

@ -572,7 +572,7 @@ static void init_native_list(UserDefNativeListUnion *cvalue)
boolList **list = &cvalue->u.boolean.data; boolList **list = &cvalue->u.boolean.data;
for (i = 0; i < 32; i++) { for (i = 0; i < 32; i++) {
*list = g_new0(boolList, 1); *list = g_new0(boolList, 1);
(*list)->value = (i % 3 == 0); (*list)->value = QEMU_IS_ALIGNED(i, 3);
(*list)->next = NULL; (*list)->next = NULL;
list = &(*list)->next; list = &(*list)->next;
} }

View File

@ -95,7 +95,7 @@ static void test_visitor_out_intList(TestOutputVisitorData *data,
Error *err = NULL; Error *err = NULL;
char *str; char *str;
for (i = 0; i < sizeof(value) / sizeof(value[0]); i++) { for (i = 0; i < ARRAY_SIZE(value); i++) {
*tmp = g_malloc0(sizeof(**tmp)); *tmp = g_malloc0(sizeof(**tmp));
(*tmp)->value = value[i]; (*tmp)->value = value[i];
tmp = &(*tmp)->next; tmp = &(*tmp)->next;

View File

@ -119,7 +119,7 @@ static int aio_epoll(AioContext *ctx, GPollFD *pfds,
} }
if (timeout <= 0 || ret > 0) { if (timeout <= 0 || ret > 0) {
ret = epoll_wait(ctx->epollfd, events, ret = epoll_wait(ctx->epollfd, events,
sizeof(events) / sizeof(events[0]), ARRAY_SIZE(events),
timeout); timeout);
if (ret <= 0) { if (ret <= 0) {
goto out; goto out;

View File

@ -105,7 +105,7 @@ void *qemu_try_memalign(size_t alignment, size_t size)
alignment = sizeof(void*); alignment = sizeof(void*);
} }
#if defined(_POSIX_C_SOURCE) && !defined(__sun__) #if defined(CONFIG_POSIX_MEMALIGN)
int ret; int ret;
ret = posix_memalign(&ptr, alignment, size); ret = posix_memalign(&ptr, alignment, size);
if (ret != 0) { if (ret != 0) {