From efcb7e45290ecc8633f7c5bdf02ac86f6289fa7d Mon Sep 17 00:00:00 2001 From: Taimoor Mirza Date: Thu, 15 Aug 2013 23:13:28 +0500 Subject: [PATCH 01/15] slirp: Port redirection option behave differently on Linux and Windows port redirection code uses SO_REUSEADDR socket option before binding to host port. Behavior of SO_REUSEADDR is different on Windows and Linux. Relaunching QEMU with same host and guest port redirection values on Linux throws error but on Windows it does not throw any error. Problem is discussed in http://lists.gnu.org/archive/html/qemu-devel/2013-04/msg03089.html Signed-off-by: Taimoor Mirza Signed-off-by: Michael Tokarev --- slirp/socket.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/slirp/socket.c b/slirp/socket.c index 8e8819cf30..25d60e7a89 100644 --- a/slirp/socket.c +++ b/slirp/socket.c @@ -627,7 +627,9 @@ tcp_listen(Slirp *slirp, uint32_t haddr, u_int hport, uint32_t laddr, addr.sin_port = hport; if (((s = qemu_socket(AF_INET,SOCK_STREAM,0)) < 0) || +#ifndef _WIN32 (qemu_setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(int)) < 0) || +#endif (bind(s,(struct sockaddr *)&addr, sizeof(addr)) < 0) || (listen(s,1) < 0)) { int tmperrno = errno; /* Don't clobber the real reason we failed */ From 4c293dc6e4cf0421e13870962e1e8ccbb810b2a6 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 18 Aug 2013 19:40:06 +0200 Subject: [PATCH 02/15] misc: Fix some typos in names and comments Most typos were found using a modified version of codespell: accross -> across issueing -> issuing TICNT_THRESHHOLD -> TICNT_THRESHOLD bandwith -> bandwidth VCARD_7816_PROPIETARY -> VCARD_7816_PROPRIETARY occured -> occurred gaurantee -> guarantee sofware -> software Signed-off-by: Stefan Weil Signed-off-by: Michael Tokarev --- block/backup.c | 2 +- hw/s390x/css.c | 2 +- hw/timer/exynos4210_rtc.c | 4 ++-- include/hw/bt.h | 8 ++++---- libcacard/card_7816.c | 2 +- libcacard/card_7816t.h | 2 +- linux-headers/asm-powerpc/epapr_hcalls.h | 4 ++-- migration-rdma.c | 6 +++--- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/block/backup.c b/block/backup.c index e12b3b1461..23c7264488 100644 --- a/block/backup.c +++ b/block/backup.c @@ -290,7 +290,7 @@ static void coroutine_fn backup_run(void *opaque) for (i = 0; i < BACKUP_SECTORS_PER_CLUSTER;) { /* bdrv_co_is_allocated() only returns true/false based - * on the first set of sectors it comes accross that + * on the first set of sectors it comes across that * are are all in the same state. * For that reason we must verify each sector in the * backup cluster length. We end up copying more than diff --git a/hw/s390x/css.c b/hw/s390x/css.c index 93b0b9733b..101da63d04 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -124,7 +124,7 @@ static void sch_handle_clear_func(SubchDev *sch) /* Path management: In our simple css, we always choose the only path. */ path = 0x80; - /* Reset values prior to 'issueing the clear signal'. */ + /* Reset values prior to 'issuing the clear signal'. */ p->lpum = 0; p->pom = 0xff; s->flags &= ~SCSW_FLAGS_MASK_PNO; diff --git a/hw/timer/exynos4210_rtc.c b/hw/timer/exynos4210_rtc.c index 3f2c8c5578..026f81a2e3 100644 --- a/hw/timer/exynos4210_rtc.c +++ b/hw/timer/exynos4210_rtc.c @@ -67,7 +67,7 @@ #define CURTICNT 0x0090 #define TICK_TIMER_ENABLE 0x0100 -#define TICNT_THRESHHOLD 2 +#define TICNT_THRESHOLD 2 #define RTC_ENABLE 0x0001 @@ -429,7 +429,7 @@ static void exynos4210_rtc_write(void *opaque, hwaddr offset, s->reg_rtccon = value; break; case TICCNT: - if (value > TICNT_THRESHHOLD) { + if (value > TICNT_THRESHOLD) { s->reg_ticcnt = value; } else { fprintf(stderr, diff --git a/include/hw/bt.h b/include/hw/bt.h index 830af94735..3f365bcbcb 100644 --- a/include/hw/bt.h +++ b/include/hw/bt.h @@ -640,8 +640,8 @@ typedef struct { #define OCF_SETUP_SYNC_CONN 0x0028 typedef struct { uint16_t handle; - uint32_t tx_bandwith; - uint32_t rx_bandwith; + uint32_t tx_bandwidth; + uint32_t rx_bandwidth; uint16_t max_latency; uint16_t voice_setting; uint8_t retrans_effort; @@ -652,8 +652,8 @@ typedef struct { #define OCF_ACCEPT_SYNC_CONN_REQ 0x0029 typedef struct { bdaddr_t bdaddr; - uint32_t tx_bandwith; - uint32_t rx_bandwith; + uint32_t tx_bandwidth; + uint32_t rx_bandwidth; uint16_t max_latency; uint16_t voice_setting; uint8_t retrans_effort; diff --git a/libcacard/card_7816.c b/libcacard/card_7816.c index 8d06326da6..c28bb60fe6 100644 --- a/libcacard/card_7816.c +++ b/libcacard/card_7816.c @@ -232,7 +232,7 @@ vcard_apdu_set_class(VCardAPDU *apdu) { case 0xf0: default: apdu->a_gen_type = - (apdu->a_cla == 0xff) ? VCARD_7816_PTS : VCARD_7816_PROPIETARY; + (apdu->a_cla == 0xff) ? VCARD_7816_PTS : VCARD_7816_PROPRIETARY; break; } return VCARD7816_STATUS_SUCCESS; diff --git a/libcacard/card_7816t.h b/libcacard/card_7816t.h index 9333285d73..8eef0ce42c 100644 --- a/libcacard/card_7816t.h +++ b/libcacard/card_7816t.h @@ -43,7 +43,7 @@ typedef enum { VCARD_7816_ISO, VCARD_7816_RFU, VCARD_7816_PTS, - VCARD_7816_PROPIETARY + VCARD_7816_PROPRIETARY } VCardAPDUType; diff --git a/linux-headers/asm-powerpc/epapr_hcalls.h b/linux-headers/asm-powerpc/epapr_hcalls.h index 06f724786a..33b3f89f55 100644 --- a/linux-headers/asm-powerpc/epapr_hcalls.h +++ b/linux-headers/asm-powerpc/epapr_hcalls.h @@ -78,7 +78,7 @@ #define EV_SUCCESS 0 #define EV_EPERM 1 /* Operation not permitted */ #define EV_ENOENT 2 /* Entry Not Found */ -#define EV_EIO 3 /* I/O error occured */ +#define EV_EIO 3 /* I/O error occurred */ #define EV_EAGAIN 4 /* The operation had insufficient * resources to complete and should be * retried @@ -89,7 +89,7 @@ #define EV_ENODEV 7 /* No such device */ #define EV_EINVAL 8 /* An argument supplied to the hcall was out of range or invalid */ -#define EV_INTERNAL 9 /* An internal error occured */ +#define EV_INTERNAL 9 /* An internal error occurred */ #define EV_CONFIG 10 /* A configuration error was detected */ #define EV_INVALID_STATE 11 /* The object is in an invalid state */ #define EV_UNIMPLEMENTED 12 /* Unimplemented hypercall */ diff --git a/migration-rdma.c b/migration-rdma.c index 3d1266f40a..f540366944 100644 --- a/migration-rdma.c +++ b/migration-rdma.c @@ -756,7 +756,7 @@ static void qemu_rdma_dump_gid(const char *who, struct rdma_cm_id *id) * connections (both IPv4 and IPv6) if the destination machine does not have * a regular infiniband network available for use. * - * The only way to gaurantee that an error is thrown for broken kernels is + * The only way to guarantee that an error is thrown for broken kernels is * for the management software to choose a *specific* interface at bind time * and validate what time of hardware it is. * @@ -778,7 +778,7 @@ static void qemu_rdma_dump_gid(const char *who, struct rdma_cm_id *id) * Infiniband. * * If we detect that we have a *pure* RoCE environment, then we can safely - * thrown an error even if the management sofware has specified '[::]' as the + * thrown an error even if the management software has specified '[::]' as the * bind address. * * However, if there is are multiple hetergeneous devices, then we cannot make @@ -801,7 +801,7 @@ static int qemu_rdma_broken_ipv6_kernel(Error **errp, struct ibv_context *verbs) * devices (non-ethernet). * * If not, then we can safely proceed with the migration. - * Otherwise, there are no gaurantees until the bug is fixed in linux. + * Otherwise, there are no guarantees until the bug is fixed in linux. */ if (!verbs) { int num_devices, x; From c89aa2f1851b08c3efa8a1070c0a6b9a36e1227f Mon Sep 17 00:00:00 2001 From: "Michael R. Hines" Date: Sun, 18 Aug 2013 22:27:08 -0400 Subject: [PATCH 03/15] rdma: silly ipv6 bugfix My bad - but it's very important for us to warn the user that IPv6 is broken on RoCE in linux right now, until linux releases a fixed version. Signed-off-by: Michael R. Hines Signed-off-by: Michael Tokarev --- migration-rdma.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/migration-rdma.c b/migration-rdma.c index f540366944..05a155b93d 100644 --- a/migration-rdma.c +++ b/migration-rdma.c @@ -920,9 +920,11 @@ static int qemu_rdma_resolve_host(RDMAContext *rdma, Error **errp) ret = rdma_resolve_addr(rdma->cm_id, NULL, e->ai_dst_addr, RDMA_RESOLVE_TIMEOUT_MS); if (!ret) { - ret = qemu_rdma_broken_ipv6_kernel(errp, rdma->cm_id->verbs); - if (ret) { - continue; + if (e->ai_family == AF_INET6) { + ret = qemu_rdma_broken_ipv6_kernel(errp, rdma->cm_id->verbs); + if (ret) { + continue; + } } goto route; } From 714290979abf551d5116346e4fbd3d54eb24bd12 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Mon, 5 Aug 2013 20:16:40 +0100 Subject: [PATCH 04/15] configure: disable clang -Wstring-plus-int warning Some versions of clang will warn about adding integers to strings: disas/i386.c:4753:23: error: adding 'char' to a string does not append to the string [-Werror,-Wstring-plus-int] oappend ("%es:" + intel_syntax); ~~~~~~~^~~~~~~~~~~~~~ disas/i386.c:4753:23: note: use array indexing to silence this warning oappend ("%es:" + intel_syntax); ^ & [ ] disas/i386.c uses this idiom to to skip a "%" prefix if using intel rather than AT&T syntax. This seems like a reasonable thing to do, and I don't think anybody contributing to QEMU is likely to believe that '+' is a string concatenation operator in C, so just disable -Wstring-plus-int. Signed-off-by: Peter Maydell Signed-off-by: Michael Tokarev --- configure | 1 + 1 file changed, 1 insertion(+) diff --git a/configure b/configure index 0a55c20252..03157c7378 100755 --- a/configure +++ b/configure @@ -1204,6 +1204,7 @@ gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_ gcc_flags="-Wmissing-include-dirs -Wempty-body -Wnested-externs $gcc_flags" gcc_flags="-Wendif-labels $gcc_flags" gcc_flags="-Wno-initializer-overrides $gcc_flags" +gcc_flags="-Wno-string-plus-int $gcc_flags" # Note that we do not add -Werror to gcc_flags here, because that would # enable it for all configure tests. If a configure test failed due # to -Werror this would just silently disable some features, From ed6bc28e8a448b9005af50eed12893c5f7711c6e Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Fri, 23 Aug 2013 17:36:48 +0100 Subject: [PATCH 05/15] slirp/arp_table.c: Avoid shifting into sign bit of signed integers "0xf << 28" shifts right into the sign bit, since 0xf is a signed integer. Use the 'U' suffix to force an unsigned shift to avoid this undefined behaviour and a clang sanitizer warning. Signed-off-by: Peter Maydell Reviewed-by: Eric Blake Acked-by: Jan Kiszka Signed-off-by: Michael Tokarev --- slirp/arp_table.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/slirp/arp_table.c b/slirp/arp_table.c index bf698c1ac5..ecdb0baee4 100644 --- a/slirp/arp_table.c +++ b/slirp/arp_table.c @@ -38,7 +38,7 @@ void arp_table_add(Slirp *slirp, uint32_t ip_addr, uint8_t ethaddr[ETH_ALEN]) ethaddr[3], ethaddr[4], ethaddr[5])); /* Check 0.0.0.0/8 invalid source-only addresses */ - if ((ip_addr & htonl(~(0xf << 28))) == 0) { + if ((ip_addr & htonl(~(0xfU << 28))) == 0) { return; } @@ -74,7 +74,7 @@ bool arp_table_search(Slirp *slirp, uint32_t ip_addr, DEBUG_ARG("ip = 0x%x", ip_addr); /* Check 0.0.0.0/8 invalid source-only addresses */ - assert((ip_addr & htonl(~(0xf << 28))) != 0); + assert((ip_addr & htonl(~(0xfU << 28))) != 0); /* If broadcast address */ if (ip_addr == 0xffffffff || ip_addr == broadcast_addr) { From 5b21a2ae4dea72d9aa68e0385fc0548971e929f4 Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Mon, 26 Aug 2013 13:38:50 +0200 Subject: [PATCH 06/15] curl: qemu_bh_new() can never return NULL Drop error code path which cannot be taken since qemu_bh_new() does not return NULL. Signed-off-by: Stefan Hajnoczi Reviewed-by: Paolo Bonzini Signed-off-by: Michael Tokarev --- block/curl.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/block/curl.c b/block/curl.c index e566855f76..ca2cedcec1 100644 --- a/block/curl.c +++ b/block/curl.c @@ -572,12 +572,6 @@ static BlockDriverAIOCB *curl_aio_readv(BlockDriverState *bs, acb->nb_sectors = nb_sectors; acb->bh = qemu_bh_new(curl_readv_bh_cb, acb); - - if (!acb->bh) { - DPRINTF("CURL: qemu_bh_new failed\n"); - return NULL; - } - qemu_bh_schedule(acb->bh); return &acb->common; } From 1d984a67a95d88f3e708b077dab8adeb47c38c93 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Tue, 27 Aug 2013 15:12:41 +0200 Subject: [PATCH 07/15] configure: Don't write .pyc files by default (python -B) When a Python script is run, Python normally writes bytecode into a .pyc file. QEMU's build process uses several Python scripts which are called from configure or make. The generated .pyc files take disk space without being of much use, because those scripts are short, not time critical and only called a few times. Python's option -B disables writing of .pyc files. QEMU now uses "python -B" as default, but it is still possible to choose a different call by passing --python=PYTHON to configure. Signed-off-by: Stefan Weil Signed-off-by: Michael Tokarev --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 03157c7378..391b204c95 100755 --- a/configure +++ b/configure @@ -568,7 +568,7 @@ fi : ${make=${MAKE-make}} : ${install=${INSTALL-install}} -: ${python=${PYTHON-python}} +: ${python=${PYTHON-python -B}} : ${smbd=${SMBD-/usr/sbin/smbd}} # Default objcc to clang if available, otherwise use CC @@ -1349,7 +1349,7 @@ fi # Note that if the Python conditional here evaluates True we will exit # with status 1 which is a shell 'false' value. -if ! "$python" -c 'import sys; sys.exit(sys.version_info < (2,4) or sys.version_info >= (3,))'; then +if ! $python -c 'import sys; sys.exit(sys.version_info < (2,4) or sys.version_info >= (3,))'; then error_exit "Cannot use '$python', Python 2.4 or later is required." \ "Note that Python 3 or later is not yet supported." \ "Use --python=/path/to/python to specify a supported Python." From ca871ec8612cc0e95a02de83a3bdd01514e5733b Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Tue, 27 Aug 2013 21:09:12 +0200 Subject: [PATCH 08/15] configure: Remove unneeded redirections of stderr (pkg-config --cflags, --libs) For existing libraries, pkg-config --cflags and pkg-config --libs won't print error messages to stderr, so redirecting stderr is not necessary. Signed-off-by: Stefan Weil Signed-off-by: Michael Tokarev --- configure | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/configure b/configure index 391b204c95..9748deef45 100755 --- a/configure +++ b/configure @@ -1704,10 +1704,10 @@ if test "$gtk" != "no"; then fi gtk="no" else - gtk_cflags=`$pkg_config --cflags $gtkpackage 2>/dev/null` - gtk_libs=`$pkg_config --libs $gtkpackage 2>/dev/null` - vte_cflags=`$pkg_config --cflags $vtepackage 2>/dev/null` - vte_libs=`$pkg_config --libs $vtepackage 2>/dev/null` + gtk_cflags=`$pkg_config --cflags $gtkpackage` + gtk_libs=`$pkg_config --libs $gtkpackage` + vte_cflags=`$pkg_config --cflags $vtepackage` + vte_libs=`$pkg_config --libs $vtepackage` libs_softmmu="$gtk_libs $vte_libs $libs_softmmu" gtk="yes" fi @@ -1909,8 +1909,8 @@ int main(void) { } EOF if $pkg_config libpng --modversion >/dev/null 2>&1; then - vnc_png_cflags=`$pkg_config libpng --cflags 2> /dev/null` - vnc_png_libs=`$pkg_config libpng --libs 2> /dev/null` + vnc_png_cflags=`$pkg_config libpng --cflags` + vnc_png_libs=`$pkg_config libpng --libs` else vnc_png_cflags="" vnc_png_libs="-lpng" @@ -2241,8 +2241,8 @@ else fi if $pkg_config --atleast-version=$glib_req_ver gthread-2.0 > /dev/null 2>&1 then - glib_cflags=`$pkg_config --cflags gthread-2.0 2>/dev/null` - glib_libs=`$pkg_config --libs gthread-2.0 2>/dev/null` + glib_cflags=`$pkg_config --cflags gthread-2.0` + glib_libs=`$pkg_config --libs gthread-2.0` LIBS="$glib_libs $LIBS" libs_qga="$glib_libs $libs_qga" else @@ -2271,8 +2271,8 @@ if test "$pixman" = "none"; then pixman_cflags= pixman_libs= elif test "$pixman" = "system"; then - pixman_cflags=`$pkg_config --cflags pixman-1 2>/dev/null` - pixman_libs=`$pkg_config --libs pixman-1 2>/dev/null` + 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 not present. Your options:" \ @@ -2592,8 +2592,8 @@ fi if test "$glusterfs" != "no" ; then if $pkg_config --atleast-version=3 glusterfs-api >/dev/null 2>&1; then glusterfs="yes" - glusterfs_cflags=`$pkg_config --cflags glusterfs-api 2>/dev/null` - glusterfs_libs=`$pkg_config --libs glusterfs-api 2>/dev/null` + glusterfs_cflags=`$pkg_config --cflags glusterfs-api` + glusterfs_libs=`$pkg_config --libs glusterfs-api` CFLAGS="$CFLAGS $glusterfs_cflags" libs_tools="$glusterfs_libs $libs_tools" libs_softmmu="$glusterfs_libs $libs_softmmu" @@ -2962,8 +2962,8 @@ int main(void) { iscsi_unmap_sync(NULL,0,0,0,NULL,0); return 0; } EOF if $pkg_config --atleast-version=1.7.0 libiscsi --modversion >/dev/null 2>&1; then libiscsi="yes" - libiscsi_cflags=$($pkg_config --cflags libiscsi 2>/dev/null) - libiscsi_libs=$($pkg_config --libs libiscsi 2>/dev/null) + libiscsi_cflags=$($pkg_config --cflags libiscsi) + libiscsi_libs=$($pkg_config --libs libiscsi) CFLAGS="$CFLAGS $libiscsi_cflags" LIBS="$LIBS $libiscsi_libs" elif compile_prog "" "-liscsi" ; then @@ -3085,8 +3085,8 @@ if test "$libusb" != "no" ; then if $pkg_config --atleast-version=1.0.13 libusb-1.0 >/dev/null 2>&1 ; then libusb="yes" usb="libusb" - libusb_cflags=$($pkg_config --cflags libusb-1.0 2>/dev/null) - libusb_libs=$($pkg_config --libs libusb-1.0 2>/dev/null) + libusb_cflags=$($pkg_config --cflags libusb-1.0) + libusb_libs=$($pkg_config --libs libusb-1.0) QEMU_CFLAGS="$QEMU_CFLAGS $libusb_cflags" libs_softmmu="$libs_softmmu $libusb_libs" else @@ -3101,8 +3101,8 @@ fi if test "$usb_redir" != "no" ; then if $pkg_config --atleast-version=0.6 libusbredirparser-0.5 >/dev/null 2>&1 ; then usb_redir="yes" - usb_redir_cflags=$($pkg_config --cflags libusbredirparser-0.5 2>/dev/null) - usb_redir_libs=$($pkg_config --libs libusbredirparser-0.5 2>/dev/null) + usb_redir_cflags=$($pkg_config --cflags libusbredirparser-0.5) + usb_redir_libs=$($pkg_config --libs libusbredirparser-0.5) QEMU_CFLAGS="$QEMU_CFLAGS $usb_redir_cflags" libs_softmmu="$libs_softmmu $usb_redir_libs" else From 65d5d3f92246f056a45e4ddc6f13487de39cd47c Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Tue, 27 Aug 2013 21:09:13 +0200 Subject: [PATCH 09/15] configure: Remove unneeded redirections of stderr (pkg-config --exists) Predicate options (--exists, --atleast-version, ...) of pkg-config dont't print error messages to stderr, so redirecting stderr is not necessary. Combining a predicate option with --modversion is not necessary for tests. Instead of testing with --modversion, --exists can be used. Signed-off-by: Stefan Weil Signed-off-by: Michael Tokarev --- configure | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/configure b/configure index 9748deef45..43c0d21615 100755 --- a/configure +++ b/configure @@ -1470,7 +1470,7 @@ libs_softmmu="$libs_softmmu -lz" # libseccomp check if test "$seccomp" != "no" ; then - if $pkg_config --atleast-version=2.1.0 libseccomp --modversion >/dev/null 2>&1; then + if $pkg_config --atleast-version=2.1.0 libseccomp; then libs_softmmu="$libs_softmmu `$pkg_config --libs libseccomp`" QEMU_CFLAGS="$QEMU_CFLAGS `$pkg_config --cflags libseccomp`" seccomp="yes" @@ -1722,7 +1722,7 @@ if test "`basename $sdl_config`" != sdl-config && ! has ${sdl_config}; then sdl_config=sdl-config fi -if $pkg_config sdl --modversion >/dev/null 2>&1; then +if $pkg_config sdl --exists; then sdlconfig="$pkg_config sdl" _sdlversion=`$sdlconfig --modversion 2>/dev/null | sed 's/[^0-9]//g'` elif has ${sdl_config}; then @@ -1908,7 +1908,7 @@ int main(void) { return png_ptr != 0; } EOF - if $pkg_config libpng --modversion >/dev/null 2>&1; then + if $pkg_config libpng --exists; then vnc_png_cflags=`$pkg_config libpng --cflags` vnc_png_libs=`$pkg_config libpng --libs` else @@ -2187,7 +2187,7 @@ fi ########################################## # curl probe if test "$curl" != "no" ; then - if $pkg_config libcurl --modversion >/dev/null 2>&1; then + if $pkg_config libcurl --exists; then curlconfig="$pkg_config libcurl" else curlconfig=curl-config @@ -2239,8 +2239,7 @@ if test "$mingw32" = yes; then else glib_req_ver=2.12 fi -if $pkg_config --atleast-version=$glib_req_ver gthread-2.0 > /dev/null 2>&1 -then +if $pkg_config --atleast-version=$glib_req_ver gthread-2.0; then glib_cflags=`$pkg_config --cflags gthread-2.0` glib_libs=`$pkg_config --libs gthread-2.0` LIBS="$glib_libs $LIBS" @@ -2371,8 +2370,7 @@ fi # libssh2 probe min_libssh2_version=1.2.8 if test "$libssh2" != "no" ; then - if $pkg_config --atleast-version=$min_libssh2_version libssh2 >/dev/null 2>&1 - then + if $pkg_config --atleast-version=$min_libssh2_version libssh2; then libssh2_cflags=`$pkg_config libssh2 --cflags` libssh2_libs=`$pkg_config libssh2 --libs` libssh2=yes @@ -2590,14 +2588,14 @@ fi ########################################## # glusterfs probe if test "$glusterfs" != "no" ; then - if $pkg_config --atleast-version=3 glusterfs-api >/dev/null 2>&1; 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` CFLAGS="$CFLAGS $glusterfs_cflags" libs_tools="$glusterfs_libs $libs_tools" libs_softmmu="$glusterfs_libs $libs_softmmu" - if $pkg_config --atleast-version=5 glusterfs-api >/dev/null 2>&1; then + if $pkg_config --atleast-version=5 glusterfs-api; then glusterfs_discard="yes" fi else @@ -2960,7 +2958,7 @@ if test "$libiscsi" != "no" ; then #include int main(void) { iscsi_unmap_sync(NULL,0,0,0,NULL,0); return 0; } EOF - if $pkg_config --atleast-version=1.7.0 libiscsi --modversion >/dev/null 2>&1; then + if $pkg_config --atleast-version=1.7.0 libiscsi; then libiscsi="yes" libiscsi_cflags=$($pkg_config --cflags libiscsi) libiscsi_libs=$($pkg_config --libs libiscsi) @@ -3030,8 +3028,8 @@ int main(void) { spice_server_new(); return 0; } EOF spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null) spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null) - if $pkg_config --atleast-version=0.12.0 spice-server >/dev/null 2>&1 && \ - $pkg_config --atleast-version=0.12.3 spice-protocol > /dev/null 2>&1 && \ + if $pkg_config --atleast-version=0.12.0 spice-server && \ + $pkg_config --atleast-version=0.12.3 spice-protocol && \ compile_prog "$spice_cflags" "$spice_libs" ; then spice="yes" libs_softmmu="$libs_softmmu $spice_libs" @@ -3066,7 +3064,7 @@ EOF test_cflags="-Werror $test_cflags" fi if test -n "$libtool" && - $pkg_config --atleast-version=3.12.8 nss >/dev/null 2>&1 && \ + $pkg_config --atleast-version=3.12.8 nss && \ compile_prog "$test_cflags" "$libcacard_libs"; then smartcard_nss="yes" QEMU_CFLAGS="$QEMU_CFLAGS $libcacard_cflags" @@ -3082,7 +3080,7 @@ fi # check for libusb if test "$libusb" != "no" ; then - if $pkg_config --atleast-version=1.0.13 libusb-1.0 >/dev/null 2>&1 ; then + if $pkg_config --atleast-version=1.0.13 libusb-1.0; then libusb="yes" usb="libusb" libusb_cflags=$($pkg_config --cflags libusb-1.0) @@ -3099,7 +3097,7 @@ fi # check for usbredirparser for usb network redirection support if test "$usb_redir" != "no" ; then - if $pkg_config --atleast-version=0.6 libusbredirparser-0.5 >/dev/null 2>&1 ; then + if $pkg_config --atleast-version=0.6 libusbredirparser-0.5; then usb_redir="yes" usb_redir_cflags=$($pkg_config --cflags libusbredirparser-0.5) usb_redir_libs=$($pkg_config --libs libusbredirparser-0.5) From 56f99ea19b5ae71cfdc0bd147cba372da3b63c44 Mon Sep 17 00:00:00 2001 From: Antony Pavlov Date: Wed, 28 Aug 2013 07:59:37 +0400 Subject: [PATCH 10/15] pflash_cfi02.c: fix debug macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If PFLASH_DEBUG is enabled then we have some build errors: hw/block/pflash_cfi02.c: In function ‘pflash_timer’: hw/block/pflash_cfi02.c:128:5: error: expected ‘)’ before string constant hw/block/pflash_cfi02.c:128:5: error: too few arguments to function ‘fprintf’ This patch fixes the problem. Signed-off-by: Antony Pavlov Signed-off-by: Michael Tokarev --- hw/block/pflash_cfi02.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/pflash_cfi02.c b/hw/block/pflash_cfi02.c index 99445b09b9..8d4b828edf 100644 --- a/hw/block/pflash_cfi02.c +++ b/hw/block/pflash_cfi02.c @@ -47,7 +47,7 @@ #ifdef PFLASH_DEBUG #define DPRINTF(fmt, ...) \ do { \ - fprintf(stderr "PFLASH: " fmt , ## __VA_ARGS__); \ + fprintf(stderr, "PFLASH: " fmt , ## __VA_ARGS__); \ } while (0) #else #define DPRINTF(fmt, ...) do { } while (0) From e0c270d946dc8efd723129b6a9d956b3084b55b1 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Wed, 28 Aug 2013 06:39:56 +0200 Subject: [PATCH 11/15] target-arm: Report unimplemented opcodes (LOG_UNIMP) These unimplemented opcodes are handled like illegal opcodes, but they are used in existing code. We should at least report when they are executed. Signed-off-by: Stefan Weil Reviewed-by: Peter Maydell Signed-off-by: Michael Tokarev --- target-arm/translate.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target-arm/translate.c b/target-arm/translate.c index d1e8538142..92d9f1637f 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -6715,6 +6715,7 @@ static void disas_arm_insn(CPUARMState * env, DisasContext *s) /* setend */ if (((insn >> 9) & 1) != s->bswap_code) { /* Dynamic endianness switching not implemented. */ + qemu_log_mask(LOG_UNIMP, "arm: unimplemented setend\n"); goto illegal_op; } return; @@ -8740,6 +8741,8 @@ static int disas_thumb2_insn(CPUARMState *env, DisasContext *s, uint16_t insn_hw if (insn & (1 << 26)) { /* Secure monitor call (v6Z) */ + qemu_log_mask(LOG_UNIMP, + "arm: unimplemented secure monitor call\n"); goto illegal_op; /* not implemented. */ } else { op = (insn >> 20) & 7; @@ -9779,6 +9782,7 @@ static void disas_thumb_insn(CPUARMState *env, DisasContext *s) ARCH(6); if (((insn >> 3) & 1) != s->bswap_code) { /* Dynamic endianness switching not implemented. */ + qemu_log_mask(LOG_UNIMP, "arm: unimplemented setend\n"); goto illegal_op; } break; From a32b12741bf45bf3f46bffe5a79cb2548a060cd8 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Wed, 28 Aug 2013 19:28:06 +0200 Subject: [PATCH 12/15] tci: Remove function tcg_out64 (fix broken build) Commit ac26eb69a311396668809eadbf7ff4e623447d4c added tcg_out64 to tcg/tcg.c. tcg/tci/tcg-target.c already had a nearly identical implementation which is now removed to fix a compiler error. Signed-off-by: Stefan Weil Reviewed-by: Richard Henderson Signed-off-by: Michael Tokarev --- tcg/tci/tcg-target.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tcg/tci/tcg-target.c b/tcg/tci/tcg-target.c index e118bc7179..eb23832d7e 100644 --- a/tcg/tci/tcg-target.c +++ b/tcg/tci/tcg-target.c @@ -415,13 +415,6 @@ static void tcg_out_i(TCGContext *s, tcg_target_ulong v) s->code_ptr += sizeof(tcg_target_ulong); } -/* Write 64 bit value. */ -static void tcg_out64(TCGContext *s, uint64_t v) -{ - *(uint64_t *)s->code_ptr = v; - s->code_ptr += sizeof(v); -} - /* Write opcode. */ static void tcg_out_op_t(TCGContext *s, TCGOpcode op) { From 586b546657da7a762106abb5056d90a140d1a2f5 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Fri, 30 Aug 2013 14:44:11 -0600 Subject: [PATCH 13/15] qmp: fix integer usage in examples Per the qapi schema, block_set_io_throttle takes most arguments as ints, not strings. * qmp-commands.hx (block_set_io_throttle): Use correct type. Fix whitespace and a copy-paste bug in the process. Signed-off-by: Eric Blake Reviewed-by: Benoit Canet Signed-off-by: Michael Tokarev --- qmp-commands.hx | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/qmp-commands.hx b/qmp-commands.hx index bb09e72712..8a8f342eab 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -1402,22 +1402,22 @@ Change I/O throttle limits for a block drive. Arguments: - "device": device name (json-string) -- "bps": total throughput limit in bytes per second(json-int) -- "bps_rd": read throughput limit in bytes per second(json-int) -- "bps_wr": read throughput limit in bytes per second(json-int) -- "iops": total I/O operations per second(json-int) -- "iops_rd": read I/O operations per second(json-int) -- "iops_wr": write I/O operations per second(json-int) +- "bps": total throughput limit in bytes per second (json-int) +- "bps_rd": read throughput limit in bytes per second (json-int) +- "bps_wr": write throughput limit in bytes per second (json-int) +- "iops": total I/O operations per second (json-int) +- "iops_rd": read I/O operations per second (json-int) +- "iops_wr": write I/O operations per second (json-int) Example: -> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0", - "bps": "1000000", - "bps_rd": "0", - "bps_wr": "0", - "iops": "0", - "iops_rd": "0", - "iops_wr": "0" } } + "bps": 1000000, + "bps_rd": 0, + "bps_wr": 0, + "iops": 0, + "iops_rd": 0, + "iops_wr": 0 } } <- { "return": {} } EQMP @@ -1791,7 +1791,7 @@ Each json-object contain the following: - "vm-state-size": size of the VM state in bytes (json-int) - "date-sec": UTC date of the snapshot in seconds (json-int) - "date-nsec": fractional part in nanoseconds to be used with - date-sec(json-int) + date-sec (json-int) - "vm-clock-sec": VM clock relative to boot in seconds (json-int) - "vm-clock-nsec": fractional part in nanoseconds to be used From 2b21fb57af305f17841d79e7e2e02ad1aec3f5ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Wed, 14 Aug 2013 11:49:04 +0200 Subject: [PATCH 14/15] adlib: sort offsets in portio registration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes the following assert when -device adlib is used: ioport.c:240: portio_list_add: Assertion `pio->offset >= off_last' failed. Signed-off-by: Hervé Poussineau Signed-off-by: Michael Tokarev --- hw/audio/adlib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/audio/adlib.c b/hw/audio/adlib.c index 0c792475d1..bd8e9d9815 100644 --- a/hw/audio/adlib.c +++ b/hw/audio/adlib.c @@ -284,9 +284,9 @@ static void Adlib_fini (AdlibState *s) } static MemoryRegionPortio adlib_portio_list[] = { - { 0x388, 4, 1, .read = adlib_read, .write = adlib_write, }, { 0, 4, 1, .read = adlib_read, .write = adlib_write, }, { 0, 2, 1, .read = adlib_read, .write = adlib_write, }, + { 0x388, 4, 1, .read = adlib_read, .write = adlib_write, }, PORTIO_END_OF_LIST(), }; From fcdda211f9239f4218f96cdc336a482f7103d90b Mon Sep 17 00:00:00 2001 From: Alex Bligh Date: Thu, 29 Aug 2013 23:32:14 +0100 Subject: [PATCH 15/15] aio / timers: use g_usleep() not sleep() sleep() apparently doesn't exist under mingw. Use g_usleep for portability. Signed-off-by: Alex Bligh Reviewed-by: Stefan Weil Signed-off-by: Michael Tokarev --- tests/test-aio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test-aio.c b/tests/test-aio.c index 07a1f61f87..532a1de3f9 100644 --- a/tests/test-aio.c +++ b/tests/test-aio.c @@ -396,7 +396,7 @@ static void test_timer_schedule(void) g_assert(!aio_poll(ctx, false)); g_assert_cmpint(data.n, ==, 0); - sleep(1); + g_usleep(1 * G_USEC_PER_SEC); g_assert_cmpint(data.n, ==, 0); g_assert(aio_poll(ctx, false)); @@ -729,7 +729,7 @@ static void test_source_timer_schedule(void) g_assert_cmpint(data.n, ==, 0); - sleep(1); + g_usleep(1 * G_USEC_PER_SEC); g_assert_cmpint(data.n, ==, 0); g_assert(g_main_context_iteration(NULL, false)); @@ -739,7 +739,7 @@ static void test_source_timer_schedule(void) do { g_assert(g_main_context_iteration(NULL, true)); } while (qemu_clock_get_ns(data.clock_type) <= expiry); - sleep(1); + g_usleep(1 * G_USEC_PER_SEC); g_main_context_iteration(NULL, false); g_assert_cmpint(data.n, ==, 2);