All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30
@ 2015-04-30  5:08 Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 01/42] tpm: Cast 64bit variables to int when used in DPRINTF Michael Tokarev
                   ` (42 more replies)
  0 siblings, 43 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev

Hello.

This is the first pull request for trivial-patches tree since 2.3 has
been released.  During the freeze many patches has been accumulated,
and even more has been received after 2.4 developmnent has been opened.

So here we have 42 trivial patches, which is kinda too much, but that's
what we have :)

Please consider applying.

Thanks,

/mjt

The following changes since commit a9392bc93c8615ad1983047e9f91ee3fa8aae75f:

  Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (2015-04-28 16:55:03 +0100)

are available in the git repository at:

  git://git.corpit.ru/qemu.git tags/pull-trivial-patches-2015-04-30

for you to fetch changes up to fe31d3e6e6945b509e5b4ab03d38aae1266fe64e:

  microblaze: fix memory leak (2015-04-30 08:06:20 +0300)

----------------------------------------------------------------
trivial patches for 2015-04-30

----------------------------------------------------------------
Chih-Min Chao (5):
      bitops : fix coding style
      ui/vnc : fix coding style
      ui/vnc : remove 'struct' of 'typedef struct'
      ui/console : remove 'struct' from 'typedef struct' type
      hw/display : remove 'struct' from 'typedef QXL struct'

Emilio G. Cota (6):
      cpus: use first_cpu macro instead of QTAILQ_FIRST(&cpus)
      input: remove unused mouse_handlers list
      qemu-char: remove unused list node from FDCharDriver
      coroutine: remove unnecessary parentheses in qemu_co_queue_empty
      linux-user/elfload: use QTAILQ_FOREACH instead of open-coding it
      i440fx-test: remove ARRAY_SIZE redefinition

Gonglei (3):
      target-mips: fix memory leak
      vhost-user: remove superfluous '\n' around error_report()
      microblaze: fix memory leak

Jan Kiszka (1):
      hostmem: Fix mem-path property name in error report

John Snow (1):
      qmp-commands: Fix typo

Laszlo Ersek (1):
      docs/atomics.txt: fix two typos

Michael Tokarev (3):
      qemu-options: trivial spelling fix (messsage)
      libcacard: do not use full paths for include files in the same dir
      microblaze: cpu: Renumber EXCP_* constants to close gap

Paolo Bonzini (3):
      range: remove useless inclusions
      qemu-config: remove stray inclusions of hw/ files
      libcacard: stop including qemu-common.h

Peter Crosthwaite (9):
      arm: cpu.h: Remove unused typdefs
      configure: alphabetize tricore in target list
      defconfigs: Piggyback microblazeel on microblaze
      microblaze: mmu: Delete flip_um fn prototype
      microblaze: cpu: Remote unused cpu_get_pc
      microblaze: cpu: Remove unused CC_OP enum
      microblaze: cpu: Delete EXCP_NMI
      microblaze: cpu: delete unused cpu_interrupts_enabled
      tcg: Delete unused cpu_pc_from_tb()

Stefan Berger (3):
      tpm: Cast 64bit variables to int when used in DPRINTF
      tpm: Modify DPRINTF to enable -Wformat checking
      tpm: fix coding style

Stefan Weil (1):
      misc: Fix new collection of typos

Thomas Huth (6):
      vmxnet: Remove unused function vmxnet_rx_pkt_get_num_frags()
      pci: Remove unused function ich9_d2pbr_init()
      monitor: Remove unused functions
      usb: Remove unused functions
      util: Remove unused functions
      kvm: Silence warning from valgrind

 backends/hostmem-file.c                  |  2 +-
 configure                                |  4 +-
 cpus.c                                   |  2 +-
 default-configs/microblazeel-softmmu.mak | 10 +----
 dma-helpers.c                            |  1 -
 docs/atomics.txt                         |  4 +-
 hmp.h                                    |  1 -
 hw/acpi/pcihp.c                          |  1 -
 hw/block/virtio-blk.c                    |  2 +-
 hw/display/qxl.c                         |  2 +-
 hw/i386/acpi-build.c                     |  1 -
 hw/microblaze/boot.c                     | 13 ++++---
 hw/mips/mips_fulong2e.c                  |  1 +
 hw/mips/mips_malta.c                     |  1 +
 hw/mips/mips_r4k.c                       |  1 +
 hw/misc/edu.c                            |  2 +-
 hw/net/virtio-net.c                      |  2 +-
 hw/net/vmxnet_rx_pkt.c                   |  7 ----
 hw/net/vmxnet_rx_pkt.h                   |  9 -----
 hw/pci-bridge/i82801b11.c                | 21 ----------
 hw/ppc/spapr.c                           |  2 +-
 hw/tpm/tpm_passthrough.c                 | 16 ++++----
 hw/tpm/tpm_tis.c                         | 26 ++++++-------
 hw/usb/core.c                            | 41 --------------------
 hw/virtio/vhost-user.c                   | 22 +++++------
 include/hw/i386/ich9.h                   |  2 -
 include/hw/pci-host/q35.h                |  1 -
 include/hw/usb.h                         |  5 ---
 include/monitor/monitor.h                |  1 -
 include/qemu-common.h                    |  4 --
 include/qemu/bitops.h                    | 61 ++++++++++++++---------------
 include/qemu/compatfd.h                  |  1 -
 kvm-all.c                                | 14 +++----
 libcacard/cac.c                          |  5 ++-
 libcacard/card_7816.c                    |  4 +-
 libcacard/event.c                        |  2 +-
 libcacard/vcard.c                        |  4 +-
 libcacard/vcard_emul_nss.c               |  4 +-
 libcacard/vcardt.c                       |  4 +-
 libcacard/vreader.c                      |  4 +-
 libcacard/vscclient.c                    |  8 +++-
 linux-user/elfload.c                     |  3 +-
 monitor.c                                | 13 -------
 qemu-char.c                              |  1 -
 qemu-coroutine-lock.c                    |  2 +-
 qemu-options.hx                          |  2 +-
 qga/qapi-schema.json                     |  2 +-
 qmp-commands.hx                          |  4 +-
 target-arm/cpu.h                         | 14 -------
 target-microblaze/cpu.h                  | 27 +++----------
 target-microblaze/mmu.h                  |  1 -
 target-s390x/mmu_helper.c                |  8 ++--
 target-s390x/translate.c                 |  2 +-
 target-tricore/cpu.h                     |  5 ---
 tcg/tcg.h                                |  6 ++-
 tests/i440fx-test.c                      |  2 -
 tests/libqos/ahci.c                      |  4 +-
 ui/console.c                             |  4 +-
 ui/input-legacy.c                        |  2 -
 ui/spice-display.c                       |  8 ++--
 ui/vnc-auth-vencrypt.c                   |  8 ++--
 ui/vnc-tls.c                             | 10 ++---
 ui/vnc-ws.c                              |  4 +-
 ui/vnc.c                                 |  2 +-
 util/compatfd.c                          | 19 ---------
 util/osdep.c                             | 66 --------------------------------
 util/qemu-config.c                       |  2 -
 67 files changed, 156 insertions(+), 383 deletions(-)

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

* [Qemu-devel] [PULL 01/42] tpm: Cast 64bit variables to int when used in DPRINTF
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 02/42] tpm: Modify DPRINTF to enable -Wformat checking Michael Tokarev
                   ` (41 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Stefan Berger

From: Stefan Berger <stefanb@linux.vnet.ibm.com>

Cast 64bit variables to int when used in DPRINTF. They only contain
32bit of data.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/tpm/tpm_tis.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
index 815c8ea..cb9c7c8 100644
--- a/hw/tpm/tpm_tis.c
+++ b/hw/tpm/tpm_tis.c
@@ -421,7 +421,7 @@ static void tpm_tis_dump_state(void *opaque, hwaddr addr)
 
     for (idx = 0; regs[idx] != 0xfff; idx++) {
         DPRINTF("tpm_tis: 0x%04x : 0x%08x\n", regs[idx],
-                (uint32_t)tpm_tis_mmio_read(opaque, base + regs[idx], 4));
+                (int)tpm_tis_mmio_read(opaque, base + regs[idx], 4));
     }
 
     DPRINTF("tpm_tis: read offset   : %d\n"
@@ -555,7 +555,7 @@ static uint64_t tpm_tis_mmio_read(void *opaque, hwaddr addr,
         val >>= shift;
     }
 
-    DPRINTF("tpm_tis:  read.%u(%08x) = %08x\n", size, (int)addr, (uint32_t)val);
+    DPRINTF("tpm_tis:  read.%u(%08x) = %08x\n", size, (int)addr, (int)val);
 
     return val;
 }
@@ -578,7 +578,7 @@ static void tpm_tis_mmio_write_intern(void *opaque, hwaddr addr,
     uint16_t len;
     uint32_t mask = (size == 1) ? 0xff : ((size == 2) ? 0xffff : ~0);
 
-    DPRINTF("tpm_tis: write.%u(%08x) = %08x\n", size, (int)addr, (uint32_t)val);
+    DPRINTF("tpm_tis: write.%u(%08x) = %08x\n", size, (int)addr, (int)val);
 
     if (locty == 4 && !hw_access) {
         DPRINTF("tpm_tis: Access to locality 4 only allowed from hardware\n");
@@ -815,7 +815,7 @@ static void tpm_tis_mmio_write_intern(void *opaque, hwaddr addr,
             /* drop the byte */
         } else {
             DPRINTF("tpm_tis: Data to send to TPM: %08x (size=%d)\n",
-                    val, size);
+                    (int)val, size);
             if (tis->loc[locty].state == TPM_TIS_STATE_READY) {
                 tis->loc[locty].state = TPM_TIS_STATE_RECEPTION;
                 tpm_tis_sts_set(&tis->loc[locty],
-- 
2.1.4

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

* [Qemu-devel] [PULL 02/42] tpm: Modify DPRINTF to enable -Wformat checking
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 01/42] tpm: Cast 64bit variables to int when used in DPRINTF Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 03/42] bitops : fix coding style Michael Tokarev
                   ` (40 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Stefan Berger

From: Stefan Berger <stefanb@linux.vnet.ibm.com>

Modify DPRINTF to always enable -Wformat checking.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/tpm/tpm_passthrough.c | 16 +++++++---------
 hw/tpm/tpm_tis.c         | 14 ++++++--------
 2 files changed, 13 insertions(+), 17 deletions(-)

diff --git a/hw/tpm/tpm_passthrough.c b/hw/tpm/tpm_passthrough.c
index 2a45071..73ca906 100644
--- a/hw/tpm/tpm_passthrough.c
+++ b/hw/tpm/tpm_passthrough.c
@@ -34,15 +34,13 @@
 #include "sysemu/tpm_backend_int.h"
 #include "tpm_tis.h"
 
-/* #define DEBUG_TPM */
-
-#ifdef DEBUG_TPM
-#define DPRINTF(fmt, ...) \
-    do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) \
-    do { } while (0)
-#endif
+#define DEBUG_TPM 0
+
+#define DPRINTF(fmt, ...) do { \
+    if (DEBUG_TPM) { \
+        fprintf(stderr, fmt, ## __VA_ARGS__); \
+    } \
+} while (0);
 
 #define TYPE_TPM_PASSTHROUGH "tpm-passthrough"
 #define TPM_PASSTHROUGH(obj) \
diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
index cb9c7c8..4b6d601 100644
--- a/hw/tpm/tpm_tis.c
+++ b/hw/tpm/tpm_tis.c
@@ -30,15 +30,13 @@
 #include "qemu-common.h"
 #include "qemu/main-loop.h"
 
-/*#define DEBUG_TIS */
+#define DEBUG_TIS 0
 
-#ifdef DEBUG_TIS
-#define DPRINTF(fmt, ...) \
-    do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) \
-    do { } while (0)
-#endif
+#define DPRINTF(fmt, ...) do { \
+    if (DEBUG_TIS) { \
+        printf(fmt, ## __VA_ARGS__); \
+    } \
+} while (0);
 
 /* whether the STS interrupt is supported */
 #define RAISE_STS_IRQ
-- 
2.1.4

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

* [Qemu-devel] [PULL 03/42] bitops : fix coding style
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 01/42] tpm: Cast 64bit variables to int when used in DPRINTF Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 02/42] tpm: Modify DPRINTF to enable -Wformat checking Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 04/42] ui/vnc " Michael Tokarev
                   ` (39 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Chih-Min Chao

From: Chih-Min Chao <cmchao@gmail.com>

    don't mix tab and space. The rule is 4 spaces

Signed-off-by: Chih-Min Chao <cmchao@gmail.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 include/qemu/bitops.h | 61 ++++++++++++++++++++++++++-------------------------
 1 file changed, 31 insertions(+), 30 deletions(-)

diff --git a/include/qemu/bitops.h b/include/qemu/bitops.h
index 90ca8df..8abdcf9 100644
--- a/include/qemu/bitops.h
+++ b/include/qemu/bitops.h
@@ -20,10 +20,10 @@
 #define BITS_PER_BYTE           CHAR_BIT
 #define BITS_PER_LONG           (sizeof (unsigned long) * BITS_PER_BYTE)
 
-#define BIT(nr)			(1UL << (nr))
-#define BIT_MASK(nr)		(1UL << ((nr) % BITS_PER_LONG))
-#define BIT_WORD(nr)		((nr) / BITS_PER_LONG)
-#define BITS_TO_LONGS(nr)	DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long))
+#define BIT(nr)                 (1UL << (nr))
+#define BIT_MASK(nr)            (1UL << ((nr) % BITS_PER_LONG))
+#define BIT_WORD(nr)            ((nr) / BITS_PER_LONG)
+#define BITS_TO_LONGS(nr)       DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long))
 
 /**
  * set_bit - Set a bit in memory
@@ -32,10 +32,10 @@
  */
 static inline void set_bit(long nr, unsigned long *addr)
 {
-	unsigned long mask = BIT_MASK(nr);
-        unsigned long *p = addr + BIT_WORD(nr);
+    unsigned long mask = BIT_MASK(nr);
+    unsigned long *p = addr + BIT_WORD(nr);
 
-	*p  |= mask;
+    *p  |= mask;
 }
 
 /**
@@ -45,10 +45,10 @@ static inline void set_bit(long nr, unsigned long *addr)
  */
 static inline void clear_bit(long nr, unsigned long *addr)
 {
-	unsigned long mask = BIT_MASK(nr);
-        unsigned long *p = addr + BIT_WORD(nr);
+    unsigned long mask = BIT_MASK(nr);
+    unsigned long *p = addr + BIT_WORD(nr);
 
-	*p &= ~mask;
+    *p &= ~mask;
 }
 
 /**
@@ -58,10 +58,10 @@ static inline void clear_bit(long nr, unsigned long *addr)
  */
 static inline void change_bit(long nr, unsigned long *addr)
 {
-	unsigned long mask = BIT_MASK(nr);
-        unsigned long *p = addr + BIT_WORD(nr);
+    unsigned long mask = BIT_MASK(nr);
+    unsigned long *p = addr + BIT_WORD(nr);
 
-	*p ^= mask;
+    *p ^= mask;
 }
 
 /**
@@ -71,12 +71,12 @@ static inline void change_bit(long nr, unsigned long *addr)
  */
 static inline int test_and_set_bit(long nr, unsigned long *addr)
 {
-	unsigned long mask = BIT_MASK(nr);
-        unsigned long *p = addr + BIT_WORD(nr);
-	unsigned long old = *p;
+    unsigned long mask = BIT_MASK(nr);
+    unsigned long *p = addr + BIT_WORD(nr);
+    unsigned long old = *p;
 
-	*p = old | mask;
-	return (old & mask) != 0;
+    *p = old | mask;
+    return (old & mask) != 0;
 }
 
 /**
@@ -86,12 +86,12 @@ static inline int test_and_set_bit(long nr, unsigned long *addr)
  */
 static inline int test_and_clear_bit(long nr, unsigned long *addr)
 {
-	unsigned long mask = BIT_MASK(nr);
-        unsigned long *p = addr + BIT_WORD(nr);
-	unsigned long old = *p;
+    unsigned long mask = BIT_MASK(nr);
+    unsigned long *p = addr + BIT_WORD(nr);
+    unsigned long old = *p;
 
-	*p = old & ~mask;
-	return (old & mask) != 0;
+    *p = old & ~mask;
+    return (old & mask) != 0;
 }
 
 /**
@@ -101,12 +101,12 @@ static inline int test_and_clear_bit(long nr, unsigned long *addr)
  */
 static inline int test_and_change_bit(long nr, unsigned long *addr)
 {
-	unsigned long mask = BIT_MASK(nr);
-        unsigned long *p = addr + BIT_WORD(nr);
-	unsigned long old = *p;
+    unsigned long mask = BIT_MASK(nr);
+    unsigned long *p = addr + BIT_WORD(nr);
+    unsigned long old = *p;
 
-	*p = old ^ mask;
-	return (old & mask) != 0;
+    *p = old ^ mask;
+    return (old & mask) != 0;
 }
 
 /**
@@ -116,7 +116,7 @@ static inline int test_and_change_bit(long nr, unsigned long *addr)
  */
 static inline int test_bit(long nr, const unsigned long *addr)
 {
-	return 1UL & (addr[BIT_WORD(nr)] >> (nr & (BITS_PER_LONG-1)));
+    return 1UL & (addr[BIT_WORD(nr)] >> (nr & (BITS_PER_LONG-1)));
 }
 
 /**
@@ -136,7 +136,8 @@ unsigned long find_last_bit(const unsigned long *addr,
  * @size: The bitmap size in bits
  */
 unsigned long find_next_bit(const unsigned long *addr,
-				   unsigned long size, unsigned long offset);
+                            unsigned long size,
+                            unsigned long offset);
 
 /**
  * find_next_zero_bit - find the next cleared bit in a memory region
-- 
2.1.4

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

* [Qemu-devel] [PULL 04/42] ui/vnc : fix coding style
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (2 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 03/42] bitops : fix coding style Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 05/42] ui/vnc : remove 'struct' of 'typedef struct' Michael Tokarev
                   ` (38 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Chih-Min Chao

From: Chih-Min Chao <cmchao@gmail.com>

    reported by checkpatch.pl

Signed-off-by: Chih-Min Chao <cmchao@gmail.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 ui/vnc-auth-vencrypt.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/ui/vnc-auth-vencrypt.c b/ui/vnc-auth-vencrypt.c
index a420ccb..65f1afa 100644
--- a/ui/vnc-auth-vencrypt.c
+++ b/ui/vnc-auth-vencrypt.c
@@ -65,7 +65,8 @@ static void start_auth_vencrypt_subauth(VncState *vs)
 
 static void vnc_tls_handshake_io(void *opaque);
 
-static int vnc_start_vencrypt_handshake(struct VncState *vs) {
+static int vnc_start_vencrypt_handshake(struct VncState *vs)
+{
     int ret;
 
     if ((ret = gnutls_handshake(vs->tls.session)) < 0) {
@@ -100,7 +101,8 @@ static int vnc_start_vencrypt_handshake(struct VncState *vs) {
     return 0;
 }
 
-static void vnc_tls_handshake_io(void *opaque) {
+static void vnc_tls_handshake_io(void *opaque)
+{
     struct VncState *vs = (struct VncState *)opaque;
 
     VNC_DEBUG("Handshake IO continue\n");
-- 
2.1.4

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

* [Qemu-devel] [PULL 05/42] ui/vnc : remove 'struct' of 'typedef struct'
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (3 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 04/42] ui/vnc " Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 06/42] ui/console : remove 'struct' from 'typedef struct' type Michael Tokarev
                   ` (37 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Chih-Min Chao

From: Chih-Min Chao <cmchao@gmail.com>

Signed-off-by: Chih-Min Chao <cmchao@gmail.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 ui/vnc-auth-vencrypt.c |  4 ++--
 ui/vnc-tls.c           | 10 +++++-----
 ui/vnc-ws.c            |  4 ++--
 ui/vnc.c               |  2 +-
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/ui/vnc-auth-vencrypt.c b/ui/vnc-auth-vencrypt.c
index 65f1afa..03ea48a 100644
--- a/ui/vnc-auth-vencrypt.c
+++ b/ui/vnc-auth-vencrypt.c
@@ -65,7 +65,7 @@ static void start_auth_vencrypt_subauth(VncState *vs)
 
 static void vnc_tls_handshake_io(void *opaque);
 
-static int vnc_start_vencrypt_handshake(struct VncState *vs)
+static int vnc_start_vencrypt_handshake(VncState *vs)
 {
     int ret;
 
@@ -103,7 +103,7 @@ static int vnc_start_vencrypt_handshake(struct VncState *vs)
 
 static void vnc_tls_handshake_io(void *opaque)
 {
-    struct VncState *vs = (struct VncState *)opaque;
+    VncState *vs = (VncState *)opaque;
 
     VNC_DEBUG("Handshake IO continue\n");
     vnc_start_vencrypt_handshake(vs);
diff --git a/ui/vnc-tls.c b/ui/vnc-tls.c
index eddd39b..028fc4d 100644
--- a/ui/vnc-tls.c
+++ b/ui/vnc-tls.c
@@ -68,7 +68,7 @@ static int vnc_tls_initialize(void)
 static ssize_t vnc_tls_push(gnutls_transport_ptr_t transport,
                             const void *data,
                             size_t len) {
-    struct VncState *vs = (struct VncState *)transport;
+    VncState *vs = (VncState *)transport;
     int ret;
 
  retry:
@@ -85,7 +85,7 @@ static ssize_t vnc_tls_push(gnutls_transport_ptr_t transport,
 static ssize_t vnc_tls_pull(gnutls_transport_ptr_t transport,
                             void *data,
                             size_t len) {
-    struct VncState *vs = (struct VncState *)transport;
+    VncState *vs = (VncState *)transport;
     int ret;
 
  retry:
@@ -170,7 +170,7 @@ static gnutls_certificate_credentials_t vnc_tls_initialize_x509_cred(VncDisplay
 }
 
 
-int vnc_tls_validate_certificate(struct VncState *vs)
+int vnc_tls_validate_certificate(VncState *vs)
 {
     int ret;
     unsigned int status;
@@ -332,7 +332,7 @@ static int vnc_set_gnutls_priority(gnutls_session_t s, int x509)
 
 #endif
 
-int vnc_tls_client_setup(struct VncState *vs,
+int vnc_tls_client_setup(VncState *vs,
                          int needX509Creds) {
     VNC_DEBUG("Do TLS setup\n");
     if (vnc_tls_initialize() < 0) {
@@ -410,7 +410,7 @@ int vnc_tls_client_setup(struct VncState *vs,
 }
 
 
-void vnc_tls_client_cleanup(struct VncState *vs)
+void vnc_tls_client_cleanup(VncState *vs)
 {
     if (vs->tls.session) {
         gnutls_deinit(vs->tls.session);
diff --git a/ui/vnc-ws.c b/ui/vnc-ws.c
index 62eb97f..38a1b8b 100644
--- a/ui/vnc-ws.c
+++ b/ui/vnc-ws.c
@@ -24,7 +24,7 @@
 #ifdef CONFIG_VNC_TLS
 #include "qemu/sockets.h"
 
-static int vncws_start_tls_handshake(struct VncState *vs)
+static int vncws_start_tls_handshake(VncState *vs)
 {
     int ret = gnutls_handshake(vs->tls.session);
 
@@ -63,7 +63,7 @@ static int vncws_start_tls_handshake(struct VncState *vs)
 
 void vncws_tls_handshake_io(void *opaque)
 {
-    struct VncState *vs = (struct VncState *)opaque;
+    VncState *vs = (VncState *)opaque;
 
     if (!vs->tls.session) {
         VNC_DEBUG("TLS Websocket setup\n");
diff --git a/ui/vnc.c b/ui/vnc.c
index cffb5b7..9f8ecd0 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -1046,7 +1046,7 @@ static void vnc_dpy_cursor_define(DisplayChangeListener *dcl,
     }
 }
 
-static int find_and_clear_dirty_height(struct VncState *vs,
+static int find_and_clear_dirty_height(VncState *vs,
                                        int y, int last_x, int x, int height)
 {
     int h;
-- 
2.1.4

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

* [Qemu-devel] [PULL 06/42] ui/console : remove 'struct' from 'typedef struct' type
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (4 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 05/42] ui/vnc : remove 'struct' of 'typedef struct' Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 07/42] hw/display : remove 'struct' from 'typedef QXL struct' Michael Tokarev
                   ` (36 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Chih-Min Chao

From: Chih-Min Chao <cmchao@gmail.com>

Signed-off-by: Chih-Min Chao <cmchao@gmail.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 ui/console.c       | 4 ++--
 ui/spice-display.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/ui/console.c b/ui/console.c
index 2927513..f5295c4 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -269,7 +269,7 @@ void graphic_hw_invalidate(QemuConsole *con)
     }
 }
 
-static void ppm_save(const char *filename, struct DisplaySurface *ds,
+static void ppm_save(const char *filename, DisplaySurface *ds,
                      Error **errp)
 {
     int width = pixman_image_get_width(ds->image);
@@ -1535,7 +1535,7 @@ void dpy_text_update(QemuConsole *con, int x, int y, int w, int h)
 void dpy_text_resize(QemuConsole *con, int w, int h)
 {
     DisplayState *s = con->ds;
-    struct DisplayChangeListener *dcl;
+    DisplayChangeListener *dcl;
 
     if (!qemu_console_is_visible(con)) {
         return;
diff --git a/ui/spice-display.c b/ui/spice-display.c
index c71a059..e293ec2 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -718,7 +718,7 @@ static void display_update(DisplayChangeListener *dcl,
 }
 
 static void display_switch(DisplayChangeListener *dcl,
-                           struct DisplaySurface *surface)
+                           DisplaySurface *surface)
 {
     SimpleSpiceDisplay *ssd = container_of(dcl, SimpleSpiceDisplay, dcl);
     qemu_spice_display_switch(ssd, surface);
-- 
2.1.4

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

* [Qemu-devel] [PULL 07/42] hw/display : remove 'struct' from 'typedef QXL struct'
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (5 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 06/42] ui/console : remove 'struct' from 'typedef struct' type Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 08/42] misc: Fix new collection of typos Michael Tokarev
                   ` (35 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Chih-Min Chao

From: Chih-Min Chao <cmchao@gmail.com>

Signed-off-by: Chih-Min Chao <cmchao@gmail.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/display/qxl.c   | 2 +-
 ui/spice-display.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index b6d65b9..0cd314c 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -696,7 +696,7 @@ static inline void qxl_push_free_res(PCIQXLDevice *d, int flush)
 
 /* called from spice server thread context only */
 static void interface_release_resource(QXLInstance *sin,
-                                       struct QXLReleaseInfoExt ext)
+                                       QXLReleaseInfoExt ext)
 {
     PCIQXLDevice *qxl = container_of(sin, PCIQXLDevice, ssd.qxl);
     QXLReleaseRing *ring;
diff --git a/ui/spice-display.c b/ui/spice-display.c
index e293ec2..9c63132 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -539,7 +539,7 @@ static void interface_get_init_info(QXLInstance *sin, QXLDevInitInfo *info)
     info->n_surfaces = ssd->num_surfaces;
 }
 
-static int interface_get_command(QXLInstance *sin, struct QXLCommandExt *ext)
+static int interface_get_command(QXLInstance *sin, QXLCommandExt *ext)
 {
     SimpleSpiceDisplay *ssd = container_of(sin, SimpleSpiceDisplay, qxl);
     SimpleSpiceUpdate *update;
@@ -566,7 +566,7 @@ static int interface_req_cmd_notification(QXLInstance *sin)
 }
 
 static void interface_release_resource(QXLInstance *sin,
-                                       struct QXLReleaseInfoExt rext)
+                                       QXLReleaseInfoExt rext)
 {
     SimpleSpiceDisplay *ssd = container_of(sin, SimpleSpiceDisplay, qxl);
     SimpleSpiceUpdate *update;
@@ -589,7 +589,7 @@ static void interface_release_resource(QXLInstance *sin,
     }
 }
 
-static int interface_get_cursor_command(QXLInstance *sin, struct QXLCommandExt *ext)
+static int interface_get_cursor_command(QXLInstance *sin, QXLCommandExt *ext)
 {
     SimpleSpiceDisplay *ssd = container_of(sin, SimpleSpiceDisplay, qxl);
     int ret;
-- 
2.1.4

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

* [Qemu-devel] [PULL 08/42] misc: Fix new collection of typos
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (6 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 07/42] hw/display : remove 'struct' from 'typedef QXL struct' Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 09/42] range: remove useless inclusions Michael Tokarev
                   ` (34 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Stefan Weil, Michael Tokarev

From: Stefan Weil <sw@weilnetz.de>

All of them were reported by codespell.
Most typos are in comments, one is in an error message.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/block/virtio-blk.c     | 2 +-
 hw/misc/edu.c             | 2 +-
 hw/net/virtio-net.c       | 2 +-
 hw/ppc/spapr.c            | 2 +-
 qga/qapi-schema.json      | 2 +-
 target-s390x/mmu_helper.c | 8 ++++----
 target-s390x/translate.c  | 2 +-
 tests/libqos/ahci.c       | 4 ++--
 8 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index 9546fd2..e6afe97 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -515,7 +515,7 @@ void virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb)
     type = virtio_ldl_p(VIRTIO_DEVICE(req->dev), &req->out.type);
 
     /* VIRTIO_BLK_T_OUT defines the command direction. VIRTIO_BLK_T_BARRIER
-     * is an optional flag. Altough a guest should not send this flag if
+     * is an optional flag. Although a guest should not send this flag if
      * not negotiated we ignored it in the past. So keep ignoring it. */
     switch (type & ~(VIRTIO_BLK_T_OUT | VIRTIO_BLK_T_BARRIER)) {
     case VIRTIO_BLK_T_IN:
diff --git a/hw/misc/edu.c b/hw/misc/edu.c
index f601069..fe50b42 100644
--- a/hw/misc/edu.c
+++ b/hw/misc/edu.c
@@ -279,7 +279,7 @@ static const MemoryRegionOps edu_mmio_ops = {
 };
 
 /*
- * We purposedly use a thread, so that users are forced to wait for the status
+ * We purposely use a thread, so that users are forced to wait for the status
  * register.
  */
 static void *edu_fact_thread(void *opaque)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 59f76bc..67ab228 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -1590,7 +1590,7 @@ static void virtio_net_device_realize(DeviceState *dev, Error **errp)
     n->max_queues = MAX(n->nic_conf.peers.queues, 1);
     if (n->max_queues * 2 + 1 > VIRTIO_PCI_QUEUE_MAX) {
         error_setg(errp, "Invalid number of queues (= %" PRIu32 "), "
-                   "must be a postive integer less than %d.",
+                   "must be a positive integer less than %d.",
                    n->max_queues, (VIRTIO_PCI_QUEUE_MAX - 1) / 2);
         virtio_cleanup(vdev);
         return;
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 61ddc79..644689a 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1029,7 +1029,7 @@ static int spapr_post_load(void *opaque, int version_id)
     sPAPREnvironment *spapr = (sPAPREnvironment *)opaque;
     int err = 0;
 
-    /* In earlier versions, there was no seperate qdev for the PAPR
+    /* In earlier versions, there was no separate qdev for the PAPR
      * RTC, so the RTC offset was stored directly in sPAPREnvironment.
      * So when migrating from those versions, poke the incoming offset
      * value into the RTC device */
diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json
index 95f49e3..5c4cd40 100644
--- a/qga/qapi-schema.json
+++ b/qga/qapi-schema.json
@@ -808,7 +808,7 @@
 #
 # An enumeration of memory block operation result.
 #
-# @sucess: the operation of online/offline memory block is successful.
+# @success: the operation of online/offline memory block is successful.
 # @not-found: can't find the corresponding memoryXXX directory in sysfs.
 # @operation-not-supported: for some old kernels, it does not support
 #                           online or offline memory block.
diff --git a/target-s390x/mmu_helper.c b/target-s390x/mmu_helper.c
index b061c85..7baf5e9 100644
--- a/target-s390x/mmu_helper.c
+++ b/target-s390x/mmu_helper.c
@@ -303,8 +303,8 @@ static int mmu_translate_asce(CPUS390XState *env, target_ulong vaddr,
  * @param asc    address space control (one of the PSW_ASC_* modes)
  * @param raddr  the translated address is stored to this pointer
  * @param flags  the PAGE_READ/WRITE/EXEC flags are stored to this pointer
- * @param exc    true = inject a program check if a fault occured
- * @return       0 if the translation was successfull, -1 if a fault occured
+ * @param exc    true = inject a program check if a fault occurred
+ * @return       0 if the translation was successful, -1 if a fault occurred
  */
 int mmu_translate(CPUS390XState *env, target_ulong vaddr, int rw, uint64_t asc,
                   target_ulong *raddr, int *flags, bool exc)
@@ -436,9 +436,9 @@ static int translate_pages(S390CPU *cpu, vaddr addr, int nr_pages,
  * s390_cpu_virt_mem_rw:
  * @laddr:     the logical start address
  * @hostbuf:   buffer in host memory. NULL = do only checks w/o copying
- * @len:       length that should be transfered
+ * @len:       length that should be transferred
  * @is_write:  true = write, false = read
- * Returns:    0 on success, non-zero if an exception occured
+ * Returns:    0 on success, non-zero if an exception occurred
  *
  * Copy from/to guest memory using logical addresses. Note that we inject a
  * program interrupt in case there is an error while accessing the memory.
diff --git a/target-s390x/translate.c b/target-s390x/translate.c
index 4f82edd..8784112 100644
--- a/target-s390x/translate.c
+++ b/target-s390x/translate.c
@@ -2990,7 +2990,7 @@ static ExitStatus op_sam(DisasContext *s, DisasOps *o)
         break;
     }
 
-    /* Bizzare but true, we check the address of the current insn for the
+    /* Bizarre but true, we check the address of the current insn for the
        specification exception, not the next to be executed.  Thus the PoO
        documents that Bad Things Happen two bytes before the end.  */
     if (s->pc & ~mask) {
diff --git a/tests/libqos/ahci.c b/tests/libqos/ahci.c
index b0f39a5..be00db2 100644
--- a/tests/libqos/ahci.c
+++ b/tests/libqos/ahci.c
@@ -364,7 +364,7 @@ void ahci_port_clear(AHCIQState *ahci, uint8_t port)
     ahci_px_wreg(ahci, port, AHCI_PX_IS, reg);
     g_assert_cmphex(ahci_px_rreg(ahci, port, AHCI_PX_IS), ==, 0);
 
-    /* Wipe the FIS-Recieve Buffer */
+    /* Wipe the FIS-Receive Buffer */
     qmemset(ahci->port[port].fb, 0x00, 0x100);
 }
 
@@ -442,7 +442,7 @@ void ahci_port_check_pio_sanity(AHCIQState *ahci, uint8_t port,
 {
     PIOSetupFIS *pio = g_malloc0(0x20);
 
-    /* We cannot check the Status or E_Status registers, becuase
+    /* We cannot check the Status or E_Status registers, because
      * the status may have again changed between the PIO Setup FIS
      * and the conclusion of the command with the D2H Register FIS. */
     memread(ahci->port[port].fb + 0x20, pio, 0x20);
-- 
2.1.4

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

* [Qemu-devel] [PULL 09/42] range: remove useless inclusions
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (7 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 08/42] misc: Fix new collection of typos Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 10/42] qemu-config: remove stray inclusions of hw/ files Michael Tokarev
                   ` (33 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Paolo Bonzini, Michael Tokarev

From: Paolo Bonzini <pbonzini@redhat.com>

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 dma-helpers.c             | 1 -
 hw/acpi/pcihp.c           | 1 -
 hw/i386/acpi-build.c      | 1 -
 include/hw/i386/ich9.h    | 1 -
 include/hw/pci-host/q35.h | 1 -
 5 files changed, 5 deletions(-)

diff --git a/dma-helpers.c b/dma-helpers.c
index 33b1983..4b51425 100644
--- a/dma-helpers.c
+++ b/dma-helpers.c
@@ -10,7 +10,6 @@
 #include "sysemu/block-backend.h"
 #include "sysemu/dma.h"
 #include "trace.h"
-#include "qemu/range.h"
 #include "qemu/thread.h"
 #include "qemu/main-loop.h"
 
diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c
index 77e1126..1e11af9 100644
--- a/hw/acpi/pcihp.c
+++ b/hw/acpi/pcihp.c
@@ -31,7 +31,6 @@
 #include "hw/pci/pci.h"
 #include "hw/acpi/acpi.h"
 #include "sysemu/sysemu.h"
-#include "qemu/range.h"
 #include "exec/ioport.h"
 #include "exec/address-spaces.h"
 #include "hw/pci/pci_bus.h"
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index e761005..420e30a 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -26,7 +26,6 @@
 #include "qemu-common.h"
 #include "qemu/bitmap.h"
 #include "qemu/osdep.h"
-#include "qemu/range.h"
 #include "qemu/error-report.h"
 #include "hw/pci/pci.h"
 #include "qom/cpu.h"
diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h
index 59ea25b..c171578 100644
--- a/include/hw/i386/ich9.h
+++ b/include/hw/i386/ich9.h
@@ -2,7 +2,6 @@
 #define HW_ICH9_H
 
 #include "hw/hw.h"
-#include "qemu/range.h"
 #include "hw/isa/isa.h"
 #include "hw/sysbus.h"
 #include "hw/i386/pc.h"
diff --git a/include/hw/pci-host/q35.h b/include/hw/pci-host/q35.h
index 025d6e6..96d4cdc 100644
--- a/include/hw/pci-host/q35.h
+++ b/include/hw/pci-host/q35.h
@@ -23,7 +23,6 @@
 #define HW_Q35_H
 
 #include "hw/hw.h"
-#include "qemu/range.h"
 #include "hw/isa/isa.h"
 #include "hw/sysbus.h"
 #include "hw/i386/pc.h"
-- 
2.1.4

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

* [Qemu-devel] [PULL 10/42] qemu-config: remove stray inclusions of hw/ files
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (8 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 09/42] range: remove useless inclusions Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 11/42] tpm: fix coding style Michael Tokarev
                   ` (32 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Paolo Bonzini, Michael Tokarev

From: Paolo Bonzini <pbonzini@redhat.com>

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 util/qemu-config.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/util/qemu-config.c b/util/qemu-config.c
index a393a3d..30d6dcf 100644
--- a/util/qemu-config.c
+++ b/util/qemu-config.c
@@ -3,10 +3,8 @@
 #include "qemu/option.h"
 #include "qemu/config-file.h"
 #include "qapi/qmp/qerror.h"
-#include "hw/qdev.h"
 #include "qapi/error.h"
 #include "qmp-commands.h"
-#include "hw/i386/pc.h"
 
 static QemuOptsList *vm_config_groups[32];
 static QemuOptsList *drive_config_groups[4];
-- 
2.1.4

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

* [Qemu-devel] [PULL 11/42] tpm: fix coding style
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (9 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 10/42] qemu-config: remove stray inclusions of hw/ files Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 12/42] hostmem: Fix mem-path property name in error report Michael Tokarev
                   ` (31 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Stefan Berger

From: Stefan Berger <stefanb@linux.vnet.ibm.com>

Fix coding style in one instance.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/tpm/tpm_tis.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
index 4b6d601..b8235d5 100644
--- a/hw/tpm/tpm_tis.c
+++ b/hw/tpm/tpm_tis.c
@@ -842,7 +842,7 @@ static void tpm_tis_mmio_write_intern(void *opaque, hwaddr addr,
                 (tis->loc[locty].sts & TPM_TIS_STS_EXPECT)) {
                 /* we have a packet length - see if we have all of it */
 #ifdef RAISE_STS_IRQ
-                bool needIrq = !(tis->loc[locty].sts & TPM_TIS_STS_VALID);
+                bool need_irq = !(tis->loc[locty].sts & TPM_TIS_STS_VALID);
 #endif
                 len = tpm_tis_get_size_from_buffer(&tis->loc[locty].w_buffer);
                 if (len > tis->loc[locty].w_offset) {
@@ -853,7 +853,7 @@ static void tpm_tis_mmio_write_intern(void *opaque, hwaddr addr,
                     tpm_tis_sts_set(&tis->loc[locty], TPM_TIS_STS_VALID);
                 }
 #ifdef RAISE_STS_IRQ
-                if (needIrq) {
+                if (need_irq) {
                     tpm_tis_raise_irq(s, locty, TPM_TIS_INT_STS_VALID);
                 }
 #endif
-- 
2.1.4

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

* [Qemu-devel] [PULL 12/42] hostmem: Fix mem-path property name in error report
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (10 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 11/42] tpm: fix coding style Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 13/42] qemu-options: trivial spelling fix (messsage) Michael Tokarev
                   ` (30 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Jan Kiszka, Michael Tokarev

From: Jan Kiszka <jan.kiszka@siemens.com>

The subtle difference between "property not found" and "property not
set" is already confusing enough.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 backends/hostmem-file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c
index 5179994..4b55361 100644
--- a/backends/hostmem-file.c
+++ b/backends/hostmem-file.c
@@ -43,7 +43,7 @@ file_backend_memory_alloc(HostMemoryBackend *backend, Error **errp)
         return;
     }
     if (!fb->mem_path) {
-        error_setg(errp, "mem_path property not set");
+        error_setg(errp, "mem-path property not set");
         return;
     }
 #ifndef CONFIG_LINUX
-- 
2.1.4

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

* [Qemu-devel] [PULL 13/42] qemu-options: trivial spelling fix (messsage)
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (11 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 12/42] hostmem: Fix mem-path property name in error report Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 14/42] vmxnet: Remove unused function vmxnet_rx_pkt_get_num_frags() Michael Tokarev
                   ` (29 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
 qemu-options.hx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index 319d971..ec356f6 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -3106,7 +3106,7 @@ executed often has little or no correlation with actual performance.
 to synchronise the host clock and the virtual clock. The goal is to
 have a guest running at the real frequency imposed by the shift option.
 Whenever the guest clock is behind the host clock and if
-@option{align=on} is specified then we print a messsage to the user
+@option{align=on} is specified then we print a message to the user
 to inform about the delay.
 Currently this option does not work when @option{shift} is @code{auto}.
 Note: The sync algorithm will work for those shift values for which
-- 
2.1.4

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

* [Qemu-devel] [PULL 14/42] vmxnet: Remove unused function vmxnet_rx_pkt_get_num_frags()
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (12 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 13/42] qemu-options: trivial spelling fix (messsage) Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 15/42] pci: Remove unused function ich9_d2pbr_init() Michael Tokarev
                   ` (28 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Dmitry Fleytman, Michael Tokarev, Thomas Huth

From: Thomas Huth <thuth@linux.vnet.ibm.com>

The function is not used anymore and thus can be deleted.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Cc: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/net/vmxnet_rx_pkt.c | 7 -------
 hw/net/vmxnet_rx_pkt.h | 9 ---------
 2 files changed, 16 deletions(-)

diff --git a/hw/net/vmxnet_rx_pkt.c b/hw/net/vmxnet_rx_pkt.c
index a40e346..acbca6a 100644
--- a/hw/net/vmxnet_rx_pkt.c
+++ b/hw/net/vmxnet_rx_pkt.c
@@ -172,13 +172,6 @@ bool vmxnet_rx_pkt_has_virt_hdr(struct VmxnetRxPkt *pkt)
     return pkt->has_virt_hdr;
 }
 
-uint16_t vmxnet_rx_pkt_get_num_frags(struct VmxnetRxPkt *pkt)
-{
-    assert(pkt);
-
-    return pkt->vec_len;
-}
-
 uint16_t vmxnet_rx_pkt_get_vlan_tag(struct VmxnetRxPkt *pkt)
 {
     assert(pkt);
diff --git a/hw/net/vmxnet_rx_pkt.h b/hw/net/vmxnet_rx_pkt.h
index 6b2c60e..5f8352a 100644
--- a/hw/net/vmxnet_rx_pkt.h
+++ b/hw/net/vmxnet_rx_pkt.h
@@ -114,15 +114,6 @@ bool vmxnet_rx_pkt_is_vlan_stripped(struct VmxnetRxPkt *pkt);
 bool vmxnet_rx_pkt_has_virt_hdr(struct VmxnetRxPkt *pkt);
 
 /**
- * returns number of frags attached to the packet
- *
- * @pkt:            packet
- * @ret:            number of frags
- *
- */
-uint16_t vmxnet_rx_pkt_get_num_frags(struct VmxnetRxPkt *pkt);
-
-/**
  * attach data to rx packet
  *
  * @pkt:            packet
-- 
2.1.4

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

* [Qemu-devel] [PULL 15/42] pci: Remove unused function ich9_d2pbr_init()
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (13 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 14/42] vmxnet: Remove unused function vmxnet_rx_pkt_get_num_frags() Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 16/42] monitor: Remove unused functions Michael Tokarev
                   ` (27 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Thomas Huth

From: Thomas Huth <thuth@linux.vnet.ibm.com>

The function ich9_d2pbr_init() is completely unused and
thus can be deleted.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/pci-bridge/i82801b11.c | 21 ---------------------
 include/hw/i386/ich9.h    |  1 -
 2 files changed, 22 deletions(-)

diff --git a/hw/pci-bridge/i82801b11.c b/hw/pci-bridge/i82801b11.c
index 14cd7fd..7e79bc0 100644
--- a/hw/pci-bridge/i82801b11.c
+++ b/hw/pci-bridge/i82801b11.c
@@ -101,27 +101,6 @@ static const TypeInfo i82801b11_bridge_info = {
     .class_init    = i82801b11_bridge_class_init,
 };
 
-PCIBus *ich9_d2pbr_init(PCIBus *bus, int devfn, int sec_bus)
-{
-    PCIDevice *d;
-    PCIBridge *br;
-    char buf[16];
-    DeviceState *qdev;
-
-    d = pci_create_multifunction(bus, devfn, true, "i82801b11-bridge");
-    if (!d) {
-        return NULL;
-    }
-    br = PCI_BRIDGE(d);
-    qdev = DEVICE(d);
-
-    snprintf(buf, sizeof(buf), "pci.%d", sec_bus);
-    pci_bridge_map_irq(br, buf, pci_swizzle_map_irq_fn);
-    qdev_init_nofail(qdev);
-
-    return pci_bridge_get_sec_bus(br);
-}
-
 static void d2pbr_register(void)
 {
     type_register_static(&i82801b11_bridge_info);
diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h
index c171578..f4e522c 100644
--- a/include/hw/i386/ich9.h
+++ b/include/hw/i386/ich9.h
@@ -18,7 +18,6 @@ void ich9_lpc_set_irq(void *opaque, int irq_num, int level);
 int ich9_lpc_map_irq(PCIDevice *pci_dev, int intx);
 PCIINTxRoute ich9_route_intx_pin_to_irq(void *opaque, int pirq_pin);
 void ich9_lpc_pm_init(PCIDevice *pci_lpc);
-PCIBus *ich9_d2pbr_init(PCIBus *bus, int devfn, int sec_bus);
 I2CBus *ich9_smb_init(PCIBus *bus, int devfn, uint32_t smb_io_base);
 
 #define ICH9_CC_SIZE                            (16 * 1024)     /* 16KB */
-- 
2.1.4

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

* [Qemu-devel] [PULL 16/42] monitor: Remove unused functions
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (14 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 15/42] pci: Remove unused function ich9_d2pbr_init() Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 17/42] usb: " Michael Tokarev
                   ` (26 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Thomas Huth, Luiz Capitulino

From: Thomas Huth <thuth@linux.vnet.ibm.com>

The functions ringbuf_read_completion() and monitor_get_rs()
are not used anywhere anymore, so let's remove them.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Cc: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hmp.h                     |  1 -
 include/monitor/monitor.h |  1 -
 monitor.c                 | 13 -------------
 3 files changed, 15 deletions(-)

diff --git a/hmp.h b/hmp.h
index 2b9308b..12acb6d 100644
--- a/hmp.h
+++ b/hmp.h
@@ -109,7 +109,6 @@ void set_link_completion(ReadLineState *rs, int nb_args, const char *str);
 void netdev_add_completion(ReadLineState *rs, int nb_args, const char *str);
 void netdev_del_completion(ReadLineState *rs, int nb_args, const char *str);
 void ringbuf_write_completion(ReadLineState *rs, int nb_args, const char *str);
-void ringbuf_read_completion(ReadLineState *rs, int nb_args, const char *str);
 void watchdog_action_completion(ReadLineState *rs, int nb_args,
                                 const char *str);
 void migrate_set_capability_completion(ReadLineState *rs, int nb_args,
diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h
index 1c06bed..df67d56 100644
--- a/include/monitor/monitor.h
+++ b/include/monitor/monitor.h
@@ -47,7 +47,6 @@ typedef void (MonitorCompletion)(void *opaque, QObject *ret_data);
 
 void monitor_set_error(Monitor *mon, QError *qerror);
 void monitor_read_command(Monitor *mon, int show_prompt);
-ReadLineState *monitor_get_rs(Monitor *mon);
 int monitor_read_password(Monitor *mon, ReadLineFunc *readline_func,
                           void *opaque);
 
diff --git a/monitor.c b/monitor.c
index 31369d3..d831d98 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4390,14 +4390,6 @@ static void ringbuf_completion(ReadLineState *rs, const char *str)
     qapi_free_ChardevInfoList(start);
 }
 
-void ringbuf_read_completion(ReadLineState *rs, int nb_args, const char *str)
-{
-    if (nb_args != 2) {
-        return;
-    }
-    ringbuf_completion(rs, str);
-}
-
 void ringbuf_write_completion(ReadLineState *rs, int nb_args, const char *str)
 {
     if (nb_args != 2) {
@@ -5392,11 +5384,6 @@ static void bdrv_password_cb(void *opaque, const char *password,
     monitor_read_command(mon, 1);
 }
 
-ReadLineState *monitor_get_rs(Monitor *mon)
-{
-    return mon->rs;
-}
-
 int monitor_read_bdrv_key_start(Monitor *mon, BlockDriverState *bs,
                                 BlockCompletionFunc *completion_cb,
                                 void *opaque)
-- 
2.1.4

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

* [Qemu-devel] [PULL 17/42] usb: Remove unused functions
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (15 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 16/42] monitor: Remove unused functions Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 18/42] util: " Michael Tokarev
                   ` (25 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Thomas Huth

From: Thomas Huth <thuth@linux.vnet.ibm.com>

Delete set_usb_string(), usb_ep_get_ifnum(), usb_ep_get_max_packet_size()
usb_ep_get_max_streams() and usb_ep_set_pipeline() since they are
not used anymore.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/usb/core.c    | 41 -----------------------------------------
 include/hw/usb.h |  5 -----
 2 files changed, 46 deletions(-)

diff --git a/hw/usb/core.c b/hw/usb/core.c
index cf34755..d0025db 100644
--- a/hw/usb/core.c
+++ b/hw/usb/core.c
@@ -331,23 +331,6 @@ void usb_generic_async_ctrl_complete(USBDevice *s, USBPacket *p)
     usb_packet_complete(s, p);
 }
 
-/* XXX: fix overflow */
-int set_usb_string(uint8_t *buf, const char *str)
-{
-    int len, i;
-    uint8_t *q;
-
-    q = buf;
-    len = strlen(str);
-    *q++ = 2 * len + 2;
-    *q++ = 3;
-    for(i = 0; i < len; i++) {
-        *q++ = str[i];
-        *q++ = 0;
-    }
-    return q - buf;
-}
-
 USBDevice *usb_find_device(USBPort *port, uint8_t addr)
 {
     USBDevice *dev = port->dev;
@@ -749,12 +732,6 @@ void usb_ep_set_type(USBDevice *dev, int pid, int ep, uint8_t type)
     uep->type = type;
 }
 
-uint8_t usb_ep_get_ifnum(USBDevice *dev, int pid, int ep)
-{
-    struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
-    return uep->ifnum;
-}
-
 void usb_ep_set_ifnum(USBDevice *dev, int pid, int ep, uint8_t ifnum)
 {
     struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
@@ -782,12 +759,6 @@ void usb_ep_set_max_packet_size(USBDevice *dev, int pid, int ep,
     uep->max_packet_size = size * microframes;
 }
 
-int usb_ep_get_max_packet_size(USBDevice *dev, int pid, int ep)
-{
-    struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
-    return uep->max_packet_size;
-}
-
 void usb_ep_set_max_streams(USBDevice *dev, int pid, int ep, uint8_t raw)
 {
     struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
@@ -801,18 +772,6 @@ void usb_ep_set_max_streams(USBDevice *dev, int pid, int ep, uint8_t raw)
     }
 }
 
-int usb_ep_get_max_streams(USBDevice *dev, int pid, int ep)
-{
-    struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
-    return uep->max_streams;
-}
-
-void usb_ep_set_pipeline(USBDevice *dev, int pid, int ep, bool enabled)
-{
-    struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
-    uep->pipeline = enabled;
-}
-
 void usb_ep_set_halted(USBDevice *dev, int pid, int ep, bool halted)
 {
     struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
diff --git a/include/hw/usb.h b/include/hw/usb.h
index 5be2937..c8b6e7b 100644
--- a/include/hw/usb.h
+++ b/include/hw/usb.h
@@ -445,15 +445,11 @@ void usb_ep_reset(USBDevice *dev);
 void usb_ep_dump(USBDevice *dev);
 struct USBEndpoint *usb_ep_get(USBDevice *dev, int pid, int ep);
 uint8_t usb_ep_get_type(USBDevice *dev, int pid, int ep);
-uint8_t usb_ep_get_ifnum(USBDevice *dev, int pid, int ep);
 void usb_ep_set_type(USBDevice *dev, int pid, int ep, uint8_t type);
 void usb_ep_set_ifnum(USBDevice *dev, int pid, int ep, uint8_t ifnum);
 void usb_ep_set_max_packet_size(USBDevice *dev, int pid, int ep,
                                 uint16_t raw);
-int usb_ep_get_max_packet_size(USBDevice *dev, int pid, int ep);
 void usb_ep_set_max_streams(USBDevice *dev, int pid, int ep, uint8_t raw);
-int usb_ep_get_max_streams(USBDevice *dev, int pid, int ep);
-void usb_ep_set_pipeline(USBDevice *dev, int pid, int ep, bool enabled);
 void usb_ep_set_halted(USBDevice *dev, int pid, int ep, bool halted);
 USBPacket *usb_ep_find_packet_by_id(USBDevice *dev, int pid, int ep,
                                     uint64_t id);
@@ -469,7 +465,6 @@ void usb_port_reset(USBPort *port);
 void usb_device_reset(USBDevice *dev);
 void usb_wakeup(USBEndpoint *ep, unsigned int stream);
 void usb_generic_async_ctrl_complete(USBDevice *s, USBPacket *p);
-int set_usb_string(uint8_t *buf, const char *str);
 
 /* usb-linux.c */
 USBDevice *usb_host_device_open(USBBus *bus, const char *devname);
-- 
2.1.4

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

* [Qemu-devel] [PULL 18/42] util: Remove unused functions
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (16 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 17/42] usb: " Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 19/42] arm: cpu.h: Remove unused typdefs Michael Tokarev
                   ` (24 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Thomas Huth

From: Thomas Huth <thuth@linux.vnet.ibm.com>

Delete the unused functions qemu_signalfd_available(),
qemu_send_full() and qemu_recv_full().

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 include/qemu-common.h   |  4 ---
 include/qemu/compatfd.h |  1 -
 util/compatfd.c         | 19 --------------
 util/osdep.c            | 66 -------------------------------------------------
 4 files changed, 90 deletions(-)

diff --git a/include/qemu-common.h b/include/qemu-common.h
index 1b5cffb..6b373ff 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -217,10 +217,6 @@ void *qemu_oom_check(void *ptr);
 
 ssize_t qemu_write_full(int fd, const void *buf, size_t count)
     QEMU_WARN_UNUSED_RESULT;
-ssize_t qemu_send_full(int fd, const void *buf, size_t count, int flags)
-    QEMU_WARN_UNUSED_RESULT;
-ssize_t qemu_recv_full(int fd, void *buf, size_t count, int flags)
-    QEMU_WARN_UNUSED_RESULT;
 
 #ifndef _WIN32
 int qemu_pipe(int pipefd[2]);
diff --git a/include/qemu/compatfd.h b/include/qemu/compatfd.h
index 6b04877..fc37915 100644
--- a/include/qemu/compatfd.h
+++ b/include/qemu/compatfd.h
@@ -39,6 +39,5 @@ struct qemu_signalfd_siginfo {
 };
 
 int qemu_signalfd(const sigset_t *mask);
-bool qemu_signalfd_available(void);
 
 #endif
diff --git a/util/compatfd.c b/util/compatfd.c
index 341ada6..e857150 100644
--- a/util/compatfd.c
+++ b/util/compatfd.c
@@ -108,22 +108,3 @@ int qemu_signalfd(const sigset_t *mask)
 
     return qemu_signalfd_compat(mask);
 }
-
-bool qemu_signalfd_available(void)
-{
-#ifdef CONFIG_SIGNALFD
-    sigset_t mask;
-    int fd;
-    bool ok;
-    sigemptyset(&mask);
-    errno = 0;
-    fd = syscall(SYS_signalfd, -1, &mask, _NSIG / 8);
-    ok = (errno != ENOSYS);
-    if (fd >= 0) {
-        close(fd);
-    }
-    return ok;
-#else
-    return false;
-#endif
-}
diff --git a/util/osdep.c b/util/osdep.c
index b2bd154..f938b69 100644
--- a/util/osdep.c
+++ b/util/osdep.c
@@ -310,72 +310,6 @@ int qemu_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
     return ret;
 }
 
-/*
- * A variant of send(2) which handles partial write.
- *
- * Return the number of bytes transferred, which is only
- * smaller than `count' if there is an error.
- *
- * This function won't work with non-blocking fd's.
- * Any of the possibilities with non-bloking fd's is bad:
- *   - return a short write (then name is wrong)
- *   - busy wait adding (errno == EAGAIN) to the loop
- */
-ssize_t qemu_send_full(int fd, const void *buf, size_t count, int flags)
-{
-    ssize_t ret = 0;
-    ssize_t total = 0;
-
-    while (count) {
-        ret = send(fd, buf, count, flags);
-        if (ret < 0) {
-            if (errno == EINTR) {
-                continue;
-            }
-            break;
-        }
-
-        count -= ret;
-        buf += ret;
-        total += ret;
-    }
-
-    return total;
-}
-
-/*
- * A variant of recv(2) which handles partial write.
- *
- * Return the number of bytes transferred, which is only
- * smaller than `count' if there is an error.
- *
- * This function won't work with non-blocking fd's.
- * Any of the possibilities with non-bloking fd's is bad:
- *   - return a short write (then name is wrong)
- *   - busy wait adding (errno == EAGAIN) to the loop
- */
-ssize_t qemu_recv_full(int fd, void *buf, size_t count, int flags)
-{
-    ssize_t ret = 0;
-    ssize_t total = 0;
-
-    while (count) {
-        ret = qemu_recv(fd, buf, count, flags);
-        if (ret <= 0) {
-            if (ret < 0 && errno == EINTR) {
-                continue;
-            }
-            break;
-        }
-
-        count -= ret;
-        buf += ret;
-        total += ret;
-    }
-
-    return total;
-}
-
 void qemu_set_version(const char *version)
 {
     qemu_version = version;
-- 
2.1.4

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

* [Qemu-devel] [PULL 19/42] arm: cpu.h: Remove unused typdefs
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (17 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 18/42] util: " Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 20/42] configure: alphabetize tricore in target list Michael Tokarev
                   ` (23 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Peter Crosthwaite, Michael Tokarev, Peter Crosthwaite

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

These CP accessor function prototypes are unused. Remove them.

Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 target-arm/cpu.h | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index d63d9b2..8df0b6a 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -93,11 +93,6 @@
 #define ARM_CPU_VIRQ 2
 #define ARM_CPU_VFIQ 3
 
-typedef void ARMWriteCPFunc(void *opaque, int cp_info,
-                            int srcreg, int operand, uint32_t value);
-typedef uint32_t ARMReadCPFunc(void *opaque, int cp_info,
-                               int dstreg, int operand);
-
 struct arm_boot_info;
 
 #define NB_MMU_MODES 7
-- 
2.1.4

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

* [Qemu-devel] [PULL 20/42] configure: alphabetize tricore in target list
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (18 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 19/42] arm: cpu.h: Remove unused typdefs Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 21/42] docs/atomics.txt: fix two typos Michael Tokarev
                   ` (22 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Peter Crosthwaite, Michael Tokarev, Peter Crosthwaite

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

tricore was out of alphabetical order in the target list. Fix.

Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Acked-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 configure | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 6969f6f..9f0d9bb 100755
--- a/configure
+++ b/configure
@@ -5169,8 +5169,6 @@ case "$target_name" in
     TARGET_BASE_ARCH=mips
     echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak
   ;;
-  tricore)
-  ;;
   moxie)
   ;;
   or32)
@@ -5221,6 +5219,8 @@ case "$target_name" in
   s390x)
     gdb_xml_files="s390x-core64.xml s390-acr.xml s390-fpr.xml"
   ;;
+  tricore)
+  ;;
   unicore32)
   ;;
   xtensa|xtensaeb)
-- 
2.1.4

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

* [Qemu-devel] [PULL 21/42] docs/atomics.txt: fix two typos
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (19 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 20/42] configure: alphabetize tricore in target list Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 22/42] libcacard: stop including qemu-common.h Michael Tokarev
                   ` (21 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Paolo Bonzini, Michael Tokarev, Laszlo Ersek

From: Laszlo Ersek <lersek@redhat.com>

Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 docs/atomics.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/atomics.txt b/docs/atomics.txt
index 6f2997b..ef285e3 100644
--- a/docs/atomics.txt
+++ b/docs/atomics.txt
@@ -281,7 +281,7 @@ note that the other barrier may actually be in a driver that runs in
 the guest!
 
 For the purposes of pairing, smp_read_barrier_depends() and smp_rmb()
-both count as read barriers.  A read barriers shall pair with a write
+both count as read barriers.  A read barrier shall pair with a write
 barrier or a full barrier; a write barrier shall pair with a read
 barrier or a full barrier.  A full barrier can pair with anything.
 For example:
@@ -294,7 +294,7 @@ For example:
                              smp_rmb();
                              y = a;
 
-Note that the "writing" thread are accessing the variables in the
+Note that the "writing" thread is accessing the variables in the
 opposite order as the "reading" thread.  This is expected: stores
 before the write barrier will normally match the loads after the
 read barrier, and vice versa.  The same is true for more than 2
-- 
2.1.4

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

* [Qemu-devel] [PULL 22/42] libcacard: stop including qemu-common.h
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (20 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 21/42] docs/atomics.txt: fix two typos Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 23/42] libcacard: do not use full paths for include files in the same dir Michael Tokarev
                   ` (20 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Paolo Bonzini, Michael Tokarev

From: Paolo Bonzini <pbonzini@redhat.com>

This is a small step towards making libcacard standalone.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 libcacard/cac.c            | 5 ++++-
 libcacard/card_7816.c      | 4 +++-
 libcacard/event.c          | 2 +-
 libcacard/vcard.c          | 4 +++-
 libcacard/vcard_emul_nss.c | 2 +-
 libcacard/vreader.c        | 4 +++-
 libcacard/vscclient.c      | 8 +++++++-
 7 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/libcacard/cac.c b/libcacard/cac.c
index f38fdce..bc84534 100644
--- a/libcacard/cac.c
+++ b/libcacard/cac.c
@@ -5,7 +5,10 @@
  * See the COPYING.LIB file in the top-level directory.
  */
 
-#include "qemu-common.h"
+#include "glib-compat.h"
+
+#include <string.h>
+#include <stdbool.h>
 
 #include "cac.h"
 #include "vcard.h"
diff --git a/libcacard/card_7816.c b/libcacard/card_7816.c
index 814fa16..22fd334 100644
--- a/libcacard/card_7816.c
+++ b/libcacard/card_7816.c
@@ -5,7 +5,9 @@
  * See the COPYING.LIB file in the top-level directory.
  */
 
-#include "qemu-common.h"
+#include "glib-compat.h"
+
+#include <string.h>
 
 #include "vcard.h"
 #include "vcard_emul.h"
diff --git a/libcacard/event.c b/libcacard/event.c
index 4c551e4..63f4057 100644
--- a/libcacard/event.c
+++ b/libcacard/event.c
@@ -5,7 +5,7 @@
  * See the COPYING.LIB file in the top-level directory.
  */
 
-#include "qemu-common.h"
+#include "glib-compat.h"
 
 #include "vcard.h"
 #include "vreader.h"
diff --git a/libcacard/vcard.c b/libcacard/vcard.c
index d140a8e..1a87208 100644
--- a/libcacard/vcard.c
+++ b/libcacard/vcard.c
@@ -5,7 +5,9 @@
  * See the COPYING.LIB file in the top-level directory.
  */
 
-#include "qemu-common.h"
+#include "glib-compat.h"
+
+#include <string.h>
 
 #include "vcard.h"
 #include "vcard_emul.h"
diff --git a/libcacard/vcard_emul_nss.c b/libcacard/vcard_emul_nss.c
index 950edee..6955f69 100644
--- a/libcacard/vcard_emul_nss.c
+++ b/libcacard/vcard_emul_nss.c
@@ -25,7 +25,7 @@
 #include <prthread.h>
 #include <secerr.h>
 
-#include "qemu-common.h"
+#include "glib-compat.h"
 
 #include "vcard.h"
 #include "card_7816t.h"
diff --git a/libcacard/vreader.c b/libcacard/vreader.c
index 0315dd8..9725f46 100644
--- a/libcacard/vreader.c
+++ b/libcacard/vreader.c
@@ -10,7 +10,9 @@
 #endif
 #define G_LOG_DOMAIN "libcacard"
 
-#include "qemu-common.h"
+#include "glib-compat.h"
+
+#include <string.h>
 
 #include "vcard.h"
 #include "vcard_emul.h"
diff --git a/libcacard/vscclient.c b/libcacard/vscclient.c
index fa6041d..0652684 100644
--- a/libcacard/vscclient.c
+++ b/libcacard/vscclient.c
@@ -10,14 +10,20 @@
  * See the COPYING.LIB file in the top-level directory.
  */
 
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #ifndef _WIN32
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <netdb.h>
+#include <unistd.h>
 #define closesocket(x) close(x)
+#else
+#include <getopt.h>
 #endif
 
-#include "qemu-common.h"
+#include "glib-compat.h"
 
 #include "vscard_common.h"
 
-- 
2.1.4

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

* [Qemu-devel] [PULL 23/42] libcacard: do not use full paths for include files in the same dir
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (21 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 22/42] libcacard: stop including qemu-common.h Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 24/42] defconfigs: Piggyback microblazeel on microblaze Michael Tokarev
                   ` (19 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
---
 libcacard/vcard_emul_nss.c | 2 +-
 libcacard/vcardt.c         | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libcacard/vcard_emul_nss.c b/libcacard/vcard_emul_nss.c
index 6955f69..d9761ee 100644
--- a/libcacard/vcard_emul_nss.c
+++ b/libcacard/vcard_emul_nss.c
@@ -33,7 +33,7 @@
 #include "vreader.h"
 #include "vevent.h"
 
-#include "libcacard/vcardt_internal.h"
+#include "vcardt_internal.h"
 
 
 typedef enum {
diff --git a/libcacard/vcardt.c b/libcacard/vcardt.c
index 9ce4648..c67de2f 100644
--- a/libcacard/vcardt.c
+++ b/libcacard/vcardt.c
@@ -2,9 +2,9 @@
 #include <string.h>
 #include <glib.h>
 
-#include "libcacard/vcardt.h"
+#include "vcardt.h"
 
-#include "libcacard/vcardt_internal.h"
+#include "vcardt_internal.h"
 
 /* create an ATR with appropriate historical bytes */
 #define ATR_TS_DIRECT_CONVENTION 0x3b
-- 
2.1.4

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

* [Qemu-devel] [PULL 24/42] defconfigs: Piggyback microblazeel on microblaze
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (22 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 23/42] libcacard: do not use full paths for include files in the same dir Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 25/42] microblaze: mmu: Delete flip_um fn prototype Michael Tokarev
                   ` (18 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Peter Crosthwaite, Michael Tokarev, Peter Crosthwaite

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

Theres no difference in defconfig. Going forward microblazeel should
superset microblaze so use an include.

Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 default-configs/microblazeel-softmmu.mak | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/default-configs/microblazeel-softmmu.mak b/default-configs/microblazeel-softmmu.mak
index acf22c5..2fcf442 100644
--- a/default-configs/microblazeel-softmmu.mak
+++ b/default-configs/microblazeel-softmmu.mak
@@ -1,11 +1,3 @@
 # Default configuration for microblazeel-softmmu
 
-CONFIG_PTIMER=y
-CONFIG_PFLASH_CFI01=y
-CONFIG_SERIAL=y
-CONFIG_XILINX=y
-CONFIG_XILINX_AXI=y
-CONFIG_XILINX_SPI=y
-CONFIG_XILINX_ETHLITE=y
-CONFIG_SSI=y
-CONFIG_SSI_M25P80=y
+include microblaze-softmmu.mak
-- 
2.1.4

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

* [Qemu-devel] [PULL 25/42] microblaze: mmu: Delete flip_um fn prototype
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (23 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 24/42] defconfigs: Piggyback microblazeel on microblaze Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 26/42] microblaze: cpu: Remote unused cpu_get_pc Michael Tokarev
                   ` (17 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Peter Crosthwaite, Michael Tokarev, Peter Crosthwaite

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

This is not implemented or used.

Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 target-microblaze/mmu.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target-microblaze/mmu.h b/target-microblaze/mmu.h
index 3f74dda..3b7a998 100644
--- a/target-microblaze/mmu.h
+++ b/target-microblaze/mmu.h
@@ -82,7 +82,6 @@ struct microblaze_mmu_lookup
     } err;
 };
 
-void mmu_flip_um(CPUMBState *env, unsigned int um);
 unsigned int mmu_translate(struct microblaze_mmu *mmu,
                            struct microblaze_mmu_lookup *lu,
                            target_ulong vaddr, int rw, int mmu_idx);
-- 
2.1.4

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

* [Qemu-devel] [PULL 26/42] microblaze: cpu: Remote unused cpu_get_pc
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (24 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 25/42] microblaze: mmu: Delete flip_um fn prototype Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 27/42] microblaze: cpu: Remove unused CC_OP enum Michael Tokarev
                   ` (16 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Peter Crosthwaite, Michael Tokarev, Peter Crosthwaite

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

This function is not used by anything. Remove.

Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 target-microblaze/cpu.h | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/target-microblaze/cpu.h b/target-microblaze/cpu.h
index 7d06227..2c18b49 100644
--- a/target-microblaze/cpu.h
+++ b/target-microblaze/cpu.h
@@ -333,11 +333,6 @@ static inline int cpu_interrupts_enabled(CPUMBState *env)
 
 #include "exec/cpu-all.h"
 
-static inline target_ulong cpu_get_pc(CPUMBState *env)
-{
-    return env->sregs[SR_PC];
-}
-
 static inline void cpu_get_tb_cpu_state(CPUMBState *env, target_ulong *pc,
                                         target_ulong *cs_base, int *flags)
 {
-- 
2.1.4

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

* [Qemu-devel] [PULL 27/42] microblaze: cpu: Remove unused CC_OP enum
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (25 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 26/42] microblaze: cpu: Remote unused cpu_get_pc Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 28/42] microblaze: cpu: Delete EXCP_NMI Michael Tokarev
                   ` (15 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Peter Crosthwaite, Michael Tokarev, Peter Crosthwaite

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

This enum is not used by anything. Remove.

Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 target-microblaze/cpu.h | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/target-microblaze/cpu.h b/target-microblaze/cpu.h
index 2c18b49..f21da2f 100644
--- a/target-microblaze/cpu.h
+++ b/target-microblaze/cpu.h
@@ -284,12 +284,6 @@ int cpu_mb_exec(CPUMBState *s);
 int cpu_mb_signal_handler(int host_signum, void *pinfo,
                           void *puc);
 
-enum {
-    CC_OP_DYNAMIC, /* Use env->cc_op  */
-    CC_OP_FLAGS,
-    CC_OP_CMP,
-};
-
 /* FIXME: MB uses variable pages down to 1K but linux only uses 4k.  */
 #define TARGET_PAGE_BITS 12
 #define MMAP_SHIFT TARGET_PAGE_BITS
-- 
2.1.4

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

* [Qemu-devel] [PULL 28/42] microblaze: cpu: Delete EXCP_NMI
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (26 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 27/42] microblaze: cpu: Remove unused CC_OP enum Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 29/42] microblaze: cpu: Renumber EXCP_* constants to close gap Michael Tokarev
                   ` (14 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Peter Crosthwaite, Michael Tokarev, Peter Crosthwaite

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

This define is unused. Remove.

Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 target-microblaze/cpu.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target-microblaze/cpu.h b/target-microblaze/cpu.h
index f21da2f..6522af7 100644
--- a/target-microblaze/cpu.h
+++ b/target-microblaze/cpu.h
@@ -36,7 +36,6 @@ typedef struct CPUMBState CPUMBState;
 
 #define ELF_MACHINE	EM_MICROBLAZE
 
-#define EXCP_NMI        1
 #define EXCP_MMU        2
 #define EXCP_IRQ        3
 #define EXCP_BREAK      4
-- 
2.1.4

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

* [Qemu-devel] [PULL 29/42] microblaze: cpu: Renumber EXCP_* constants to close gap
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (27 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 28/42] microblaze: cpu: Delete EXCP_NMI Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 30/42] microblaze: cpu: delete unused cpu_interrupts_enabled Michael Tokarev
                   ` (13 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev

After removal of EXCP_NMI there's a gap in EXCP_*
numbering. Let's remove it.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
---
 target-microblaze/cpu.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/target-microblaze/cpu.h b/target-microblaze/cpu.h
index 6522af7..d389597 100644
--- a/target-microblaze/cpu.h
+++ b/target-microblaze/cpu.h
@@ -36,11 +36,11 @@ typedef struct CPUMBState CPUMBState;
 
 #define ELF_MACHINE	EM_MICROBLAZE
 
-#define EXCP_MMU        2
-#define EXCP_IRQ        3
-#define EXCP_BREAK      4
-#define EXCP_HW_BREAK   5
-#define EXCP_HW_EXCP    6
+#define EXCP_MMU        1
+#define EXCP_IRQ        2
+#define EXCP_BREAK      3
+#define EXCP_HW_BREAK   4
+#define EXCP_HW_EXCP    5
 
 /* MicroBlaze-specific interrupt pending bits.  */
 #define CPU_INTERRUPT_NMI       CPU_INTERRUPT_TGT_EXT_3
-- 
2.1.4

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

* [Qemu-devel] [PULL 30/42] microblaze: cpu: delete unused cpu_interrupts_enabled
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (28 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 29/42] microblaze: cpu: Renumber EXCP_* constants to close gap Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 31/42] cpus: use first_cpu macro instead of QTAILQ_FIRST(&cpus) Michael Tokarev
                   ` (12 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Peter Crosthwaite, Michael Tokarev, Peter Crosthwaite

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

This function is unused. Remove.

Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 target-microblaze/cpu.h | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/target-microblaze/cpu.h b/target-microblaze/cpu.h
index d389597..4ea04ac 100644
--- a/target-microblaze/cpu.h
+++ b/target-microblaze/cpu.h
@@ -319,11 +319,6 @@ static inline int cpu_mmu_index (CPUMBState *env)
 int mb_cpu_handle_mmu_fault(CPUState *cpu, vaddr address, int rw,
                             int mmu_idx);
 
-static inline int cpu_interrupts_enabled(CPUMBState *env)
-{
-    return env->sregs[SR_MSR] & MSR_IE;
-}
-
 #include "exec/cpu-all.h"
 
 static inline void cpu_get_tb_cpu_state(CPUMBState *env, target_ulong *pc,
-- 
2.1.4

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

* [Qemu-devel] [PULL 31/42] cpus: use first_cpu macro instead of QTAILQ_FIRST(&cpus)
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (29 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 30/42] microblaze: cpu: delete unused cpu_interrupts_enabled Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 32/42] input: remove unused mouse_handlers list Michael Tokarev
                   ` (11 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Emilio G. Cota, Michael Tokarev

From: "Emilio G. Cota" <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 cpus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cpus.c b/cpus.c
index e6dcae3..62d157a 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1016,7 +1016,7 @@ static void *qemu_tcg_cpu_thread_fn(void *arg)
     qemu_cond_signal(&qemu_cpu_cond);
 
     /* wait for initial kick-off after machine start */
-    while (QTAILQ_FIRST(&cpus)->stopped) {
+    while (first_cpu->stopped) {
         qemu_cond_wait(tcg_halt_cond, &qemu_global_mutex);
 
         /* process any pending work */
-- 
2.1.4

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

* [Qemu-devel] [PULL 32/42] input: remove unused mouse_handlers list
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (30 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 31/42] cpus: use first_cpu macro instead of QTAILQ_FIRST(&cpus) Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 33/42] qemu-char: remove unused list node from FDCharDriver Michael Tokarev
                   ` (10 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Emilio G. Cota, Michael Tokarev

From: "Emilio G. Cota" <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 ui/input-legacy.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/ui/input-legacy.c b/ui/input-legacy.c
index 2d4ca19..3e9bb38 100644
--- a/ui/input-legacy.c
+++ b/ui/input-legacy.c
@@ -57,8 +57,6 @@ struct QEMUPutLEDEntry {
 
 static QTAILQ_HEAD(, QEMUPutLEDEntry) led_handlers =
     QTAILQ_HEAD_INITIALIZER(led_handlers);
-static QTAILQ_HEAD(, QEMUPutMouseEntry) mouse_handlers =
-    QTAILQ_HEAD_INITIALIZER(mouse_handlers);
 
 int index_from_key(const char *key)
 {
-- 
2.1.4

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

* [Qemu-devel] [PULL 33/42] qemu-char: remove unused list node from FDCharDriver
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (31 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 32/42] input: remove unused mouse_handlers list Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 34/42] coroutine: remove unnecessary parentheses in qemu_co_queue_empty Michael Tokarev
                   ` (9 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Emilio G. Cota, Michael Tokarev

From: "Emilio G. Cota" <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 qemu-char.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/qemu-char.c b/qemu-char.c
index a405d76..d0c1564 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -973,7 +973,6 @@ typedef struct FDCharDriver {
     CharDriverState *chr;
     GIOChannel *fd_in, *fd_out;
     int max_size;
-    QTAILQ_ENTRY(FDCharDriver) node;
 } FDCharDriver;
 
 /* Called with chr_write_lock held.  */
-- 
2.1.4

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

* [Qemu-devel] [PULL 34/42] coroutine: remove unnecessary parentheses in qemu_co_queue_empty
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (32 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 33/42] qemu-char: remove unused list node from FDCharDriver Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 35/42] linux-user/elfload: use QTAILQ_FOREACH instead of open-coding it Michael Tokarev
                   ` (8 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Emilio G. Cota, Michael Tokarev

From: "Emilio G. Cota" <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 qemu-coroutine-lock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qemu-coroutine-lock.c b/qemu-coroutine-lock.c
index e4860ae..6b49033 100644
--- a/qemu-coroutine-lock.c
+++ b/qemu-coroutine-lock.c
@@ -108,7 +108,7 @@ bool qemu_co_enter_next(CoQueue *queue)
 
 bool qemu_co_queue_empty(CoQueue *queue)
 {
-    return (QTAILQ_FIRST(&queue->entries) == NULL);
+    return QTAILQ_FIRST(&queue->entries) == NULL;
 }
 
 void qemu_co_mutex_init(CoMutex *mutex)
-- 
2.1.4

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

* [Qemu-devel] [PULL 35/42] linux-user/elfload: use QTAILQ_FOREACH instead of open-coding it
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (33 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 34/42] coroutine: remove unnecessary parentheses in qemu_co_queue_empty Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 36/42] i440fx-test: remove ARRAY_SIZE redefinition Michael Tokarev
                   ` (7 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Emilio G. Cota, Michael Tokarev

From: "Emilio G. Cota" <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 linux-user/elfload.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 399c021..0ba9706 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -2887,8 +2887,7 @@ static int write_note_info(struct elf_note_info *info, int fd)
             return (error);
 
     /* write prstatus for each thread */
-    for (ets = info->thread_list.tqh_first; ets != NULL;
-         ets = ets->ets_link.tqe_next) {
+    QTAILQ_FOREACH(ets, &info->thread_list, ets_link) {
         if ((error = write_note(&ets->notes[0], fd)) != 0)
             return (error);
     }
-- 
2.1.4

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

* [Qemu-devel] [PULL 36/42] i440fx-test: remove ARRAY_SIZE redefinition
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (34 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 35/42] linux-user/elfload: use QTAILQ_FOREACH instead of open-coding it Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 37/42] qmp-commands: Fix typo Michael Tokarev
                   ` (6 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Emilio G. Cota, Michael Tokarev

From: "Emilio G. Cota" <cota@braap.org>

It's defined in osdep.h and shouldn't be redefined here.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 tests/i440fx-test.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/tests/i440fx-test.c b/tests/i440fx-test.c
index d0bc8de..33a7ecb 100644
--- a/tests/i440fx-test.c
+++ b/tests/i440fx-test.c
@@ -27,8 +27,6 @@
 
 #define BROKEN 1
 
-#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
-
 typedef struct TestData
 {
     int num_cpus;
-- 
2.1.4

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

* [Qemu-devel] [PULL 37/42] qmp-commands: Fix typo
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (35 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 36/42] i440fx-test: remove ARRAY_SIZE redefinition Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 38/42] target-mips: fix memory leak Michael Tokarev
                   ` (5 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, John Snow

From: John Snow <jsnow@redhat.com>

Just a trivial patch to correct a QMP example in qmp-commands.hx.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 qmp-commands.hx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/qmp-commands.hx b/qmp-commands.hx
index 213508f..d4a837c 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -2380,7 +2380,7 @@ Example:
                   "virtual-size":2048000,
                   "backing_file":"base.qcow2",
                   "full-backing-filename":"disks/base.qcow2",
-                  "backing-filename-format:"qcow2",
+                  "backing-filename-format":"qcow2",
                   "snapshots":[
                      {
                         "id": "1",
@@ -3847,7 +3847,7 @@ Example:
                       "virtual-size":2048000,
                       "backing_file":"base.qcow2",
                       "full-backing-filename":"disks/base.qcow2",
-                      "backing-filename-format:"qcow2",
+                      "backing-filename-format":"qcow2",
                       "snapshots":[
                          {
                             "id": "1",
-- 
2.1.4

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

* [Qemu-devel] [PULL 38/42] target-mips: fix memory leak
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (36 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 37/42] qmp-commands: Fix typo Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 39/42] vhost-user: remove superfluous '\n' around error_report() Michael Tokarev
                   ` (4 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Michael Tokarev, Gonglei, Leon Alrae, Aurelien Jarno

From: Gonglei <arei.gonglei@huawei.com>

Coveristy reports that variable prom_buf/params_buf going
out of scope leaks the storage it points to.

Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Leon Alrae <leon.alrae@imgtec.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Leon Alrae <leon.alrae@imgtec.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/mips/mips_fulong2e.c | 1 +
 hw/mips/mips_malta.c    | 1 +
 hw/mips/mips_r4k.c      | 1 +
 3 files changed, 3 insertions(+)

diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
index 4aae64a..dea941a 100644
--- a/hw/mips/mips_fulong2e.c
+++ b/hw/mips/mips_fulong2e.c
@@ -168,6 +168,7 @@ static int64_t load_kernel (CPUMIPSState *env)
     rom_add_blob_fixed("prom", prom_buf, prom_size,
                        cpu_mips_kseg0_to_phys(NULL, ENVP_ADDR));
 
+    g_free(prom_buf);
     return kernel_entry;
 }
 
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index b0fa71a..482250d 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -861,6 +861,7 @@ static int64_t load_kernel (void)
     rom_add_blob_fixed("prom", prom_buf, prom_size,
                        cpu_mips_kseg0_to_phys(NULL, ENVP_ADDR));
 
+    g_free(prom_buf);
     return kernel_entry;
 }
 
diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c
index 66e2a58..f4dcacd 100644
--- a/hw/mips/mips_r4k.c
+++ b/hw/mips/mips_r4k.c
@@ -139,6 +139,7 @@ static int64_t load_kernel(void)
     rom_add_blob_fixed("params", params_buf, params_size,
                        (16 << 20) - 264);
 
+    g_free(params_buf);
     return entry;
 }
 
-- 
2.1.4

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

* [Qemu-devel] [PULL 39/42] vhost-user: remove superfluous '\n' around error_report()
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (37 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 38/42] target-mips: fix memory leak Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 40/42] kvm: Silence warning from valgrind Michael Tokarev
                   ` (3 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Gonglei, Michael Tokarev

From: Gonglei <arei.gonglei@huawei.com>

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/virtio/vhost-user.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index aefe0bb..e7ab829 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -128,7 +128,7 @@ static int vhost_user_read(struct vhost_dev *dev, VhostUserMsg *msg)
 
     r = qemu_chr_fe_read_all(chr, p, size);
     if (r != size) {
-        error_report("Failed to read msg header. Read %d instead of %d.\n", r,
+        error_report("Failed to read msg header. Read %d instead of %d.", r,
                 size);
         goto fail;
     }
@@ -136,7 +136,7 @@ static int vhost_user_read(struct vhost_dev *dev, VhostUserMsg *msg)
     /* validate received flags */
     if (msg->flags != (VHOST_USER_REPLY_MASK | VHOST_USER_VERSION)) {
         error_report("Failed to read msg header."
-                " Flags 0x%x instead of 0x%x.\n", msg->flags,
+                " Flags 0x%x instead of 0x%x.", msg->flags,
                 VHOST_USER_REPLY_MASK | VHOST_USER_VERSION);
         goto fail;
     }
@@ -144,7 +144,7 @@ static int vhost_user_read(struct vhost_dev *dev, VhostUserMsg *msg)
     /* validate message size is sane */
     if (msg->size > VHOST_USER_PAYLOAD_SIZE) {
         error_report("Failed to read msg header."
-                " Size %d exceeds the maximum %zu.\n", msg->size,
+                " Size %d exceeds the maximum %zu.", msg->size,
                 VHOST_USER_PAYLOAD_SIZE);
         goto fail;
     }
@@ -155,7 +155,7 @@ static int vhost_user_read(struct vhost_dev *dev, VhostUserMsg *msg)
         r = qemu_chr_fe_read_all(chr, p, size);
         if (r != size) {
             error_report("Failed to read msg payload."
-                         " Read %d instead of %d.\n", r, msg->size);
+                         " Read %d instead of %d.", r, msg->size);
             goto fail;
         }
     }
@@ -235,8 +235,8 @@ static int vhost_user_call(struct vhost_dev *dev, unsigned long int request,
         msg.memory.nregions = fd_num;
 
         if (!fd_num) {
-            error_report("Failed initializing vhost-user memory map\n"
-                    "consider using -object memory-backend-file share=on\n");
+            error_report("Failed initializing vhost-user memory map, "
+                    "consider using -object memory-backend-file share=on");
             return -1;
         }
 
@@ -280,7 +280,7 @@ static int vhost_user_call(struct vhost_dev *dev, unsigned long int request,
         }
         break;
     default:
-        error_report("vhost-user trying to send unhandled ioctl\n");
+        error_report("vhost-user trying to send unhandled ioctl");
         return -1;
         break;
     }
@@ -296,27 +296,27 @@ static int vhost_user_call(struct vhost_dev *dev, unsigned long int request,
 
         if (msg_request != msg.request) {
             error_report("Received unexpected msg type."
-                    " Expected %d received %d\n", msg_request, msg.request);
+                    " Expected %d received %d", msg_request, msg.request);
             return -1;
         }
 
         switch (msg_request) {
         case VHOST_USER_GET_FEATURES:
             if (msg.size != sizeof(m.u64)) {
-                error_report("Received bad msg size.\n");
+                error_report("Received bad msg size.");
                 return -1;
             }
             *((__u64 *) arg) = msg.u64;
             break;
         case VHOST_USER_GET_VRING_BASE:
             if (msg.size != sizeof(m.state)) {
-                error_report("Received bad msg size.\n");
+                error_report("Received bad msg size.");
                 return -1;
             }
             memcpy(arg, &msg.state, sizeof(struct vhost_vring_state));
             break;
         default:
-            error_report("Received unexpected msg type.\n");
+            error_report("Received unexpected msg type.");
             return -1;
             break;
         }
-- 
2.1.4

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

* [Qemu-devel] [PULL 40/42] kvm: Silence warning from valgrind
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (38 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 39/42] vhost-user: remove superfluous '\n' around error_report() Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 41/42] tcg: Delete unused cpu_pc_from_tb() Michael Tokarev
                   ` (2 subsequent siblings)
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Thomas Huth, Michael Tokarev

From: Thomas Huth <thuth@redhat.com>

valgrind complains here about uninitialized bytes with the following message:

==17814== Syscall param ioctl(generic) points to uninitialised byte(s)
==17814==    at 0x466A780: ioctl (in /usr/lib64/power8/libc-2.17.so)
==17814==    by 0x100735B7: kvm_vm_ioctl (kvm-all.c:1920)
==17814==    by 0x10074583: kvm_set_ioeventfd_mmio (kvm-all.c:574)

Let's fix it by using a proper struct initializer in kvm_set_ioeventfd_mmio().

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 kvm-all.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/kvm-all.c b/kvm-all.c
index 2a717e5..37cc2cf 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -552,13 +552,13 @@ static int kvm_set_ioeventfd_mmio(int fd, hwaddr addr, uint32_t val,
                                   bool assign, uint32_t size, bool datamatch)
 {
     int ret;
-    struct kvm_ioeventfd iofd;
-
-    iofd.datamatch = datamatch ? adjust_ioeventfd_endianness(val, size) : 0;
-    iofd.addr = addr;
-    iofd.len = size;
-    iofd.flags = 0;
-    iofd.fd = fd;
+    struct kvm_ioeventfd iofd = {
+        .datamatch = datamatch ? adjust_ioeventfd_endianness(val, size) : 0,
+        .addr = addr,
+        .len = size,
+        .flags = 0,
+        .fd = fd,
+    };
 
     if (!kvm_enabled()) {
         return -ENOSYS;
-- 
2.1.4

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

* [Qemu-devel] [PULL 41/42] tcg: Delete unused cpu_pc_from_tb()
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (39 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 40/42] kvm: Silence warning from valgrind Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30  5:08 ` [Qemu-devel] [PULL 42/42] microblaze: fix memory leak Michael Tokarev
  2015-04-30 12:58 ` [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Peter Maydell
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Peter Crosthwaite, Michael Tokarev, Peter Crosthwaite

From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

No code uses the cpu_pc_from_tb() function. Delete from tricore and
arm which each provide an unused implementation. Update the comment
in tcg.h to reflect that this is obsoleted by synchronize_from_tb.

Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 target-arm/cpu.h     | 9 ---------
 target-tricore/cpu.h | 5 -----
 tcg/tcg.h            | 6 ++++--
 3 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index 8df0b6a..d4a5899 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -1874,15 +1874,6 @@ static inline void cpu_get_tb_cpu_state(CPUARMState *env, target_ulong *pc,
 
 #include "exec/exec-all.h"
 
-static inline void cpu_pc_from_tb(CPUARMState *env, TranslationBlock *tb)
-{
-    if (ARM_TBFLAG_AARCH64_STATE(tb->flags)) {
-        env->pc = tb->pc;
-    } else {
-        env->regs[15] = tb->pc;
-    }
-}
-
 enum {
     QEMU_PSCI_CONDUIT_DISABLED = 0,
     QEMU_PSCI_CONDUIT_SMC = 1,
diff --git a/target-tricore/cpu.h b/target-tricore/cpu.h
index 90bf006..c14b5f9 100644
--- a/target-tricore/cpu.h
+++ b/target-tricore/cpu.h
@@ -395,9 +395,4 @@ int cpu_tricore_handle_mmu_fault(CPUState *cpu, target_ulong address,
 
 #include "exec/exec-all.h"
 
-static inline void cpu_pc_from_tb(CPUTriCoreState *env, TranslationBlock *tb)
-{
-    env->PC = tb->pc;
-}
-
 #endif /*__TRICORE_CPU_H__ */
diff --git a/tcg/tcg.h b/tcg/tcg.h
index add7f75..3d004ba 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -859,8 +859,10 @@ static inline size_t tcg_current_code_size(TCGContext *s)
  * state is correctly synchronised and ready for execution of the next
  * TB (and in particular the guest PC is the address to execute next).
  * Otherwise, we gave up on execution of this TB before it started, and
- * the caller must fix up the CPU state by calling cpu_pc_from_tb()
- * with the next-TB pointer we return.
+ * the caller must fix up the CPU state by calling the CPU's
+ * synchronize_from_tb() method with the next-TB pointer we return (falling
+ * back to calling the CPU's set_pc method with tb->pb if no
+ * synchronize_from_tb() method exists).
  *
  * Note that TCG targets may use a different definition of tcg_qemu_tb_exec
  * to this default (which just calls the prologue.code emitted by
-- 
2.1.4

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

* [Qemu-devel] [PULL 42/42] microblaze: fix memory leak
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (40 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 41/42] tcg: Delete unused cpu_pc_from_tb() Michael Tokarev
@ 2015-04-30  5:08 ` Michael Tokarev
  2015-04-30 12:58 ` [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Peter Maydell
  42 siblings, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30  5:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Gonglei, Michael Tokarev

From: Gonglei <arei.gonglei@huawei.com>

When not assign a -dtb argument, the variable dtb_filename
storage returned from qemu_find_file(), which should be freed
after use. Alternatively we define a local variable filename,
with 'char *' type, free after use.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/microblaze/boot.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c
index 38c59db..4c44317 100644
--- a/hw/microblaze/boot.c
+++ b/hw/microblaze/boot.c
@@ -113,15 +113,15 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr ddr_base,
     const char *kernel_filename;
     const char *kernel_cmdline;
     const char *dtb_arg;
+    char *filename = NULL;
 
     machine_opts = qemu_get_machine_opts();
     kernel_filename = qemu_opt_get(machine_opts, "kernel");
     kernel_cmdline = qemu_opt_get(machine_opts, "append");
     dtb_arg = qemu_opt_get(machine_opts, "dtb");
-    if (dtb_arg) { /* Preference a -dtb argument */
-        dtb_filename = dtb_arg;
-    } else { /* default to pcbios dtb as passed by machine_init */
-        dtb_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, dtb_filename);
+    /* default to pcbios dtb as passed by machine_init */
+    if (!dtb_arg) {
+        filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, dtb_filename);
     }
 
     boot_info.machine_cpu_reset = machine_cpu_reset;
@@ -203,7 +203,8 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr ddr_base,
                             boot_info.initrd_start,
                             boot_info.initrd_end,
                             kernel_cmdline,
-                            dtb_filename);
+                            /* Preference a -dtb argument */
+                            dtb_arg ? dtb_arg : filename);
     }
-
+    g_free(filename);
 }
-- 
2.1.4

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

* Re: [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30
  2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
                   ` (41 preceding siblings ...)
  2015-04-30  5:08 ` [Qemu-devel] [PULL 42/42] microblaze: fix memory leak Michael Tokarev
@ 2015-04-30 12:58 ` Peter Maydell
  2015-04-30 13:05   ` Michael Tokarev
  2015-04-30 19:16   ` [Qemu-devel] [PATCH] i440fx-test: guard ARRAY_SIZE definition with #ifndef Emilio G. Cota
  42 siblings, 2 replies; 51+ messages in thread
From: Peter Maydell @ 2015-04-30 12:58 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: QEMU Trivial, QEMU Developers

On 30 April 2015 at 06:08, Michael Tokarev <mjt@tls.msk.ru> wrote:
> Hello.
>
> This is the first pull request for trivial-patches tree since 2.3 has
> been released.  During the freeze many patches has been accumulated,
> and even more has been received after 2.4 developmnent has been opened.
>
> So here we have 42 trivial patches, which is kinda too much, but that's
> what we have :)
>
> Please consider applying.
>
> Thanks,
>
> /mjt
>
> The following changes since commit a9392bc93c8615ad1983047e9f91ee3fa8aae75f:
>
>   Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (2015-04-28 16:55:03 +0100)
>
> are available in the git repository at:
>
>   git://git.corpit.ru/qemu.git tags/pull-trivial-patches-2015-04-30
>
> for you to fetch changes up to fe31d3e6e6945b509e5b4ab03d38aae1266fe64e:
>
>   microblaze: fix memory leak (2015-04-30 08:06:20 +0300)
>
> ----------------------------------------------------------------
> trivial patches for 2015-04-30

Hi. I'm afraid this fails to build the tests on OSX:
  CC    tests/i440fx-test.o
/Users/pm215/src/qemu/tests/i440fx-test.c:229:21: warning: implicit declaration
      of function 'ARRAY_SIZE' is invalid in C99
      [-Wimplicit-function-declaration]
    for (i = 0; i < ARRAY_SIZE(pam_area); i++) {
                    ^
1 warning generated.
  LINK  tests/i440fx-test
Undefined symbols for architecture x86_64:
  "_ARRAY_SIZE", referenced from:
      _test_i440fx_pam in i440fx-test.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [tests/i440fx-test] Error 1

'i440fx-test: remove ARRAY_SIZE redefinition' has removed
this macro, but this test file doesn't include osdep.h so
it presumably works on Linux only because we're picking
something up from a system header file somewhere...

-- PMM

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

* Re: [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30
  2015-04-30 12:58 ` [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Peter Maydell
@ 2015-04-30 13:05   ` Michael Tokarev
  2015-04-30 19:16   ` [Qemu-devel] [PATCH] i440fx-test: guard ARRAY_SIZE definition with #ifndef Emilio G. Cota
  1 sibling, 0 replies; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30 13:05 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Trivial, QEMU Developers

30.04.2015 15:58, Peter Maydell wrote:
[]
> Hi. I'm afraid this fails to build the tests on OSX:
>   CC    tests/i440fx-test.o
> /Users/pm215/src/qemu/tests/i440fx-test.c:229:21: warning: implicit declaration
>       of function 'ARRAY_SIZE' is invalid in C99

So much for trivial ;)

Let's remove this one and add another tiny dead code removal patch
instead, which went in meanwhile, to complete half-removal of unused
functions.  I'll resend another pull request in a moment.

Thanks,  and sorry for the noize.  I wanted to verify if this array_size
definition is really unnecessary here but something distracted me.

/mjt

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

* [Qemu-devel] [PATCH] i440fx-test: guard ARRAY_SIZE definition with #ifndef
  2015-04-30 12:58 ` [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Peter Maydell
  2015-04-30 13:05   ` Michael Tokarev
@ 2015-04-30 19:16   ` Emilio G. Cota
  2015-04-30 19:28     ` Stefan Weil
  2015-04-30 20:14     ` Michael Tokarev
  1 sibling, 2 replies; 51+ messages in thread
From: Emilio G. Cota @ 2015-04-30 19:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Peter Maydell, Peter Crosthwaite, Michael Tokarev,
	Paolo Bonzini

ARRAY_SIZE is defined in osdep.h so having an unconditional
definition here is fragile.

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 tests/i440fx-test.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/i440fx-test.c b/tests/i440fx-test.c
index d0bc8de..d610e66 100644
--- a/tests/i440fx-test.c
+++ b/tests/i440fx-test.c
@@ -27,7 +27,9 @@
 
 #define BROKEN 1
 
+#ifndef ARRAY_SIZE
 #define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
+#endif
 
 typedef struct TestData
 {
-- 
1.9.1

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

* Re: [Qemu-devel] [PATCH] i440fx-test: guard ARRAY_SIZE definition with #ifndef
  2015-04-30 19:16   ` [Qemu-devel] [PATCH] i440fx-test: guard ARRAY_SIZE definition with #ifndef Emilio G. Cota
@ 2015-04-30 19:28     ` Stefan Weil
  2015-04-30 20:02       ` Peter Maydell
  2015-04-30 20:14     ` Michael Tokarev
  1 sibling, 1 reply; 51+ messages in thread
From: Stefan Weil @ 2015-04-30 19:28 UTC (permalink / raw)
  To: Emilio G. Cota, qemu-devel
  Cc: qemu-trivial, Peter Maydell, Peter Crosthwaite, Michael Tokarev,
	Paolo Bonzini

Am 30.04.2015 um 21:16 schrieb Emilio G. Cota:
> ARRAY_SIZE is defined in osdep.h so having an unconditional
> definition here is fragile.
>
> Signed-off-by: Emilio G. Cota <cota@braap.org>
> ---
>   tests/i440fx-test.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/tests/i440fx-test.c b/tests/i440fx-test.c
> index d0bc8de..d610e66 100644
> --- a/tests/i440fx-test.c
> +++ b/tests/i440fx-test.c
> @@ -27,7 +27,9 @@
>   
>   #define BROKEN 1
>   
> +#ifndef ARRAY_SIZE
>   #define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
> +#endif
>   
>   typedef struct TestData
>   {

Why not include osdep.h via qemu-common.h and remove all other include 
statements which then are no longer needed? I'd prefer that variant.

Cheers
Stefan

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

* Re: [Qemu-devel] [PATCH] i440fx-test: guard ARRAY_SIZE definition with #ifndef
  2015-04-30 19:28     ` Stefan Weil
@ 2015-04-30 20:02       ` Peter Maydell
  0 siblings, 0 replies; 51+ messages in thread
From: Peter Maydell @ 2015-04-30 20:02 UTC (permalink / raw)
  To: Stefan Weil
  Cc: Peter Crosthwaite, QEMU Trivial, Michael Tokarev,
	QEMU Developers, Emilio G. Cota, Paolo Bonzini

On 30 April 2015 at 20:28, Stefan Weil <sw@weilnetz.de> wrote:
> Am 30.04.2015 um 21:16 schrieb Emilio G. Cota:
>>
>> ARRAY_SIZE is defined in osdep.h so having an unconditional
>> definition here is fragile.

FWIW, the original patch of this failed to build on x86 too,
so I don't think we currently include osdep.h from this file in
any circumstances... Where do you get the ARRAY_SIZE definition
from that presumably lets you build without this one?

> Why not include osdep.h via qemu-common.h and remove all other include
> statements which then are no longer needed? I'd prefer that variant.

Can we include qemu-common.h in these libqos standalone test
executables? I forget... The rtl8139 test seems to though, so
I guess it's OK.

-- PMM

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

* Re: [Qemu-devel] [PATCH] i440fx-test: guard ARRAY_SIZE definition with #ifndef
  2015-04-30 19:16   ` [Qemu-devel] [PATCH] i440fx-test: guard ARRAY_SIZE definition with #ifndef Emilio G. Cota
  2015-04-30 19:28     ` Stefan Weil
@ 2015-04-30 20:14     ` Michael Tokarev
  2015-04-30 22:21       ` [Qemu-devel] [PATCH] tests: consolidate common includes under libqtest.h Emilio G. Cota
  1 sibling, 1 reply; 51+ messages in thread
From: Michael Tokarev @ 2015-04-30 20:14 UTC (permalink / raw)
  To: Emilio G. Cota, qemu-devel
  Cc: qemu-trivial, Peter Maydell, Peter Crosthwaite, Paolo Bonzini

30.04.2015 22:16, Emilio G. Cota wrote:
> ARRAY_SIZE is defined in osdep.h so having an unconditional
> definition here is fragile.

Fragile in what sense?  Nothing in that file includes osdep.h.
At the maximum, compiler will issue a warning about redefinition
(it should really be redefinition, not the same definition),
which might be treated as error, and we'll just fix that
warning.. I'd say just be done with this, it doesn't deserve
that much attention ;)

Somehow initially I thought this patch actually FIXES a warning
of this sort.  But it looks lile it is only fixes a potential
warning. Oh well...  :)

Thanks,

/mjt

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

* [Qemu-devel] [PATCH] tests: consolidate common includes under libqtest.h
  2015-04-30 20:14     ` Michael Tokarev
@ 2015-04-30 22:21       ` Emilio G. Cota
  2015-05-05 10:28         ` Paolo Bonzini
  0 siblings, 1 reply; 51+ messages in thread
From: Emilio G. Cota @ 2015-04-30 22:21 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Peter Crosthwaite, QEMU Trivial, Stefan Weil, Michael Tokarev,
	QEMU Developers, Paolo Bonzini

On Thu, Apr 30, 2015 at 23:14:06 +0300, Michael Tokarev wrote:
> 30.04.2015 22:16, Emilio G. Cota wrote:
> > ARRAY_SIZE is defined in osdep.h so having an unconditional
> > definition here is fragile.
>
> Fragile in what sense?  Nothing in that file includes osdep.h.

Fragile in that future, unrelated header changes will make this
redefinition show up.

> Somehow initially I thought this patch actually FIXES a warning
> of this sort.  But it looks lile it is only fixes a potential
> warning. Oh well...  :)

I was hit by this warning-turned-error, although wasn't using 100%
upstream code, see below.

On Thu, Apr 30, 2015 at 21:02:44 +0100, Peter Maydell wrote:
> On 30 April 2015 at 20:28, Stefan Weil <sw@weilnetz.de> wrote:
> > Am 30.04.2015 um 21:16 schrieb Emilio G. Cota:
> >>
> >> ARRAY_SIZE is defined in osdep.h so having an unconditional
> >> definition here is fragile.
> 
> FWIW, the original patch of this failed to build on x86 too,
> so I don't think we currently include osdep.h from this file in
> any circumstances... Where do you get the ARRAY_SIZE definition
> from that presumably lets you build without this one?

I probably got ARRAY_SIZE from CCAN's headers, was tinkering
with it.
(CCAN http://ccodearchive.net/ is a library of useful modules, and
array_size is one of them.)

> Can we include qemu-common.h in these libqos standalone test
> executables? I forget... The rtl8139 test seems to though, so
> I guess it's OK.

On Thu, Apr 30, 2015 at 21:28:19 +0200, Stefan Weil wrote:
> Why not include osdep.h via qemu-common.h and remove all other
> include statements which then are no longer needed? I'd prefer that
> variant.

Something like the appended?

Cheers,

		Emilio

commit eb415d0695bb49d9df78aedaf4ed3c7083a1a574
Author: Emilio G. Cota <cota@braap.org>
Date:   Thu Apr 30 18:00:01 2015 -0400

    tests: consolidate common includes under libqtest.h
    
    Source files in tests/ include very common headers,
    such as glib.h or qemu/osdep.h.
    
    Consolidate these includes by including qemu-common.h from
    libqtest.h, which is a common include in tests/.
    
    Two things worth mentioning:
    
    - i440fx-test drops its ARRAY_SIZE definition, which comes now
      from osdep.h via qemu-common.h.
    
    - vhost-user-test.c does keep its include of glib.h, since
      it has to do some contortions to support old glib versions.
      See commit "bd95939f qtest: fix qtest for vhost-user".
    
    Signed-off-by: Emilio G. Cota <cota@braap.org>

diff --git a/tests/ac97-test.c b/tests/ac97-test.c
index af30ea1..4cc1a42 100644
--- a/tests/ac97-test.c
+++ b/tests/ac97-test.c
@@ -7,10 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
 #include "libqtest.h"
-#include "qemu/osdep.h"
 
 /* Tests only initialization so far. TODO: Replace with functional tests */
 static void nop(void)
diff --git a/tests/ahci-test.c b/tests/ahci-test.c
index 7c23bb2..2ac5fc2 100644
--- a/tests/ahci-test.c
+++ b/tests/ahci-test.c
@@ -22,18 +22,13 @@
  * THE SOFTWARE.
  */
 
-#include <stdint.h>
-#include <string.h>
-#include <stdio.h>
 #include <getopt.h>
-#include <glib.h>
 
 #include "libqtest.h"
 #include "libqos/libqos-pc.h"
 #include "libqos/ahci.h"
 #include "libqos/pci-pc.h"
 
-#include "qemu-common.h"
 #include "qemu/host-utils.h"
 
 #include "hw/pci/pci_ids.h"
diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
index 735ac61..e623a79 100644
--- a/tests/bios-tables-test.c
+++ b/tests/bios-tables-test.c
@@ -10,13 +10,8 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <string.h>
-#include <stdio.h>
-#include <glib.h>
 #include <glib/gstdio.h>
-#include "qemu-common.h"
 #include "libqtest.h"
-#include "qemu/compiler.h"
 #include "hw/i386/acpi-defs.h"
 #include "hw/i386/smbios.h"
 #include "qemu/bitmap.h"
diff --git a/tests/boot-order-test.c b/tests/boot-order-test.c
index 360a691..3637fa5 100644
--- a/tests/boot-order-test.c
+++ b/tests/boot-order-test.c
@@ -10,8 +10,6 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <string.h>
-#include <glib.h>
 #include "libqos/fw_cfg.h"
 #include "libqtest.h"
 
diff --git a/tests/display-vga-test.c b/tests/display-vga-test.c
index 17f5910..5b163e4 100644
--- a/tests/display-vga-test.c
+++ b/tests/display-vga-test.c
@@ -7,10 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
 #include "libqtest.h"
-#include "qemu/osdep.h"
 
 static void pci_cirrus(void)
 {
diff --git a/tests/drive_del-test.c b/tests/drive_del-test.c
index 8951f6f..b10ec42 100644
--- a/tests/drive_del-test.c
+++ b/tests/drive_del-test.c
@@ -10,8 +10,6 @@
  * See the COPYING.LIB file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
 #include "libqtest.h"
 
 static void drive_add(void)
diff --git a/tests/e1000-test.c b/tests/e1000-test.c
index 81f164d..814c278 100644
--- a/tests/e1000-test.c
+++ b/tests/e1000-test.c
@@ -7,10 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
 #include "libqtest.h"
-#include "qemu/osdep.h"
 
 /* Tests only initialization so far. TODO: Replace with functional tests */
 static void test_device(gconstpointer data)
diff --git a/tests/eepro100-test.c b/tests/eepro100-test.c
index bf82526..086dc67 100644
--- a/tests/eepro100-test.c
+++ b/tests/eepro100-test.c
@@ -7,10 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
 #include "libqtest.h"
-#include "qemu/osdep.h"
 
 static void test_device(gconstpointer data)
 {
diff --git a/tests/endianness-test.c b/tests/endianness-test.c
index 92e17d2..c1159ab 100644
--- a/tests/endianness-test.c
+++ b/tests/endianness-test.c
@@ -11,14 +11,7 @@
  *
  */
 
-#include <glib.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-
 #include "libqtest.h"
-#include "qemu/bswap.h"
 
 typedef struct TestCase TestCase;
 struct TestCase {
diff --git a/tests/es1370-test.c b/tests/es1370-test.c
index cc23fb5..597525c 100644
--- a/tests/es1370-test.c
+++ b/tests/es1370-test.c
@@ -7,10 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
 #include "libqtest.h"
-#include "qemu/osdep.h"
 
 /* Tests only initialization so far. TODO: Replace with functional tests */
 static void nop(void)
diff --git a/tests/fdc-test.c b/tests/fdc-test.c
index 3c6c83c..9e6a53b 100644
--- a/tests/fdc-test.c
+++ b/tests/fdc-test.c
@@ -22,14 +22,7 @@
  * THE SOFTWARE.
  */
 
-#include <stdint.h>
-#include <string.h>
-#include <stdio.h>
-
-#include <glib.h>
-
 #include "libqtest.h"
-#include "qemu-common.h"
 
 #define TEST_IMAGE_SIZE 1440 * 1024
 
diff --git a/tests/fw_cfg-test.c b/tests/fw_cfg-test.c
index 9be78e9..4a1899a 100644
--- a/tests/fw_cfg-test.c
+++ b/tests/fw_cfg-test.c
@@ -10,9 +10,6 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <string.h>
-#include <glib.h>
-
 #include "libqtest.h"
 #define NO_QEMU_PROTOS
 #include "hw/nvram/fw_cfg.h"
diff --git a/tests/hd-geo-test.c b/tests/hd-geo-test.c
index 00afc20..16f5c96 100644
--- a/tests/hd-geo-test.c
+++ b/tests/hd-geo-test.c
@@ -15,11 +15,6 @@
  * Improvements welcome.
  */
 
-#include <glib.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include "qemu-common.h"
 #include "libqtest.h"
 
 static char *create_test_img(int secs)
diff --git a/tests/i440fx-test.c b/tests/i440fx-test.c
index d0bc8de..fe8fa4d 100644
--- a/tests/i440fx-test.c
+++ b/tests/i440fx-test.c
@@ -12,13 +12,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <errno.h>
 #include <sys/mman.h>
-#include <stdlib.h>
 
 #include "libqtest.h"
 #include "libqos/pci.h"
@@ -27,8 +21,6 @@
 
 #define BROKEN 1
 
-#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
-
 typedef struct TestData
 {
     int num_cpus;
diff --git a/tests/i82801b11-test.c b/tests/i82801b11-test.c
index 78d9ce0..359bb97 100644
--- a/tests/i82801b11-test.c
+++ b/tests/i82801b11-test.c
@@ -7,10 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
 #include "libqtest.h"
-#include "qemu/osdep.h"
 
 /* Tests only initialization so far. TODO: Replace with functional tests */
 static void nop(void)
diff --git a/tests/ide-test.c b/tests/ide-test.c
index 78382e9..c3549f9 100644
--- a/tests/ide-test.c
+++ b/tests/ide-test.c
@@ -22,18 +22,11 @@
  * THE SOFTWARE.
  */
 
-#include <stdint.h>
-#include <string.h>
-#include <stdio.h>
-
-#include <glib.h>
-
 #include "libqtest.h"
 #include "libqos/libqos.h"
 #include "libqos/pci-pc.h"
 #include "libqos/malloc-pc.h"
 
-#include "qemu-common.h"
 #include "hw/pci/pci_ids.h"
 #include "hw/pci/pci_regs.h"
 
diff --git a/tests/intel-hda-test.c b/tests/intel-hda-test.c
index d89b407..53acd86 100644
--- a/tests/intel-hda-test.c
+++ b/tests/intel-hda-test.c
@@ -7,10 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
 #include "libqtest.h"
-#include "qemu/osdep.h"
 
 #define HDA_ID "hda0"
 #define CODEC_DEVICES " -device hda-output,bus=" HDA_ID ".0" \
diff --git a/tests/ioh3420-test.c b/tests/ioh3420-test.c
index c991a5f..f7a9a7e 100644
--- a/tests/ioh3420-test.c
+++ b/tests/ioh3420-test.c
@@ -7,10 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
 #include "libqtest.h"
-#include "qemu/osdep.h"
 
 /* Tests only initialization so far. TODO: Replace with functional tests */
 static void nop(void)
diff --git a/tests/ipoctal232-test.c b/tests/ipoctal232-test.c
index 3ac1714..9263a8a 100644
--- a/tests/ipoctal232-test.c
+++ b/tests/ipoctal232-test.c
@@ -7,10 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
 #include "libqtest.h"
-#include "qemu/osdep.h"
 
 /* Tests only initialization so far. TODO: Replace with functional tests */
 static void nop(void)
diff --git a/tests/libqos/ahci.c b/tests/libqos/ahci.c
index 843cf72..011fe56 100644
--- a/tests/libqos/ahci.c
+++ b/tests/libqos/ahci.c
@@ -22,13 +22,10 @@
  * THE SOFTWARE.
  */
 
-#include <glib.h>
-
 #include "libqtest.h"
 #include "libqos/ahci.h"
 #include "libqos/pci-pc.h"
 
-#include "qemu-common.h"
 #include "qemu/host-utils.h"
 
 #include "hw/pci/pci_ids.h"
diff --git a/tests/libqos/fw_cfg.c b/tests/libqos/fw_cfg.c
index ef00fed..803ac6a 100644
--- a/tests/libqos/fw_cfg.c
+++ b/tests/libqos/fw_cfg.c
@@ -12,10 +12,8 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
 #include "libqos/fw_cfg.h"
 #include "libqtest.h"
-#include "qemu/bswap.h"
 
 void qfw_cfg_select(QFWCFG *fw_cfg, uint16_t key)
 {
diff --git a/tests/libqos/i2c-omap.c b/tests/libqos/i2c-omap.c
index 3d4d45d..4de46e4 100644
--- a/tests/libqos/i2c-omap.c
+++ b/tests/libqos/i2c-omap.c
@@ -8,11 +8,6 @@
  */
 #include "libqos/i2c.h"
 
-#include <glib.h>
-#include <string.h>
-
-#include "qemu/osdep.h"
-#include "qemu/bswap.h"
 #include "libqtest.h"
 
 enum OMAPI2CRegisters {
diff --git a/tests/libqos/libqos.c b/tests/libqos/libqos.c
index 7e72078..4523a2b 100644
--- a/tests/libqos/libqos.c
+++ b/tests/libqos/libqos.c
@@ -1,8 +1,3 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <glib.h>
-#include <unistd.h>
-#include <fcntl.h>
 #include <sys/wait.h>
 
 #include "libqtest.h"
diff --git a/tests/libqos/pci-pc.c b/tests/libqos/pci-pc.c
index 6dba0db..395e5f1 100644
--- a/tests/libqos/pci-pc.c
+++ b/tests/libqos/pci-pc.c
@@ -15,11 +15,8 @@
 
 #include "hw/pci/pci_regs.h"
 
-#include "qemu-common.h"
 #include "qemu/host-utils.h"
 
-#include <glib.h>
-
 #define ACPI_PCIHP_ADDR         0xae00
 #define PCI_EJ_BASE             0x0008
 
diff --git a/tests/libqos/usb.c b/tests/libqos/usb.c
index 41d89b8..4ffae88 100644
--- a/tests/libqos/usb.c
+++ b/tests/libqos/usb.c
@@ -11,10 +11,7 @@
  * This work is licensed under the terms of the GNU GPL, version 2 or later.
  * See the COPYING file in the top-level directory.
  */
-#include <glib.h>
-#include <string.h>
 #include "libqtest.h"
-#include "qemu/osdep.h"
 #include "hw/usb/uhci-regs.h"
 #include "libqos/usb.h"
 
diff --git a/tests/libqos/virtio-mmio.c b/tests/libqos/virtio-mmio.c
index b3e62e7..ac1c9a3 100644
--- a/tests/libqos/virtio-mmio.c
+++ b/tests/libqos/virtio-mmio.c
@@ -7,8 +7,6 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <stdio.h>
 #include "libqtest.h"
 #include "libqos/virtio.h"
 #include "libqos/virtio-mmio.h"
diff --git a/tests/libqos/virtio-pci.c b/tests/libqos/virtio-pci.c
index f9fb924..573b238 100644
--- a/tests/libqos/virtio-pci.c
+++ b/tests/libqos/virtio-pci.c
@@ -7,8 +7,6 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <stdio.h>
 #include "libqtest.h"
 #include "libqos/virtio.h"
 #include "libqos/virtio-pci.h"
diff --git a/tests/libqos/virtio.c b/tests/libqos/virtio.c
index 3205b88..80a1fe6 100644
--- a/tests/libqos/virtio.c
+++ b/tests/libqos/virtio.c
@@ -7,7 +7,6 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
 #include "libqtest.h"
 #include "libqos/virtio.h"
 
diff --git a/tests/libqtest.c b/tests/libqtest.c
index a525dc5..03b6064 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -16,20 +16,11 @@
  */
 #include "libqtest.h"
 
-#include <glib.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/wait.h>
 #include <sys/un.h>
-#include <inttypes.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-
-#include "qemu/compiler.h"
-#include "qemu/osdep.h"
+
 #include "qapi/qmp/json-parser.h"
 #include "qapi/qmp/json-streamer.h"
 #include "qapi/qmp/qjson.h"
diff --git a/tests/libqtest.h b/tests/libqtest.h
index 4b54b5d..c56eb7e 100644
--- a/tests/libqtest.h
+++ b/tests/libqtest.h
@@ -19,11 +19,9 @@
 
 #include <stddef.h>
 #include <stdint.h>
-#include <stdbool.h>
-#include <stdarg.h>
 #include <sys/types.h>
 #include "qapi/qmp/qdict.h"
-#include "glib-compat.h"
+#include "qemu-common.h"
 
 typedef struct QTestState QTestState;
 
diff --git a/tests/m48t59-test.c b/tests/m48t59-test.c
index 71b4f28..8626722 100644
--- a/tests/m48t59-test.c
+++ b/tests/m48t59-test.c
@@ -12,12 +12,6 @@
  *
  */
 
-#include <glib.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-
 #include "libqtest.h"
 
 #define RTC_SECONDS             0x9
diff --git a/tests/ne2000-test.c b/tests/ne2000-test.c
index 61a678a..1469130 100644
--- a/tests/ne2000-test.c
+++ b/tests/ne2000-test.c
@@ -7,10 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
 #include "libqtest.h"
-#include "qemu/osdep.h"
 
 /* Tests only initialization so far. TODO: Replace with functional tests */
 static void pci_nop(void)
diff --git a/tests/nvme-test.c b/tests/nvme-test.c
index ff38b5e..38b25d6 100644
--- a/tests/nvme-test.c
+++ b/tests/nvme-test.c
@@ -7,10 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
 #include "libqtest.h"
-#include "qemu/osdep.h"
 
 /* Tests only initialization so far. TODO: Replace with functional tests */
 static void nop(void)
diff --git a/tests/pc-cpu-test.c b/tests/pc-cpu-test.c
index a0122d3..3cd9018 100644
--- a/tests/pc-cpu-test.c
+++ b/tests/pc-cpu-test.c
@@ -7,12 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
-
-#include "qemu-common.h"
 #include "libqtest.h"
-#include "qemu/osdep.h"
 #include "qapi/qmp/types.h"
 
 struct PCTestData {
diff --git a/tests/pcnet-test.c b/tests/pcnet-test.c
index 84af4f3..d13d872 100644
--- a/tests/pcnet-test.c
+++ b/tests/pcnet-test.c
@@ -7,10 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
 #include "libqtest.h"
-#include "qemu/osdep.h"
 
 /* Tests only initialization so far. TODO: Replace with functional tests */
 static void pci_nop(void)
diff --git a/tests/pvpanic-test.c b/tests/pvpanic-test.c
index a7ad6b3..57bd991 100644
--- a/tests/pvpanic-test.c
+++ b/tests/pvpanic-test.c
@@ -7,10 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
 #include "libqtest.h"
-#include "qemu/osdep.h"
 
 static void test_panic(void)
 {
diff --git a/tests/qom-test.c b/tests/qom-test.c
index 4246382..0f85dbd 100644
--- a/tests/qom-test.c
+++ b/tests/qom-test.c
@@ -7,12 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
-
-#include "qemu-common.h"
 #include "libqtest.h"
-#include "qemu/osdep.h"
 #include "qapi/qmp/types.h"
 
 static const char *blacklist_x86[] = {
diff --git a/tests/rtc-test.c b/tests/rtc-test.c
index 4243624..f6ac508 100644
--- a/tests/rtc-test.c
+++ b/tests/rtc-test.c
@@ -11,12 +11,6 @@
  *
  */
 
-#include <glib.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-
 #include "libqtest.h"
 #include "hw/timer/mc146818rtc_regs.h"
 
diff --git a/tests/rtl8139-test.c b/tests/rtl8139-test.c
index 4e0bf02..20058a8 100644
--- a/tests/rtl8139-test.c
+++ b/tests/rtl8139-test.c
@@ -7,12 +7,8 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
 #include "libqtest.h"
 #include "libqos/pci-pc.h"
-#include "qemu/osdep.h"
-#include "qemu-common.h"
 
 /* Tests only initialization so far. TODO: Replace with functional tests */
 static void nop(void)
diff --git a/tests/spapr-phb-test.c b/tests/spapr-phb-test.c
index b629de4..0a679c6 100644
--- a/tests/spapr-phb-test.c
+++ b/tests/spapr-phb-test.c
@@ -7,7 +7,6 @@
  * This work is licensed under the terms of the GNU GPL, version 2 or later.
  * See the COPYING file in the top-level directory.
  */
-#include <glib.h>
 
 #include "libqtest.h"
 
diff --git a/tests/tmp105-test.c b/tests/tmp105-test.c
index 99db538..41a7a43 100644
--- a/tests/tmp105-test.c
+++ b/tests/tmp105-test.c
@@ -7,8 +7,6 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-
 #include "libqtest.h"
 #include "libqos/i2c.h"
 #include "hw/misc/tmp105_regs.h"
diff --git a/tests/tpci200-test.c b/tests/tpci200-test.c
index 9ae0127..312f9d3 100644
--- a/tests/tpci200-test.c
+++ b/tests/tpci200-test.c
@@ -7,10 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
 #include "libqtest.h"
-#include "qemu/osdep.h"
 
 /* Tests only initialization so far. TODO: Replace with functional tests */
 static void nop(void)
diff --git a/tests/usb-hcd-ehci-test.c b/tests/usb-hcd-ehci-test.c
index 75073bf..c79ca79 100644
--- a/tests/usb-hcd-ehci-test.c
+++ b/tests/usb-hcd-ehci-test.c
@@ -7,12 +7,8 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
-#include <stdio.h>
 #include "libqtest.h"
 #include "libqos/pci-pc.h"
-#include "qemu/osdep.h"
 #include "hw/usb/uhci-regs.h"
 #include "hw/usb/ehci-regs.h"
 #include "libqos/usb.h"
diff --git a/tests/usb-hcd-ohci-test.c b/tests/usb-hcd-ohci-test.c
index fa592d4..27d0e81 100644
--- a/tests/usb-hcd-ohci-test.c
+++ b/tests/usb-hcd-ohci-test.c
@@ -7,10 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
 #include "libqtest.h"
-#include "qemu/osdep.h"
 #include "libqos/usb.h"
 
 
diff --git a/tests/usb-hcd-uhci-test.c b/tests/usb-hcd-uhci-test.c
index a96b716..b595687 100644
--- a/tests/usb-hcd-uhci-test.c
+++ b/tests/usb-hcd-uhci-test.c
@@ -7,10 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
 #include "libqtest.h"
-#include "qemu/osdep.h"
 #include "libqos/usb.h"
 #include "hw/usb/uhci-regs.h"
 
diff --git a/tests/usb-hcd-xhci-test.c b/tests/usb-hcd-xhci-test.c
index 56ab367..50e6700 100644
--- a/tests/usb-hcd-xhci-test.c
+++ b/tests/usb-hcd-xhci-test.c
@@ -7,10 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
 #include "libqtest.h"
-#include "qemu/osdep.h"
 #include "libqos/usb.h"
 
 
diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
index 75fedf0..636df12 100644
--- a/tests/vhost-user-test.c
+++ b/tests/vhost-user-test.c
@@ -12,7 +12,6 @@
 #include <glib.h>
 
 #include "libqtest.h"
-#include "qemu/option.h"
 #include "sysemu/char.h"
 #include "sysemu/sysemu.h"
 
diff --git a/tests/virtio-9p-test.c b/tests/virtio-9p-test.c
index 1fae477..80c17e2 100644
--- a/tests/virtio-9p-test.c
+++ b/tests/virtio-9p-test.c
@@ -7,12 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <stdlib.h>
-#include <string.h>
-#include <glib.h>
 #include "libqtest.h"
-#include "qemu-common.h"
-#include "qemu/osdep.h"
 
 /* Tests only initialization so far. TODO: Replace with functional tests */
 static void pci_nop(void)
diff --git a/tests/virtio-balloon-test.c b/tests/virtio-balloon-test.c
index becebb5..6e2aefb 100644
--- a/tests/virtio-balloon-test.c
+++ b/tests/virtio-balloon-test.c
@@ -7,10 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
 #include "libqtest.h"
-#include "qemu/osdep.h"
 
 /* Tests only initialization so far. TODO: Replace with functional tests */
 static void pci_nop(void)
diff --git a/tests/virtio-blk-test.c b/tests/virtio-blk-test.c
index 4078321..ceba28f 100644
--- a/tests/virtio-blk-test.c
+++ b/tests/virtio-blk-test.c
@@ -8,11 +8,6 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdio.h>
 #include "libqtest.h"
 #include "libqos/virtio.h"
 #include "libqos/virtio-pci.h"
@@ -21,7 +16,6 @@
 #include "libqos/malloc.h"
 #include "libqos/malloc-pc.h"
 #include "libqos/malloc-generic.h"
-#include "qemu/bswap.h"
 
 #define QVIRTIO_BLK_F_BARRIER       0x00000001
 #define QVIRTIO_BLK_F_SIZE_MAX      0x00000002
diff --git a/tests/virtio-console-test.c b/tests/virtio-console-test.c
index 6be96e8..02f6fda 100644
--- a/tests/virtio-console-test.c
+++ b/tests/virtio-console-test.c
@@ -7,10 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
 #include "libqtest.h"
-#include "qemu/osdep.h"
 
 /* Tests only initialization so far. TODO: Replace with functional tests */
 static void console_pci_nop(void)
diff --git a/tests/virtio-net-test.c b/tests/virtio-net-test.c
index ea7478c..a9979f2 100644
--- a/tests/virtio-net-test.c
+++ b/tests/virtio-net-test.c
@@ -7,10 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
 #include "libqtest.h"
-#include "qemu/osdep.h"
 #include "libqos/pci.h"
 
 #define PCI_SLOT_HP             0x06
diff --git a/tests/virtio-rng-test.c b/tests/virtio-rng-test.c
index 41c1cdb..3b4d614 100644
--- a/tests/virtio-rng-test.c
+++ b/tests/virtio-rng-test.c
@@ -7,10 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
 #include "libqtest.h"
-#include "qemu/osdep.h"
 #include "libqos/pci.h"
 
 #define PCI_SLOT_HP             0x06
diff --git a/tests/virtio-scsi-test.c b/tests/virtio-scsi-test.c
index 989f825..6eed7a0 100644
--- a/tests/virtio-scsi-test.c
+++ b/tests/virtio-scsi-test.c
@@ -7,10 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
 #include "libqtest.h"
-#include "qemu/osdep.h"
 
 /* Tests only initialization so far. TODO: Replace with functional tests */
 static void pci_nop(void)
diff --git a/tests/virtio-serial-test.c b/tests/virtio-serial-test.c
index bf030a6..a99e196 100644
--- a/tests/virtio-serial-test.c
+++ b/tests/virtio-serial-test.c
@@ -7,10 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
 #include "libqtest.h"
-#include "qemu/osdep.h"
 
 /* Tests only initialization so far. TODO: Replace with functional tests */
 static void pci_nop(void)
diff --git a/tests/vmxnet3-test.c b/tests/vmxnet3-test.c
index a2ebed3..c28035c 100644
--- a/tests/vmxnet3-test.c
+++ b/tests/vmxnet3-test.c
@@ -7,10 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
 #include "libqtest.h"
-#include "qemu/osdep.h"
 
 /* Tests only initialization so far. TODO: Replace with functional tests */
 static void nop(void)
diff --git a/tests/wdt_ib700-test.c b/tests/wdt_ib700-test.c
index 513a533..2a1eafa 100644
--- a/tests/wdt_ib700-test.c
+++ b/tests/wdt_ib700-test.c
@@ -7,10 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
 #include "libqtest.h"
-#include "qemu/osdep.h"
 
 #define NS_PER_SEC 1000000000ULL
 

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

* Re: [Qemu-devel] [PATCH] tests: consolidate common includes under libqtest.h
  2015-04-30 22:21       ` [Qemu-devel] [PATCH] tests: consolidate common includes under libqtest.h Emilio G. Cota
@ 2015-05-05 10:28         ` Paolo Bonzini
  0 siblings, 0 replies; 51+ messages in thread
From: Paolo Bonzini @ 2015-05-05 10:28 UTC (permalink / raw)
  To: Emilio G. Cota, Peter Maydell
  Cc: QEMU Trivial, Stefan Weil, Peter Crosthwaite, Michael Tokarev,
	QEMU Developers

On 01/05/2015 00:21, Emilio G. Cota wrote:
> Something like the appended?
> 
> Cheers,
> 
> 		Emilio

Pretty good, but I wouldn't use qemu-common.h, at least not until all
the function and macro declarations are moved to separate headers (some
of them may indeed move to osdep.h, in fact).

Paolo

> commit eb415d0695bb49d9df78aedaf4ed3c7083a1a574
> Author: Emilio G. Cota <cota@braap.org>
> Date:   Thu Apr 30 18:00:01 2015 -0400
> 
>     tests: consolidate common includes under libqtest.h
>     
>     Source files in tests/ include very common headers,
>     such as glib.h or qemu/osdep.h.
>     
>     Consolidate these includes by including qemu-common.h from
>     libqtest.h, which is a common include in tests/.
>     
>     Two things worth mentioning:
>     
>     - i440fx-test drops its ARRAY_SIZE definition, which comes now
>       from osdep.h via qemu-common.h.
>     
>     - vhost-user-test.c does keep its include of glib.h, since
>       it has to do some contortions to support old glib versions.
>       See commit "bd95939f qtest: fix qtest for vhost-user".
>     
>     Signed-off-by: Emilio G. Cota <cota@braap.org>

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

end of thread, other threads:[~2015-05-05 10:29 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-30  5:08 [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 01/42] tpm: Cast 64bit variables to int when used in DPRINTF Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 02/42] tpm: Modify DPRINTF to enable -Wformat checking Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 03/42] bitops : fix coding style Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 04/42] ui/vnc " Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 05/42] ui/vnc : remove 'struct' of 'typedef struct' Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 06/42] ui/console : remove 'struct' from 'typedef struct' type Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 07/42] hw/display : remove 'struct' from 'typedef QXL struct' Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 08/42] misc: Fix new collection of typos Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 09/42] range: remove useless inclusions Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 10/42] qemu-config: remove stray inclusions of hw/ files Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 11/42] tpm: fix coding style Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 12/42] hostmem: Fix mem-path property name in error report Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 13/42] qemu-options: trivial spelling fix (messsage) Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 14/42] vmxnet: Remove unused function vmxnet_rx_pkt_get_num_frags() Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 15/42] pci: Remove unused function ich9_d2pbr_init() Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 16/42] monitor: Remove unused functions Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 17/42] usb: " Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 18/42] util: " Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 19/42] arm: cpu.h: Remove unused typdefs Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 20/42] configure: alphabetize tricore in target list Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 21/42] docs/atomics.txt: fix two typos Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 22/42] libcacard: stop including qemu-common.h Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 23/42] libcacard: do not use full paths for include files in the same dir Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 24/42] defconfigs: Piggyback microblazeel on microblaze Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 25/42] microblaze: mmu: Delete flip_um fn prototype Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 26/42] microblaze: cpu: Remote unused cpu_get_pc Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 27/42] microblaze: cpu: Remove unused CC_OP enum Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 28/42] microblaze: cpu: Delete EXCP_NMI Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 29/42] microblaze: cpu: Renumber EXCP_* constants to close gap Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 30/42] microblaze: cpu: delete unused cpu_interrupts_enabled Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 31/42] cpus: use first_cpu macro instead of QTAILQ_FIRST(&cpus) Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 32/42] input: remove unused mouse_handlers list Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 33/42] qemu-char: remove unused list node from FDCharDriver Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 34/42] coroutine: remove unnecessary parentheses in qemu_co_queue_empty Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 35/42] linux-user/elfload: use QTAILQ_FOREACH instead of open-coding it Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 36/42] i440fx-test: remove ARRAY_SIZE redefinition Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 37/42] qmp-commands: Fix typo Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 38/42] target-mips: fix memory leak Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 39/42] vhost-user: remove superfluous '\n' around error_report() Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 40/42] kvm: Silence warning from valgrind Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 41/42] tcg: Delete unused cpu_pc_from_tb() Michael Tokarev
2015-04-30  5:08 ` [Qemu-devel] [PULL 42/42] microblaze: fix memory leak Michael Tokarev
2015-04-30 12:58 ` [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30 Peter Maydell
2015-04-30 13:05   ` Michael Tokarev
2015-04-30 19:16   ` [Qemu-devel] [PATCH] i440fx-test: guard ARRAY_SIZE definition with #ifndef Emilio G. Cota
2015-04-30 19:28     ` Stefan Weil
2015-04-30 20:02       ` Peter Maydell
2015-04-30 20:14     ` Michael Tokarev
2015-04-30 22:21       ` [Qemu-devel] [PATCH] tests: consolidate common includes under libqtest.h Emilio G. Cota
2015-05-05 10:28         ` Paolo Bonzini

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.