All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 00/13] Trivial patches for 2017-07-12
@ 2017-07-12 13:37 Michael Tokarev
  2017-07-12 13:37 ` [Qemu-devel] [PULL 01/13] target/xtensa: gdbstub: drop dead return statement Michael Tokarev
                   ` (13 more replies)
  0 siblings, 14 replies; 16+ messages in thread
From: Michael Tokarev @ 2017-07-12 13:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Tokarev, qemu-trivial

The following changes since commit 6b06e3e49eb8c91cc286c16d6bf3181ac296f33d:

  Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2017-07-10-v2' into staging (2017-07-10 16:12:47 +0100)

are available in the git repository at:

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

for you to fetch changes up to 10cb4ec41734243b2798bd1d53919827eaccd673:

  qobject: Update coccinelle script to catch Q{INC, DEC}REF (2017-07-12 16:34:44 +0300)

----------------------------------------------------------------
trivial patches for 2017-07-12

----------------------------------------------------------------
Eric Blake (2):
      qobject: Catch another straggler for use of qdict_put_str()
      qobject: Update coccinelle script to catch Q{INC, DEC}REF

Li Ping (1):
      qga-win32: Fix memory leak of device information set

Mao Zhongyi (1):
      util/qemu-sockets: Drop unused helper socket_address_to_string()

Max Filippov (1):
      target/xtensa: gdbstub: drop dead return statement

Paolo Bonzini (1):
      hxtool: remove dead -q option

Peter Maydell (2):
      configure: Handle having no c++ compiler in FORTIFY_SOURCE check
      include/hw/ptimer.h: Add documentation comments

Philippe Mathieu-Daudé (4):
      hw/misc: add missing includes
      hw/pci: define msi_nonbroken in pci-stub
      elf-loader: warn about invalid endianness
      hw/core: fix missing return value in load_image_targphys_as()

Thomas Huth (1):
      configure: Fix build with pkg-config and --static --enable-sdl

 configure                        |   8 ++-
 hw/core/loader.c                 |   5 +-
 hw/pci/pci-stub.c                |   3 +
 include/hw/misc/unimp.h          |   2 +
 include/hw/ptimer.h              | 120 +++++++++++++++++++++++++++++++++++++++
 include/qemu/sockets.h           |  15 -----
 qemu-img.c                       |   2 +-
 qga/commands-win32.c             |   5 +-
 scripts/coccinelle/qobject.cocci |   6 ++
 scripts/hxtool                   |  46 +--------------
 target/xtensa/gdbstub.c          |   1 -
 util/qemu-sockets.c              |  34 -----------
 12 files changed, 147 insertions(+), 100 deletions(-)

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Qemu-devel] [PULL 01/13] target/xtensa: gdbstub: drop dead return statement
  2017-07-12 13:37 [Qemu-devel] [PULL 00/13] Trivial patches for 2017-07-12 Michael Tokarev
@ 2017-07-12 13:37 ` Michael Tokarev
  2017-07-12 13:37 ` [Qemu-devel] [PULL 02/13] util/qemu-sockets: Drop unused helper socket_address_to_string() Michael Tokarev
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Michael Tokarev @ 2017-07-12 13:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: Max Filippov, qemu-trivial, Michael Tokarev

From: Max Filippov <jcmvbkbc@gmail.com>

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 target/xtensa/gdbstub.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/xtensa/gdbstub.c b/target/xtensa/gdbstub.c
index da131ae8cc..d78a1b437d 100644
--- a/target/xtensa/gdbstub.c
+++ b/target/xtensa/gdbstub.c
@@ -72,7 +72,6 @@ int xtensa_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
                       __func__, n, reg->type);
         memset(mem_buf, 0, reg->size);
         return reg->size;
-        return 0;
     }
 }
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [Qemu-devel] [PULL 02/13] util/qemu-sockets: Drop unused helper socket_address_to_string()
  2017-07-12 13:37 [Qemu-devel] [PULL 00/13] Trivial patches for 2017-07-12 Michael Tokarev
  2017-07-12 13:37 ` [Qemu-devel] [PULL 01/13] target/xtensa: gdbstub: drop dead return statement Michael Tokarev
@ 2017-07-12 13:37 ` Michael Tokarev
  2017-07-12 13:37 ` [Qemu-devel] [PULL 03/13] configure: Fix build with pkg-config and --static --enable-sdl Michael Tokarev
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Michael Tokarev @ 2017-07-12 13:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: Mao Zhongyi, qemu-trivial, Michael Tokarev

From: Mao Zhongyi <maozy.fnst@cn.fujitsu.com>

Signed-off-by: Mao Zhongyi <maozy.fnst@cn.fujitsu.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 include/qemu/sockets.h | 15 ---------------
 util/qemu-sockets.c    | 34 ----------------------------------
 2 files changed, 49 deletions(-)

diff --git a/include/qemu/sockets.h b/include/qemu/sockets.h
index 5c326db232..ef6b5591f7 100644
--- a/include/qemu/sockets.h
+++ b/include/qemu/sockets.h
@@ -106,21 +106,6 @@ SocketAddress *socket_local_address(int fd, Error **errp);
 SocketAddress *socket_remote_address(int fd, Error **errp);
 
 /**
- * socket_address_to_string:
- * @addr: the socket address struct
- * @errp: pointer to uninitialized error object
- *
- * Get the string representation of the socket
- * address. A pointer to the char array containing
- * string format will be returned, the caller is
- * required to release the returned value when no
- * longer required with g_free.
- *
- * Returns: the socket address in string format, or NULL on error
- */
-char *socket_address_to_string(struct SocketAddress *addr, Error **errp);
-
-/**
  * socket_address_flatten:
  * @addr: the socket address to flatten
  *
diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
index d3e51089de..55b6c17f5f 100644
--- a/util/qemu-sockets.c
+++ b/util/qemu-sockets.c
@@ -1325,40 +1325,6 @@ SocketAddress *socket_remote_address(int fd, Error **errp)
     return socket_sockaddr_to_address(&ss, sslen, errp);
 }
 
-char *socket_address_to_string(struct SocketAddress *addr, Error **errp)
-{
-    char *buf;
-    InetSocketAddress *inet;
-
-    switch (addr->type) {
-    case SOCKET_ADDRESS_TYPE_INET:
-        inet = &addr->u.inet;
-        if (strchr(inet->host, ':') == NULL) {
-            buf = g_strdup_printf("%s:%s", inet->host, inet->port);
-        } else {
-            buf = g_strdup_printf("[%s]:%s", inet->host, inet->port);
-        }
-        break;
-
-    case SOCKET_ADDRESS_TYPE_UNIX:
-        buf = g_strdup(addr->u.q_unix.path);
-        break;
-
-    case SOCKET_ADDRESS_TYPE_FD:
-        buf = g_strdup(addr->u.fd.str);
-        break;
-
-    case SOCKET_ADDRESS_TYPE_VSOCK:
-        buf = g_strdup_printf("%s:%s",
-                              addr->u.vsock.cid,
-                              addr->u.vsock.port);
-        break;
-
-    default:
-        abort();
-    }
-    return buf;
-}
 
 SocketAddress *socket_address_flatten(SocketAddressLegacy *addr_legacy)
 {
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [Qemu-devel] [PULL 03/13] configure: Fix build with pkg-config and --static --enable-sdl
  2017-07-12 13:37 [Qemu-devel] [PULL 00/13] Trivial patches for 2017-07-12 Michael Tokarev
  2017-07-12 13:37 ` [Qemu-devel] [PULL 01/13] target/xtensa: gdbstub: drop dead return statement Michael Tokarev
  2017-07-12 13:37 ` [Qemu-devel] [PULL 02/13] util/qemu-sockets: Drop unused helper socket_address_to_string() Michael Tokarev
@ 2017-07-12 13:37 ` Michael Tokarev
  2017-07-12 13:38 ` [Qemu-devel] [PULL 04/13] hw/misc: add missing includes Michael Tokarev
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Michael Tokarev @ 2017-07-12 13:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: Thomas Huth, qemu-trivial, Michael Tokarev

From: Thomas Huth <thuth@redhat.com>

The configure script prefers pkg-config over sdl-config, but
the "--static-libs" parameter only exists for the latter. With
pkg-config, "--static --libs" have to be used instead.

Buglink: https://bugs.launchpad.net/qemu/+bug/984516
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 configure | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 806658c98b..ce7e8aa842 100755
--- a/configure
+++ b/configure
@@ -2733,7 +2733,11 @@ int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
 EOF
   sdl_cflags=$($sdlconfig --cflags 2>/dev/null)
   if test "$static" = "yes" ; then
-    sdl_libs=$($sdlconfig --static-libs 2>/dev/null)
+    if $pkg_config $sdlname --exists; then
+      sdl_libs=$($pkg_config $sdlname --static --libs 2>/dev/null)
+    else
+      sdl_libs=$($sdlconfig --static-libs 2>/dev/null)
+    fi
   else
     sdl_libs=$($sdlconfig --libs 2>/dev/null)
   fi
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [Qemu-devel] [PULL 04/13] hw/misc: add missing includes
  2017-07-12 13:37 [Qemu-devel] [PULL 00/13] Trivial patches for 2017-07-12 Michael Tokarev
                   ` (2 preceding siblings ...)
  2017-07-12 13:37 ` [Qemu-devel] [PULL 03/13] configure: Fix build with pkg-config and --static --enable-sdl Michael Tokarev
@ 2017-07-12 13:38 ` Michael Tokarev
  2017-07-12 13:38 ` [Qemu-devel] [PULL 05/13] hw/pci: define msi_nonbroken in pci-stub Michael Tokarev
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Michael Tokarev @ 2017-07-12 13:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé, qemu-trivial, Michael Tokarev

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

inlined create_unimplemented_device() calls sysbus_mmio_map_overlap().

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 include/hw/misc/unimp.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/hw/misc/unimp.h b/include/hw/misc/unimp.h
index 3462d85836..52e068ec3e 100644
--- a/include/hw/misc/unimp.h
+++ b/include/hw/misc/unimp.h
@@ -8,6 +8,8 @@
 #ifndef HW_MISC_UNIMP_H
 #define HW_MISC_UNIMP_H
 
+#include "hw/sysbus.h"
+
 #define TYPE_UNIMPLEMENTED_DEVICE "unimplemented-device"
 
 /**
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [Qemu-devel] [PULL 05/13] hw/pci: define msi_nonbroken in pci-stub
  2017-07-12 13:37 [Qemu-devel] [PULL 00/13] Trivial patches for 2017-07-12 Michael Tokarev
                   ` (3 preceding siblings ...)
  2017-07-12 13:38 ` [Qemu-devel] [PULL 04/13] hw/misc: add missing includes Michael Tokarev
@ 2017-07-12 13:38 ` Michael Tokarev
  2017-07-12 13:38 ` [Qemu-devel] [PULL 06/13] configure: Handle having no c++ compiler in FORTIFY_SOURCE check Michael Tokarev
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Michael Tokarev @ 2017-07-12 13:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé, qemu-trivial, Michael Tokarev

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

The kludged field 'msi_nonbroken' is declared in "hw/pci/msi.h" and defined in
hw/pci/msi.c.
When using an ARM config with CONFIG_PCI disabled, hw/pci/msi.c is not included.
Without being PCI-related, the files hw/intc/arm_gicv[23*].c do access this
field (to enable the kludge if PCI is enabled).
The final link fails since hw/pci/msi.c is not included.
Defining this field in pci-stub is safe enough for configs without CONFIG_PCI.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/pci/pci-stub.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/hw/pci/pci-stub.c b/hw/pci/pci-stub.c
index 36d2c430c5..ecad664946 100644
--- a/hw/pci/pci-stub.c
+++ b/hw/pci/pci-stub.c
@@ -24,6 +24,9 @@
 #include "qapi/qmp/qerror.h"
 #include "hw/pci/pci.h"
 #include "qmp-commands.h"
+#include "hw/pci/msi.h"
+
+bool msi_nonbroken;
 
 PciInfoList *qmp_query_pci(Error **errp)
 {
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [Qemu-devel] [PULL 06/13] configure: Handle having no c++ compiler in FORTIFY_SOURCE check
  2017-07-12 13:37 [Qemu-devel] [PULL 00/13] Trivial patches for 2017-07-12 Michael Tokarev
                   ` (4 preceding siblings ...)
  2017-07-12 13:38 ` [Qemu-devel] [PULL 05/13] hw/pci: define msi_nonbroken in pci-stub Michael Tokarev
@ 2017-07-12 13:38 ` Michael Tokarev
  2017-07-12 13:38 ` [Qemu-devel] [PULL 07/13] elf-loader: warn about invalid endianness Michael Tokarev
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Michael Tokarev @ 2017-07-12 13:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, qemu-trivial, Michael Tokarev

From: Peter Maydell <peter.maydell@linaro.org>

Our FORTIFY_SOURCE check assumes that $cxx refers to a working C++
compiler, with the result that if you don't happen to have one
then configure will spuriously print
  configure: line 4685: c++: command not found

Fix this by adding a 'has $cxx' check.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index ce7e8aa842..08ef54103e 100755
--- a/configure
+++ b/configure
@@ -4771,7 +4771,7 @@ fi
 if test "$fortify_source" != "no"; then
   if echo | $cc -dM -E - | grep __clang__ > /dev/null 2>&1 ; then
     fortify_source="no";
-  elif test -n "$cxx" &&
+  elif test -n "$cxx" && has $cxx &&
        echo | $cxx -dM -E - | grep __clang__ >/dev/null 2>&1 ; then
     fortify_source="no";
   else
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [Qemu-devel] [PULL 07/13] elf-loader: warn about invalid endianness
  2017-07-12 13:37 [Qemu-devel] [PULL 00/13] Trivial patches for 2017-07-12 Michael Tokarev
                   ` (5 preceding siblings ...)
  2017-07-12 13:38 ` [Qemu-devel] [PULL 06/13] configure: Handle having no c++ compiler in FORTIFY_SOURCE check Michael Tokarev
@ 2017-07-12 13:38 ` Michael Tokarev
  2017-07-12 13:38 ` [Qemu-devel] [PULL 08/13] hw/core: fix missing return value in load_image_targphys_as() Michael Tokarev
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Michael Tokarev @ 2017-07-12 13:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé, qemu-trivial, Michael Tokarev

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

fprintf(stderr) is how errors are reported in this file.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/core/loader.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/core/loader.c b/hw/core/loader.c
index f72930ca4a..3409cc6d1d 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -478,6 +478,7 @@ int load_elf_ram(const char *filename,
     }
 
     if (target_data_order != e_ident[EI_DATA]) {
+        fprintf(stderr, "%s: wrong endianness\n", filename);
         ret = ELF_LOAD_WRONG_ENDIAN;
         goto fail;
     }
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [Qemu-devel] [PULL 08/13] hw/core: fix missing return value in load_image_targphys_as()
  2017-07-12 13:37 [Qemu-devel] [PULL 00/13] Trivial patches for 2017-07-12 Michael Tokarev
                   ` (6 preceding siblings ...)
  2017-07-12 13:38 ` [Qemu-devel] [PULL 07/13] elf-loader: warn about invalid endianness Michael Tokarev
@ 2017-07-12 13:38 ` Michael Tokarev
  2017-07-12 13:38 ` [Qemu-devel] [PULL 09/13] qga-win32: Fix memory leak of device information set Michael Tokarev
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Michael Tokarev @ 2017-07-12 13:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé, qemu-trivial, Michael Tokarev

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/core/loader.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/core/loader.c b/hw/core/loader.c
index 3409cc6d1d..c17ace0a2e 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -150,7 +150,9 @@ int load_image_targphys_as(const char *filename,
         return -1;
     }
     if (size > 0) {
-        rom_add_file_fixed_as(filename, addr, -1, as);
+        if (rom_add_file_fixed_as(filename, addr, -1, as) < 0) {
+            return -1;
+        }
     }
     return size;
 }
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [Qemu-devel] [PULL 09/13] qga-win32: Fix memory leak of device information set
  2017-07-12 13:37 [Qemu-devel] [PULL 00/13] Trivial patches for 2017-07-12 Michael Tokarev
                   ` (7 preceding siblings ...)
  2017-07-12 13:38 ` [Qemu-devel] [PULL 08/13] hw/core: fix missing return value in load_image_targphys_as() Michael Tokarev
@ 2017-07-12 13:38 ` Michael Tokarev
  2017-07-12 13:38 ` [Qemu-devel] [PULL 10/13] hxtool: remove dead -q option Michael Tokarev
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Michael Tokarev @ 2017-07-12 13:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: Li Ping, qemu-trivial, Michael Tokarev

From: Li Ping <li.ping288@zte.com.cn>

The caller of SetupDiGetClassDevs must delete the returned device information
 set when it is no longer needed by calling SetupDiDestroyDeviceInfoList.

Signed-off-by: Li Ping <li.ping288@zte.com.cn>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 qga/commands-win32.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index 439d229225..6f1645747b 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -512,7 +512,7 @@ static GuestPCIAddress *get_pci_info(char *guid, Error **errp)
             } else {
                 error_setg_win32(errp, GetLastError(),
                         "failed to get device name");
-                goto out;
+                goto free_dev_info;
             }
         }
 
@@ -560,6 +560,9 @@ static GuestPCIAddress *get_pci_info(char *guid, Error **errp)
         pci->bus = bus;
         break;
     }
+
+free_dev_info:
+    SetupDiDestroyDeviceInfoList(dev_info);
 out:
     g_free(buffer);
     g_free(name);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [Qemu-devel] [PULL 10/13] hxtool: remove dead -q option
  2017-07-12 13:37 [Qemu-devel] [PULL 00/13] Trivial patches for 2017-07-12 Michael Tokarev
                   ` (8 preceding siblings ...)
  2017-07-12 13:38 ` [Qemu-devel] [PULL 09/13] qga-win32: Fix memory leak of device information set Michael Tokarev
@ 2017-07-12 13:38 ` Michael Tokarev
  2017-07-12 13:38 ` [Qemu-devel] [PULL 11/13] include/hw/ptimer.h: Add documentation comments Michael Tokarev
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Michael Tokarev @ 2017-07-12 13:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, qemu-trivial, Michael Tokarev

From: Paolo Bonzini <pbonzini@redhat.com>

This was used to extract .txt documentation for QMP.  This was
changed to use the QAPI schema instead, so zap it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 scripts/hxtool | 46 +---------------------------------------------
 1 file changed, 1 insertion(+), 45 deletions(-)

diff --git a/scripts/hxtool b/scripts/hxtool
index 5468cd7782..1e2c97c5e6 100644
--- a/scripts/hxtool
+++ b/scripts/hxtool
@@ -7,7 +7,7 @@ hxtoh()
         case $str in
             HXCOMM*)
             ;;
-            STEXI*|ETEXI*|SQMP*|EQMP*) flag=$(($flag^1))
+            STEXI*|ETEXI*) flag=$(($flag^1))
             ;;
             *)
             test $flag -eq 1 && printf "%s\n" "$str"
@@ -45,12 +45,6 @@ hxtotexi()
             fi
             flag=0
             ;;
-            SQMP*|EQMP*)
-            if test $flag -eq 1 ; then
-                printf "line %d: syntax error: expected ETEXI, found '%s'\n" "$line" "$str" >&2
-                exit 1
-            fi
-            ;;
             DEFHEADING*)
             print_texi_heading "$(expr "$str" : "DEFHEADING(\(.*\))")"
             ;;
@@ -65,47 +59,9 @@ hxtotexi()
     done
 }
 
-hxtoqmp()
-{
-    IFS=
-    flag=0
-    line=1
-    while read -r str; do
-        case "$str" in
-            HXCOMM*)
-            ;;
-            SQMP*)
-            if test $flag -eq 1 ; then
-                printf "line %d: syntax error: expected EQMP, found '%s'\n" "$line" "$str" >&2
-                exit 1
-            fi
-            flag=1
-            ;;
-            EQMP*)
-            if test $flag -ne 1 ; then
-                printf "line %d: syntax error: expected SQMP, found '%s'\n" "$line" "$str" >&2
-                exit 1
-            fi
-            flag=0
-            ;;
-            STEXI*|ETEXI*)
-            if test $flag -eq 1 ; then
-                printf "line %d: syntax error: expected EQMP, found '%s'\n" "$line" "$str" >&2
-                exit 1
-            fi
-            ;;
-            *)
-            test $flag -eq 1 && printf '%s\n' "$str"
-            ;;
-        esac
-        line=$((line+1))
-    done
-}
-
 case "$1" in
 "-h") hxtoh ;;
 "-t") hxtotexi ;;
-"-q") hxtoqmp ;;
 *) exit 1 ;;
 esac
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [Qemu-devel] [PULL 11/13] include/hw/ptimer.h: Add documentation comments
  2017-07-12 13:37 [Qemu-devel] [PULL 00/13] Trivial patches for 2017-07-12 Michael Tokarev
                   ` (9 preceding siblings ...)
  2017-07-12 13:38 ` [Qemu-devel] [PULL 10/13] hxtool: remove dead -q option Michael Tokarev
@ 2017-07-12 13:38 ` Michael Tokarev
  2017-07-12 13:38 ` [Qemu-devel] [PULL 12/13] qobject: Catch another straggler for use of qdict_put_str() Michael Tokarev
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Michael Tokarev @ 2017-07-12 13:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, qemu-trivial, Michael Tokarev

From: Peter Maydell <peter.maydell@linaro.org>

Add documentation comments describing the public API of the
ptimer countdown timer.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 include/hw/ptimer.h | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 120 insertions(+)

diff --git a/include/hw/ptimer.h b/include/hw/ptimer.h
index eafc3f0a86..fc4ef5cc1d 100644
--- a/include/hw/ptimer.h
+++ b/include/hw/ptimer.h
@@ -12,6 +12,20 @@
 #include "qemu/timer.h"
 #include "migration/vmstate.h"
 
+/* The ptimer API implements a simple periodic countdown timer.
+ * The countdown timer has a value (which can be read and written via
+ * ptimer_get_count() and ptimer_set_count()). When it is enabled
+ * using ptimer_run(), the value will count downwards at the frequency
+ * which has been configured using ptimer_set_period() or ptimer_set_freq().
+ * When it reaches zero it will trigger a QEMU bottom half handler, and
+ * can be set to either reload itself from a specified limit value
+ * and keep counting down, or to stop (as a one-shot timer).
+ *
+ * Forgetting to set the period/frequency (or setting it to zero) is a
+ * bug in the QEMU device and will cause warning messages to be printed
+ * to stderr when the guest attempts to enable the timer.
+ */
+
 /* The default ptimer policy retains backward compatibility with the legacy
  * timers. Custom policies are adjusting the default one. Consider providing
  * a correct policy for your timer.
@@ -59,15 +73,121 @@
 typedef struct ptimer_state ptimer_state;
 typedef void (*ptimer_cb)(void *opaque);
 
+/**
+ * ptimer_init - Allocate and return a new ptimer
+ * @bh: QEMU bottom half which is run on timer expiry
+ * @policy: PTIMER_POLICY_* bits specifying behaviour
+ *
+ * The ptimer returned must be freed using ptimer_free().
+ * The ptimer takes ownership of @bh and will delete it
+ * when the ptimer is eventually freed.
+ */
 ptimer_state *ptimer_init(QEMUBH *bh, uint8_t policy_mask);
+
+/**
+ * ptimer_free - Free a ptimer
+ * @s: timer to free
+ *
+ * Free a ptimer created using ptimer_init() (including
+ * deleting the bottom half which it is using).
+ */
 void ptimer_free(ptimer_state *s);
+
+/**
+ * ptimer_set_period - Set counter increment interval in nanoseconds
+ * @s: ptimer to configure
+ * @period: period of the counter in nanoseconds
+ *
+ * Note that if your counter behaviour is specified as having a
+ * particular frequency rather than a period then ptimer_set_freq()
+ * may be more appropriate.
+ */
 void ptimer_set_period(ptimer_state *s, int64_t period);
+
+/**
+ * ptimer_set_freq - Set counter frequency in Hz
+ * @s: ptimer to configure
+ * @freq: counter frequency in Hz
+ *
+ * This does the same thing as ptimer_set_period(), so you only
+ * need to call one of them. If the counter behaviour is specified
+ * as setting the frequency then this function is more appropriate,
+ * because it allows specifying an effective period which is
+ * precise to fractions of a nanosecond, avoiding rounding errors.
+ */
 void ptimer_set_freq(ptimer_state *s, uint32_t freq);
+
+/**
+ * ptimer_get_limit - Get the configured limit of the ptimer
+ * @s: ptimer to query
+ *
+ * This function returns the current limit (reload) value
+ * of the down-counter; that is, the value which it will be
+ * reset to when it hits zero.
+ *
+ * Generally timer devices using ptimers should be able to keep
+ * their reload register state inside the ptimer using the get
+ * and set limit functions rather than needing to also track it
+ * in their own state structure.
+ */
 uint64_t ptimer_get_limit(ptimer_state *s);
+
+/**
+ * ptimer_set_limit - Set the limit of the ptimer
+ * @s: ptimer
+ * @limit: initial countdown value
+ * @reload: if nonzero, then reset the counter to the new limit
+ *
+ * Set the limit value of the down-counter. The @reload flag can
+ * be used to emulate the behaviour of timers which immediately
+ * reload the counter when their reload register is written to.
+ */
 void ptimer_set_limit(ptimer_state *s, uint64_t limit, int reload);
+
+/**
+ * ptimer_get_count - Get the current value of the ptimer
+ * @s: ptimer
+ *
+ * Return the current value of the down-counter. This will
+ * return the correct value whether the counter is enabled or
+ * disabled.
+ */
 uint64_t ptimer_get_count(ptimer_state *s);
+
+/**
+ * ptimer_set_count - Set the current value of the ptimer
+ * @s: ptimer
+ * @count: count value to set
+ *
+ * Set the value of the down-counter. If the counter is currently
+ * enabled this will arrange for a timer callback at the appropriate
+ * point in the future.
+ */
 void ptimer_set_count(ptimer_state *s, uint64_t count);
+
+/**
+ * ptimer_run - Start a ptimer counting
+ * @s: ptimer
+ * @oneshot: non-zero if this timer should only count down once
+ *
+ * Start a ptimer counting down; when it reaches zero the bottom half
+ * passed to ptimer_init() will be invoked. If the @oneshot argument is zero,
+ * the counter value will then be reloaded from the limit and it will
+ * start counting down again. If @oneshot is non-zero, then the counter
+ * will disable itself when it reaches zero.
+ */
 void ptimer_run(ptimer_state *s, int oneshot);
+
+/**
+ * ptimer_stop - Stop a ptimer counting
+ * @s: ptimer
+ *
+ * Pause a timer (the count stays at its current value until ptimer_run()
+ * is called to start it counting again).
+ *
+ * Note that this can cause it to "lose" time, even if it is immediately
+ * restarted.
+ */
 void ptimer_stop(ptimer_state *s);
 
 extern const VMStateDescription vmstate_ptimer;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [Qemu-devel] [PULL 12/13] qobject: Catch another straggler for use of qdict_put_str()
  2017-07-12 13:37 [Qemu-devel] [PULL 00/13] Trivial patches for 2017-07-12 Michael Tokarev
                   ` (10 preceding siblings ...)
  2017-07-12 13:38 ` [Qemu-devel] [PULL 11/13] include/hw/ptimer.h: Add documentation comments Michael Tokarev
@ 2017-07-12 13:38 ` Michael Tokarev
  2017-07-12 13:38 ` [Qemu-devel] [PULL 13/13] qobject: Update coccinelle script to catch Q{INC, DEC}REF Michael Tokarev
  2017-07-12 13:57 ` [Qemu-devel] [PULL 00/13] Trivial patches for 2017-07-12 Eric Blake
  13 siblings, 0 replies; 16+ messages in thread
From: Michael Tokarev @ 2017-07-12 13:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: Eric Blake, qemu-trivial, Michael Tokarev

From: Eric Blake <eblake@redhat.com>

Dan's addition of key-secret improvements in commit 29cf9336 was
developed prior to the addition of QDict scalar insertion macros,
but merged after the general cleanup in commit 46f5ac20.
Patch created mechanically by rerunning:
  spatch --sp-file scripts/coccinelle/qobject.cocci \
         --macro-file scripts/cocci-macro-file.h --dir . --in-place

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 qemu-img.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qemu-img.c b/qemu-img.c
index f7ffb79db6..02900ce1d1 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -355,7 +355,7 @@ static int img_add_key_secrets(void *opaque,
     QDict *options = opaque;
 
     if (g_str_has_suffix(name, "key-secret")) {
-        qdict_put(options, name, qstring_from_str(value));
+        qdict_put_str(options, name, value);
     }
 
     return 0;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [Qemu-devel] [PULL 13/13] qobject: Update coccinelle script to catch Q{INC, DEC}REF
  2017-07-12 13:37 [Qemu-devel] [PULL 00/13] Trivial patches for 2017-07-12 Michael Tokarev
                   ` (11 preceding siblings ...)
  2017-07-12 13:38 ` [Qemu-devel] [PULL 12/13] qobject: Catch another straggler for use of qdict_put_str() Michael Tokarev
@ 2017-07-12 13:38 ` Michael Tokarev
  2017-07-12 13:57 ` [Qemu-devel] [PULL 00/13] Trivial patches for 2017-07-12 Eric Blake
  13 siblings, 0 replies; 16+ messages in thread
From: Michael Tokarev @ 2017-07-12 13:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: Eric Blake, qemu-trivial, Michael Tokarev

From: Eric Blake <eblake@redhat.com>

A recent patch submission was about to use qobject_decref(QOBJECT(E)),
even though we already have QDECREF(E) for that purpose.  While our
tree is currently free from the longhand form, we might as well update
our coccinelle script to catch any future relapses.

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 scripts/coccinelle/qobject.cocci | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/coccinelle/qobject.cocci b/scripts/coccinelle/qobject.cocci
index c3253deb1b..c518caf7b1 100644
--- a/scripts/coccinelle/qobject.cocci
+++ b/scripts/coccinelle/qobject.cocci
@@ -3,6 +3,12 @@
 expression Obj, Key, E;
 @@
 (
+- qobject_incref(QOBJECT(E));
++ QINCREF(E);
+|
+- qobject_decref(QOBJECT(E));
++ QDECREF(E);
+|
 - qdict_put_obj(Obj, Key, QOBJECT(E));
 + qdict_put(Obj, Key, E);
 |
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [Qemu-devel] [PULL 00/13] Trivial patches for 2017-07-12
  2017-07-12 13:37 [Qemu-devel] [PULL 00/13] Trivial patches for 2017-07-12 Michael Tokarev
                   ` (12 preceding siblings ...)
  2017-07-12 13:38 ` [Qemu-devel] [PULL 13/13] qobject: Update coccinelle script to catch Q{INC, DEC}REF Michael Tokarev
@ 2017-07-12 13:57 ` Eric Blake
  2017-07-12 14:02   ` Michael Tokarev
  13 siblings, 1 reply; 16+ messages in thread
From: Eric Blake @ 2017-07-12 13:57 UTC (permalink / raw)
  To: Michael Tokarev, qemu-devel; +Cc: qemu-trivial

[-- Attachment #1: Type: text/plain, Size: 1184 bytes --]

On 07/12/2017 08:37 AM, Michael Tokarev wrote:
> The following changes since commit 6b06e3e49eb8c91cc286c16d6bf3181ac296f33d:
> 
>   Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2017-07-10-v2' into staging (2017-07-10 16:12:47 +0100)
> 
> are available in the git repository at:
> 
>   git://git.corpit.ru/qemu.git tags/trivial-patches-fetch
> 
> for you to fetch changes up to 10cb4ec41734243b2798bd1d53919827eaccd673:
> 
>   qobject: Update coccinelle script to catch Q{INC, DEC}REF (2017-07-12 16:34:44 +0300)
> 
> ----------------------------------------------------------------
> trivial patches for 2017-07-12
> 
> ----------------------------------------------------------------
> Eric Blake (2):
>       qobject: Catch another straggler for use of qdict_put_str()
>       qobject: Update coccinelle script to catch Q{INC, DEC}REF

You picked up v1 of these patches, when Markus was already planning on
merging v2.  It may be easier to respin a v2 of the pull request that
drops these patches from -trivial.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Qemu-devel] [PULL 00/13] Trivial patches for 2017-07-12
  2017-07-12 13:57 ` [Qemu-devel] [PULL 00/13] Trivial patches for 2017-07-12 Eric Blake
@ 2017-07-12 14:02   ` Michael Tokarev
  0 siblings, 0 replies; 16+ messages in thread
From: Michael Tokarev @ 2017-07-12 14:02 UTC (permalink / raw)
  To: Eric Blake, qemu-devel; +Cc: qemu-trivial

12.07.2017 16:57, Eric Blake wrote:

>> trivial patches for 2017-07-12
>>
>> ----------------------------------------------------------------
>> Eric Blake (2):
>>       qobject: Catch another straggler for use of qdict_put_str()
>>       qobject: Update coccinelle script to catch Q{INC, DEC}REF
> 
> You picked up v1 of these patches, when Markus was already planning on
> merging v2.  It may be easier to respin a v2 of the pull request that
> drops these patches from -trivial.

I haven't seen a v2, and the discussion for v1 seemed conclusive enough
and the patches looked okay too. But ok, I dropped these and resent.

Thanks,

/mjt

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2017-07-12 14:02 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-12 13:37 [Qemu-devel] [PULL 00/13] Trivial patches for 2017-07-12 Michael Tokarev
2017-07-12 13:37 ` [Qemu-devel] [PULL 01/13] target/xtensa: gdbstub: drop dead return statement Michael Tokarev
2017-07-12 13:37 ` [Qemu-devel] [PULL 02/13] util/qemu-sockets: Drop unused helper socket_address_to_string() Michael Tokarev
2017-07-12 13:37 ` [Qemu-devel] [PULL 03/13] configure: Fix build with pkg-config and --static --enable-sdl Michael Tokarev
2017-07-12 13:38 ` [Qemu-devel] [PULL 04/13] hw/misc: add missing includes Michael Tokarev
2017-07-12 13:38 ` [Qemu-devel] [PULL 05/13] hw/pci: define msi_nonbroken in pci-stub Michael Tokarev
2017-07-12 13:38 ` [Qemu-devel] [PULL 06/13] configure: Handle having no c++ compiler in FORTIFY_SOURCE check Michael Tokarev
2017-07-12 13:38 ` [Qemu-devel] [PULL 07/13] elf-loader: warn about invalid endianness Michael Tokarev
2017-07-12 13:38 ` [Qemu-devel] [PULL 08/13] hw/core: fix missing return value in load_image_targphys_as() Michael Tokarev
2017-07-12 13:38 ` [Qemu-devel] [PULL 09/13] qga-win32: Fix memory leak of device information set Michael Tokarev
2017-07-12 13:38 ` [Qemu-devel] [PULL 10/13] hxtool: remove dead -q option Michael Tokarev
2017-07-12 13:38 ` [Qemu-devel] [PULL 11/13] include/hw/ptimer.h: Add documentation comments Michael Tokarev
2017-07-12 13:38 ` [Qemu-devel] [PULL 12/13] qobject: Catch another straggler for use of qdict_put_str() Michael Tokarev
2017-07-12 13:38 ` [Qemu-devel] [PULL 13/13] qobject: Update coccinelle script to catch Q{INC, DEC}REF Michael Tokarev
2017-07-12 13:57 ` [Qemu-devel] [PULL 00/13] Trivial patches for 2017-07-12 Eric Blake
2017-07-12 14:02   ` Michael Tokarev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.