Skip to contentSkip to conversation

Trivial patches for 2013-09-02

GIT PULL Michael Tokarev 1 participant 16 messages Sep 2, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hello. Here's one another pull request for the trivial patches queue. The request comes somewhat out of order, but this is because I was at a 3-week vacation and the trivial-patches queue hasn't been processed during this time, and it accumulated a few patches which are pre- dependences for further work.

Please consider pulling.

/mjt

The following changes since commit 4ff78e0dbcd5c795962567fdc1b31e9e03c55b07:

Merge remote-tracking branch 'luiz/queue/qmp' into staging (2013-08-30 12:26:04 -0500)

are available in the git repository at:

git://git.corpit.ru/qemu.git trivial-patches

for you to fetch changes up to fcdda211f9239f4218f96cdc336a482f7103d90b:

aio / timers: use g_usleep() not sleep() (2013-09-01 20:02:45 +0400)

----------------------------------------------------------------
Alex Bligh (1):
aio / timers: use g_usleep() not sleep()

Antony Pavlov (1):
pflash_cfi02.c: fix debug macro

Eric Blake (1):
qmp: fix integer usage in examples

Hervé Poussineau (1):
adlib: sort offsets in portio registration

Michael R. Hines (1):
rdma: silly ipv6 bugfix

Peter Maydell (2):
configure: disable clang -Wstring-plus-int warning slirp/arp_table.c: Avoid shifting into sign bit of signed integers

Stefan Hajnoczi (1):
curl: qemu_bh_new() can never return NULL

Stefan Weil (6):
misc: Fix some typos in names and comments
configure: Don't write .pyc files by default (python -B)
configure: Remove unneeded redirections of stderr (pkg-config --cflags, --libs)
configure: Remove unneeded redirections of stderr (pkg-config --exists)
target-arm: Report unimplemented opcodes (LOG_UNIMP)
tci: Remove function tcg_out64 (fix broken build)

Taimoor Mirza (1):
slirp: Port redirection option behave differently on Linux and Windows

 block/backup.c                           |    2 +-
 block/curl.c                             |    6 ------
 configure                                |   71 +++++++++++++++++++++++++++++++++++------------------------------------
 hw/audio/adlib.c                         |    2 +-
 hw/block/pflash_cfi02.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                         |   14 ++++++++------
 qmp-commands.hx                          |   26 +++++++++++++-------------
 slirp/arp_table.c                        |    4 ++--
 slirp/socket.c                           |    2 ++
 target-arm/translate.c                   |    4 ++++
 tcg/tci/tcg-target.c                     |    7 -------
 tests/test-aio.c                         |    6 +++---
 18 files changed, 81 insertions(+), 87 deletions(-)
#1 lore raw

[Qemu-devel] [PULL 01/15] slirp: Port redirection option behave differently on Linux and Windows

From: Taimoor Mirza <[email protected]>

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

---
 slirp/socket.c |    2 ++
 1 file changed, 2 insertions(+)
slirp/socket.c +2 -0
index 8e8819c..25d60e7 100644
@@ -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 */
Signature · 1 line
1.7.10.4
#2 lore raw

[Qemu-devel] [PULL 02/15] misc: Fix some typos in names and comments

In reply to Michael Tokarev

From: Stefan Weil <[email protected]>

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

---
 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(-)
block/backup.c +1 -1
index e12b3b1..23c7264 100644
@@ -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
hw/s390x/css.c +1 -1
index 93b0b97..101da63 100644
@@ -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;
hw/timer/exynos4210_rtc.c +2 -2
index 3f2c8c5..026f81a 100644
@@ -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,
include/hw/bt.h +4 -4
index 830af94..3f365bc 100644
@@ -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;
libcacard/card_7816.c +1 -1
index 8d06326..c28bb60 100644
@@ -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;
libcacard/card_7816t.h +1 -1
index 9333285..8eef0ce 100644
@@ -43,7 +43,7 @@ typedef enum {
     VCARD_7816_ISO,
     VCARD_7816_RFU,
     VCARD_7816_PTS,
-    VCARD_7816_PROPIETARY
+    VCARD_7816_PROPRIETARY
 } VCardAPDUType;
 
 
linux-headers/asm-powerpc/epapr_hcalls.h +2 -2
index 06f7247..33b3f89 100644
@@ -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 */
migration-rdma.c +3 -3
index 3d1266f..f540366 100644
@@ -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;
Signature · 1 line
1.7.10.4
#3 lore raw

[Qemu-devel] [PULL 04/15] configure: disable clang -Wstring-plus-int warning

In reply to Michael Tokarev

From: Peter Maydell <[email protected]>

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.

---
 configure |    1 +
 1 file changed, 1 insertion(+)
configure +1 -0
index 0a55c20..03157c7 100755
@@ -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,
Signature · 1 line
1.7.10.4
#4 lore raw

[Qemu-devel] [PULL 03/15] rdma: silly ipv6 bugfix

In reply to Michael Tokarev

From: "Michael R. Hines" <[email protected]>

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.

---
 migration-rdma.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
migration-rdma.c +5 -3
index f540366..05a155b 100644
@@ -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;
         }
Signature · 1 line
1.7.10.4
#5 lore raw

[Qemu-devel] [PULL 08/15] configure: Remove unneeded redirections of stderr (pkg-config --cflags, --libs)

In reply to Michael Tokarev

From: Stefan Weil <[email protected]>

For existing libraries, pkg-config --cflags and pkg-config --libs won't print error messages to stderr, so redirecting stderr is not necessary.

---
 configure |   36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)
configure +18 -18
index 391b204..9748dee 100755
@@ -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
Signature · 1 line
1.7.10.4
#6 lore raw

[Qemu-devel] [PULL 12/15] tci: Remove function tcg_out64 (fix broken build)

In reply to Michael Tokarev

From: Stefan Weil <[email protected]>

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.

---
 tcg/tci/tcg-target.c |    7 -------
 1 file changed, 7 deletions(-)
tcg/tci/tcg-target.c +0 -7
index e118bc7..eb23832 100644
@@ -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)
 {
Signature · 1 line
1.7.10.4
#7 lore raw

[Qemu-devel] [PULL 11/15] target-arm: Report unimplemented opcodes (LOG_UNIMP)

In reply to Michael Tokarev

From: Stefan Weil <[email protected]>

These unimplemented opcodes are handled like illegal opcodes, but they are used in existing code. We should at least report when they are executed.

---
 target-arm/translate.c |    4 ++++
 1 file changed, 4 insertions(+)
target-arm/translate.c +4 -0
index d1e8538..92d9f16 100644
@@ -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;
Signature · 1 line
1.7.10.4
#8 lore raw

[Qemu-devel] [PULL 13/15] qmp: fix integer usage in examples

In reply to Michael Tokarev

From: Eric Blake <[email protected]>

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.

---
 qmp-commands.hx |   26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
qmp-commands.hx +13 -13
index bb09e72..8a8f342 100644
@@ -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
Signature · 1 line
1.7.10.4
#9 lore raw

[Qemu-devel] [PULL 05/15] slirp/arp_table.c: Avoid shifting into sign bit of signed integers

In reply to Michael Tokarev

From: Peter Maydell <[email protected]>

"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.

---
 slirp/arp_table.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
slirp/arp_table.c +2 -2
index bf698c1..ecdb0ba 100644
@@ -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) {
Signature · 1 line
1.7.10.4
#10 lore raw

[Qemu-devel] [PULL 10/15] pflash_cfi02.c: fix debug macro

In reply to Michael Tokarev

From: Antony Pavlov <[email protected]>

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.

---
 hw/block/pflash_cfi02.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/block/pflash_cfi02.c +1 -1
index 99445b0..8d4b828 100644
@@ -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)
Signature · 1 line
1.7.10.4
#11 lore raw

[Qemu-devel] [PULL 07/15] configure: Don't write .pyc files by default (python -B)

In reply to Michael Tokarev

From: Stefan Weil <[email protected]>

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.

---
 configure |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
configure +2 -2
index 03157c7..391b204 100755
@@ -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."
Signature · 1 line
1.7.10.4
#12 lore raw

[Qemu-devel] [PULL 14/15] adlib: sort offsets in portio registration

In reply to Michael Tokarev

From: Hervé Poussineau <[email protected]>

This fixes the following assert when -device adlib is used:
ioport.c:240: portio_list_add: Assertion `pio->offset >= off_last' failed.

---
 hw/audio/adlib.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/audio/adlib.c +1 -1
index 0c79247..bd8e9d9 100644
@@ -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(),
 };
 
Signature · 1 line
1.7.10.4
#13 lore raw

[Qemu-devel] [PULL 09/15] configure: Remove unneeded redirections of stderr (pkg-config --exists)

In reply to Michael Tokarev

From: Stefan Weil <[email protected]>

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.

---
 configure |   30 ++++++++++++++----------------
 1 file changed, 14 insertions(+), 16 deletions(-)
configure +14 -16
index 9748dee..43c0d21 100755
@@ -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 <iscsi/iscsi.h>
 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)
Signature · 1 line
1.7.10.4
#14 lore raw

[Qemu-devel] [PULL 15/15] aio / timers: use g_usleep() not sleep()

In reply to Michael Tokarev

From: Alex Bligh <[email protected]>

sleep() apparently doesn't exist under mingw. Use g_usleep for portability.

---
 tests/test-aio.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tests/test-aio.c +3 -3
index 07a1f61..532a1de 100644
@@ -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);
Signature · 1 line
1.7.10.4
#15 lore raw

[Qemu-devel] [PULL 06/15] curl: qemu_bh_new() can never return NULL

In reply to Michael Tokarev

From: Stefan Hajnoczi <[email protected]>

Drop error code path which cannot be taken since qemu_bh_new() does not return NULL.

---
 block/curl.c |    6 ------
 1 file changed, 6 deletions(-)
block/curl.c +0 -6
index e566855..ca2cedc 100644
@@ -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;
 }
Signature · 1 line
1.7.10.4