All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/9] Trivial patches for 2014-08-09
@ 2014-08-08 20:38 Michael Tokarev
  2014-08-08 20:38 ` [Qemu-devel] [PULL 1/9] hw/timer/imx_*: fix TIMER_MAX clash with system symbol Michael Tokarev
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Michael Tokarev @ 2014-08-08 20:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev

There's a next pull request for the -trivial tree.
Nothing exciting in there this time.  Small things
left from pre-2.1 time, small new things here and
there, and 2 portability fixes on top of 2.1.

Please consider applying.

/mjt

The following changes since commit 2d591ce2aeebf9620ff527c7946844a3122afeec:

  Merge remote-tracking branch 'remotes/mdroth/qga-pull-2014-08-08' into staging (2014-08-08 14:16:05 +0100)

are available in the git repository at:

  git://git.corpit.ru/qemu.git tags/trivial-patches-2014-08-09

for you to fetch changes up to 169a24aea4f287739797a8b15565b9b5e59e53be:

  build-sys: Move qapi-{types, visit, event}.o into util-obj-y (2014-08-09 00:09:17 +0400)

----------------------------------------------------------------
trivial patches for 2014-08-09

----------------------------------------------------------------
Alex Bligh (1):
      Show length mismatch error is hex

Chen Gang (1):
      qemu-img: Check getchar() return value in read_password() for WIN32

Fam Zheng (2):
      po: Add Chinese translation
      build-sys: Move qapi-{types, visit, event}.o into util-obj-y

Michael Tokarev (2):
      hw/timer/imx_*: fix TIMER_MAX clash with system symbol
      l2tpv3 (configure): it is linux-specific

Stefan Weil (2):
      virtio: Move extern declaration to header file
      hw/timer: Move extern declaration from .c to .h file

chenfan (1):
      target-i386/cpu.c: Fix two error output indentation

 Makefile                          |    2 +-
 Makefile.objs                     |   10 +----
 arch_init.c                       |    4 +-
 configure                         |    1 +
 hw/timer/imx_epit.c               |   16 +++----
 hw/timer/imx_gpt.c                |   32 +++++++-------
 hw/timer/tusb6010.c               |    3 --
 hw/virtio/vhost-backend.c         |    2 -
 include/hw/usb.h                  |    7 ++-
 include/hw/virtio/vhost-backend.h |    2 +
 po/zh_CN.po                       |   86 +++++++++++++++++++++++++++++++++++++
 qemu-img.c                        |    9 +++-
 target-i386/cpu.c                 |   10 ++---
 tests/Makefile                    |    2 +-
 14 files changed, 137 insertions(+), 49 deletions(-)
 create mode 100644 po/zh_CN.po

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

* [Qemu-devel] [PULL 1/9] hw/timer/imx_*: fix TIMER_MAX clash with system symbol
  2014-08-08 20:38 [Qemu-devel] [PULL 0/9] Trivial patches for 2014-08-09 Michael Tokarev
@ 2014-08-08 20:38 ` Michael Tokarev
  2014-08-08 20:38 ` [Qemu-devel] [PULL 2/9] l2tpv3 (configure): it is linux-specific Michael Tokarev
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Michael Tokarev @ 2014-08-08 20:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev

The symbol TIMER_MAX used in imx_epit.c and imx_gpt.c
clashes with system symbol with the same name.  Because
all qemu source files includes qemu-common.h which, in
turn, includes limits.h, which is not unusual to define
it.  Rename local symbol to have a reasonable prefix.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/timer/imx_epit.c |   16 ++++++++--------
 hw/timer/imx_gpt.c  |   32 ++++++++++++++++----------------
 2 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/hw/timer/imx_epit.c b/hw/timer/imx_epit.c
index c855eba..ffefc22 100644
--- a/hw/timer/imx_epit.c
+++ b/hw/timer/imx_epit.c
@@ -83,7 +83,7 @@ static char const *imx_epit_reg_name(uint32_t reg)
 #define CR_CLKSRC_SHIFT (24)
 #define CR_CLKSRC_MASK  (0x3 << CR_CLKSRC_SHIFT)
 
-#define TIMER_MAX  0XFFFFFFFFUL
+#define EPIT_TIMER_MAX  0XFFFFFFFFUL
 
 /*
  * Exact clock frequencies vary from board to board.
@@ -155,7 +155,7 @@ static void imx_epit_reset(DeviceState *dev)
      */
     s->cr &= (CR_EN|CR_ENMOD|CR_STOPEN|CR_DOZEN|CR_WAITEN|CR_DBGEN);
     s->sr = 0;
-    s->lr = TIMER_MAX;
+    s->lr = EPIT_TIMER_MAX;
     s->cmp = 0;
     s->cnt = 0;
     /* stop both timers */
@@ -163,9 +163,9 @@ static void imx_epit_reset(DeviceState *dev)
     ptimer_stop(s->timer_reload);
     /* compute new frequency */
     imx_epit_set_freq(s);
-    /* init both timers to TIMER_MAX */
-    ptimer_set_limit(s->timer_cmp, TIMER_MAX, 1);
-    ptimer_set_limit(s->timer_reload, TIMER_MAX, 1);
+    /* init both timers to EPIT_TIMER_MAX */
+    ptimer_set_limit(s->timer_cmp, EPIT_TIMER_MAX, 1);
+    ptimer_set_limit(s->timer_reload, EPIT_TIMER_MAX, 1);
     if (s->freq && (s->cr & CR_EN)) {
         /* if the timer is still enabled, restart it */
         ptimer_run(s->timer_reload, 0);
@@ -227,7 +227,7 @@ static void imx_epit_reload_compare_timer(IMXEPITState *s)
             /* It'll fire in this round of the timer */
             next = tmp - s->cmp;
         } else { /* catch it next time around */
-            next = tmp - s->cmp + ((s->cr & CR_RLD) ? TIMER_MAX : s->lr);
+            next = tmp - s->cmp + ((s->cr & CR_RLD) ? EPIT_TIMER_MAX : s->lr);
         }
         ptimer_set_count(s->timer_cmp, next);
     }
@@ -260,8 +260,8 @@ static void imx_epit_write(void *opaque, hwaddr offset, uint64_t value,
                     ptimer_set_limit(s->timer_reload, s->lr, 1);
                     ptimer_set_limit(s->timer_cmp, s->lr, 1);
                 } else {
-                    ptimer_set_limit(s->timer_reload, TIMER_MAX, 1);
-                    ptimer_set_limit(s->timer_cmp, TIMER_MAX, 1);
+                    ptimer_set_limit(s->timer_reload, EPIT_TIMER_MAX, 1);
+                    ptimer_set_limit(s->timer_cmp, EPIT_TIMER_MAX, 1);
                 }
             }
 
diff --git a/hw/timer/imx_gpt.c b/hw/timer/imx_gpt.c
index 56ee4db..3b31010 100644
--- a/hw/timer/imx_gpt.c
+++ b/hw/timer/imx_gpt.c
@@ -80,11 +80,11 @@ static char const *imx_gpt_reg_name(uint32_t reg)
  * GPT : General purpose timer
  *
  * This timer counts up continuously while it is enabled, resetting itself
- * to 0 when it reaches TIMER_MAX (in freerun mode) or when it
+ * to 0 when it reaches GPT_TIMER_MAX (in freerun mode) or when it
  * reaches the value of one of the ocrX (in periodic mode).
  */
 
-#define TIMER_MAX  0XFFFFFFFFUL
+#define GPT_TIMER_MAX  0XFFFFFFFFUL
 
 /* Control register.  Not all of these bits have any effect (yet) */
 #define GPT_CR_EN     (1 << 0)  /* GPT Enable */
@@ -218,7 +218,7 @@ static inline uint32_t imx_gpt_find_limit(uint32_t count, uint32_t reg,
 
 static void imx_gpt_compute_next_timeout(IMXGPTState *s, bool event)
 {
-    uint32_t timeout = TIMER_MAX;
+    uint32_t timeout = GPT_TIMER_MAX;
     uint32_t count = 0;
     long long limit;
 
@@ -230,10 +230,10 @@ static void imx_gpt_compute_next_timeout(IMXGPTState *s, bool event)
     if (event) {
         /* This is a timer event  */
 
-        if ((s->cr & GPT_CR_FRR)  && (s->next_timeout != TIMER_MAX)) {
+        if ((s->cr & GPT_CR_FRR)  && (s->next_timeout != GPT_TIMER_MAX)) {
             /*
              * if we are in free running mode and we have not reached
-             * the TIMER_MAX limit, then update the count
+             * the GPT_TIMER_MAX limit, then update the count
              */
             count = imx_gpt_update_count(s);
         }
@@ -267,7 +267,7 @@ static void imx_gpt_compute_next_timeout(IMXGPTState *s, bool event)
     if ((s->ir & GPT_IR_OF3IE) && (timeout == s->ocr3)) {
         s->next_int |= GPT_SR_OF3;
     }
-    if ((s->ir & GPT_IR_ROVIE) && (timeout == TIMER_MAX)) {
+    if ((s->ir & GPT_IR_ROVIE) && (timeout == GPT_TIMER_MAX)) {
         s->next_int |= GPT_SR_ROV;
     }
 
@@ -370,20 +370,20 @@ static void imx_gpt_reset(DeviceState *dev)
     s->pr = 0;
     s->ir = 0;
     s->cnt = 0;
-    s->ocr1 = TIMER_MAX;
-    s->ocr2 = TIMER_MAX;
-    s->ocr3 = TIMER_MAX;
+    s->ocr1 = GPT_TIMER_MAX;
+    s->ocr2 = GPT_TIMER_MAX;
+    s->ocr3 = GPT_TIMER_MAX;
     s->icr1 = 0;
     s->icr2 = 0;
 
-    s->next_timeout = TIMER_MAX;
+    s->next_timeout = GPT_TIMER_MAX;
     s->next_int = 0;
 
     /* compute new freq */
     imx_gpt_set_freq(s);
 
-    /* reset the limit to TIMER_MAX */
-    ptimer_set_limit(s->timer, TIMER_MAX, 1);
+    /* reset the limit to GPT_TIMER_MAX */
+    ptimer_set_limit(s->timer, GPT_TIMER_MAX, 1);
 
     /* if the timer is still enabled, restart it */
     if (s->freq && (s->cr & GPT_CR_EN)) {
@@ -415,8 +415,8 @@ static void imx_gpt_write(void *opaque, hwaddr offset, uint64_t value,
             if ((oldreg ^ s->cr) & GPT_CR_EN) {
                 if (s->cr & GPT_CR_EN) {
                     if (s->cr & GPT_CR_ENMOD) {
-                        s->next_timeout = TIMER_MAX;
-                        ptimer_set_count(s->timer, TIMER_MAX);
+                        s->next_timeout = GPT_TIMER_MAX;
+                        ptimer_set_count(s->timer, GPT_TIMER_MAX);
                         imx_gpt_compute_next_timeout(s, false);
                     }
                     ptimer_run(s->timer, 1);
@@ -451,8 +451,8 @@ static void imx_gpt_write(void *opaque, hwaddr offset, uint64_t value,
 
         /* In non-freerun mode, reset count when this register is written */
         if (!(s->cr & GPT_CR_FRR)) {
-            s->next_timeout = TIMER_MAX;
-            ptimer_set_limit(s->timer, TIMER_MAX, 1);
+            s->next_timeout = GPT_TIMER_MAX;
+            ptimer_set_limit(s->timer, GPT_TIMER_MAX, 1);
         }
 
         /* compute the new timeout */
-- 
1.7.10.4

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

* [Qemu-devel] [PULL 2/9] l2tpv3 (configure): it is linux-specific
  2014-08-08 20:38 [Qemu-devel] [PULL 0/9] Trivial patches for 2014-08-09 Michael Tokarev
  2014-08-08 20:38 ` [Qemu-devel] [PULL 1/9] hw/timer/imx_*: fix TIMER_MAX clash with system symbol Michael Tokarev
@ 2014-08-08 20:38 ` Michael Tokarev
  2014-08-08 20:38 ` [Qemu-devel] [PULL 3/9] target-i386/cpu.c: Fix two error output indentation Michael Tokarev
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Michael Tokarev @ 2014-08-08 20:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev

Some non-linux systems, for example a system with
FreeBSD kernel and glibc, may declare struct mmsghdr
(in glibc) but may not have linux-specific header
file linux/ip.h.  The actual implementation in qemu
includes this linux-specific header file unconditionally,
so compilation fails if it is not present.  Include
this header in the configure test too.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 configure |    1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index f7685b5..f49e618 100755
--- a/configure
+++ b/configure
@@ -1723,6 +1723,7 @@ fi
 
 cat > $TMPC <<EOF
 #include <sys/socket.h>
+#include <linux/ip.h>
 int main(void) { return sizeof(struct mmsghdr); }
 EOF
 if compile_prog "" "" ; then
-- 
1.7.10.4

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

* [Qemu-devel] [PULL 3/9] target-i386/cpu.c: Fix two error output indentation
  2014-08-08 20:38 [Qemu-devel] [PULL 0/9] Trivial patches for 2014-08-09 Michael Tokarev
  2014-08-08 20:38 ` [Qemu-devel] [PULL 1/9] hw/timer/imx_*: fix TIMER_MAX clash with system symbol Michael Tokarev
  2014-08-08 20:38 ` [Qemu-devel] [PULL 2/9] l2tpv3 (configure): it is linux-specific Michael Tokarev
@ 2014-08-08 20:38 ` Michael Tokarev
  2014-08-08 20:38 ` [Qemu-devel] [PULL 4/9] Show length mismatch error is hex Michael Tokarev
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Michael Tokarev @ 2014-08-08 20:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: chenfan, qemu-trivial, Michael Tokarev

From: chenfan <chen.fan.fnst@cn.fujitsu.com>

Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 target-i386/cpu.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 6d008ab..217500c 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1716,9 +1716,9 @@ static void x86_set_hv_spinlocks(Object *obj, Visitor *v, void *opaque,
 
     if (value < min || value > max) {
         error_setg(errp, "Property %s.%s doesn't take value %" PRId64
-                  " (minimum: %" PRId64 ", maximum: %" PRId64 ")",
-                  object_get_typename(obj), name ? name : "null",
-                  value, min, max);
+                   " (minimum: %" PRId64 ", maximum: %" PRId64 ")",
+                   object_get_typename(obj), name ? name : "null",
+                   value, min, max);
         return;
     }
     cpu->hyperv_spinlock_attempts = value;
@@ -1808,8 +1808,8 @@ static void x86_cpu_parse_featurestr(CPUState *cs, char *features,
                 }
                 if (numvalue < min) {
                     error_report("hv-spinlocks value shall always be >= 0x%x"
-                            ", fixup will be removed in future versions",
-                            min);
+                                 ", fixup will be removed in future versions",
+                                 min);
                     numvalue = min;
                 }
                 snprintf(num, sizeof(num), "%" PRId32, numvalue);
-- 
1.7.10.4

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

* [Qemu-devel] [PULL 4/9] Show length mismatch error is hex
  2014-08-08 20:38 [Qemu-devel] [PULL 0/9] Trivial patches for 2014-08-09 Michael Tokarev
                   ` (2 preceding siblings ...)
  2014-08-08 20:38 ` [Qemu-devel] [PULL 3/9] target-i386/cpu.c: Fix two error output indentation Michael Tokarev
@ 2014-08-08 20:38 ` Michael Tokarev
  2014-08-08 20:38 ` [Qemu-devel] [PULL 5/9] virtio: Move extern declaration to header file Michael Tokarev
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Michael Tokarev @ 2014-08-08 20:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Alex Bligh

From: Alex Bligh <alex@alex.org.uk>

When live migrate fails due to a section length mismatch we currently
see an error message like:

Length mismatch: 0000:00:03.0/virtio-net-pci.rom: 10000 in != 20000

The section lengths are in fact in hex, so this should read

Length mismatch: 0000:00:03.0/virtio-net-pci.rom: 0x10000 in != 0x20000

Correct the error string to reflect this.

Signed-off-by: Alex Bligh <alex@alex.org.uk>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 arch_init.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch_init.c b/arch_init.c
index 8ddaf35..28ece76 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -1072,8 +1072,8 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id)
                 QTAILQ_FOREACH(block, &ram_list.blocks, next) {
                     if (!strncmp(id, block->idstr, sizeof(id))) {
                         if (block->length != length) {
-                            error_report("Length mismatch: %s: " RAM_ADDR_FMT
-                                         " in != " RAM_ADDR_FMT, id, length,
+                            error_report("Length mismatch: %s: 0x" RAM_ADDR_FMT
+                                         " in != 0x" RAM_ADDR_FMT, id, length,
                                          block->length);
                             ret =  -EINVAL;
                         }
-- 
1.7.10.4

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

* [Qemu-devel] [PULL 5/9] virtio: Move extern declaration to header file
  2014-08-08 20:38 [Qemu-devel] [PULL 0/9] Trivial patches for 2014-08-09 Michael Tokarev
                   ` (3 preceding siblings ...)
  2014-08-08 20:38 ` [Qemu-devel] [PULL 4/9] Show length mismatch error is hex Michael Tokarev
@ 2014-08-08 20:38 ` Michael Tokarev
  2014-08-08 20:38 ` [Qemu-devel] [PULL 6/9] hw/timer: Move extern declaration from .c to .h file Michael Tokarev
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Michael Tokarev @ 2014-08-08 20:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Stefan Weil, Michael Tokarev

From: Stefan Weil <sw@weilnetz.de>

This fixes a warning from smatch (static code analyser).

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/virtio/vhost-backend.c         |    2 --
 include/hw/virtio/vhost-backend.h |    2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/virtio/vhost-backend.c b/hw/virtio/vhost-backend.c
index 35316c4..ff4f200 100644
--- a/hw/virtio/vhost-backend.c
+++ b/hw/virtio/vhost-backend.c
@@ -14,8 +14,6 @@
 
 #include <sys/ioctl.h>
 
-extern const VhostOps user_ops;
-
 static int vhost_kernel_call(struct vhost_dev *dev, unsigned long int request,
                              void *arg)
 {
diff --git a/include/hw/virtio/vhost-backend.h b/include/hw/virtio/vhost-backend.h
index d31768a..e472f29 100644
--- a/include/hw/virtio/vhost-backend.h
+++ b/include/hw/virtio/vhost-backend.h
@@ -32,6 +32,8 @@ typedef struct VhostOps {
     vhost_backend_cleanup vhost_backend_cleanup;
 } VhostOps;
 
+extern const VhostOps user_ops;
+
 int vhost_set_backend_type(struct vhost_dev *dev,
                            VhostBackendType backend_type);
 
-- 
1.7.10.4

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

* [Qemu-devel] [PULL 6/9] hw/timer: Move extern declaration from .c to .h file
  2014-08-08 20:38 [Qemu-devel] [PULL 0/9] Trivial patches for 2014-08-09 Michael Tokarev
                   ` (4 preceding siblings ...)
  2014-08-08 20:38 ` [Qemu-devel] [PULL 5/9] virtio: Move extern declaration to header file Michael Tokarev
@ 2014-08-08 20:38 ` Michael Tokarev
  2014-08-08 20:39 ` [Qemu-devel] [PULL 7/9] qemu-img: Check getchar() return value in read_password() for WIN32 Michael Tokarev
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Michael Tokarev @ 2014-08-08 20:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Stefan Weil, Michael Tokarev

From: Stefan Weil <sw@weilnetz.de>

This fixes a warning from smatch (static code analyser).

Fix also the comment with the renamed source file name.

Signed-off-by: Stefan Weil <sw@weilnetz.de>

 hw/timer/tusb6010.c |    3 ---
 include/hw/usb.h    |    7 ++++++-
 2 files changed, 6 insertions(+), 4 deletions(-)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/timer/tusb6010.c |    3 ---
 include/hw/usb.h    |    7 ++++++-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/hw/timer/tusb6010.c b/hw/timer/tusb6010.c
index bd2a89e..459c748 100644
--- a/hw/timer/tusb6010.c
+++ b/hw/timer/tusb6010.c
@@ -282,9 +282,6 @@ static void tusb_gpio_intr_update(TUSBState *s)
     /* TODO: How is this signalled?  */
 }
 
-extern CPUReadMemoryFunc * const musb_read[];
-extern CPUWriteMemoryFunc * const musb_write[];
-
 static uint32_t tusb_async_readb(void *opaque, hwaddr addr)
 {
     TUSBState *s = (TUSBState *) opaque;
diff --git a/include/hw/usb.h b/include/hw/usb.h
index 8bcab48..223a5ae 100644
--- a/include/hw/usb.h
+++ b/include/hw/usb.h
@@ -475,7 +475,8 @@ void usb_host_info(Monitor *mon, const QDict *qdict);
 
 #define VM_USB_HUB_SIZE 8
 
-/* usb-musb.c */
+/* hw/usb/hdc-musb.c */
+
 enum musb_irq_source_e {
     musb_irq_suspend = 0,
     musb_irq_resume,
@@ -494,6 +495,10 @@ enum musb_irq_source_e {
 };
 
 typedef struct MUSBState MUSBState;
+
+extern CPUReadMemoryFunc * const musb_read[];
+extern CPUWriteMemoryFunc * const musb_write[];
+
 MUSBState *musb_init(DeviceState *parent_device, int gpio_base);
 void musb_reset(MUSBState *s);
 uint32_t musb_core_intr_get(MUSBState *s);
-- 
1.7.10.4

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

* [Qemu-devel] [PULL 7/9] qemu-img: Check getchar() return value in read_password() for WIN32
  2014-08-08 20:38 [Qemu-devel] [PULL 0/9] Trivial patches for 2014-08-09 Michael Tokarev
                   ` (5 preceding siblings ...)
  2014-08-08 20:38 ` [Qemu-devel] [PULL 6/9] hw/timer: Move extern declaration from .c to .h file Michael Tokarev
@ 2014-08-08 20:39 ` Michael Tokarev
  2014-08-08 20:39 ` [Qemu-devel] [PULL 8/9] po: Add Chinese translation Michael Tokarev
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Michael Tokarev @ 2014-08-08 20:39 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Chen Gang

From: Chen Gang <gang.chen.5i5j@gmail.com>

getchar() is a standard c library function which may return with failure
(e.g. -1), so like another platforms, also need check it under WIN32.

And make the related code match current qemu code styles, too.

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 qemu-img.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/qemu-img.c b/qemu-img.c
index d4518e7..19495bb 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -185,15 +185,20 @@ static int GCC_FMT_ATTR(2, 3) qprintf(bool quiet, const char *fmt, ...)
 static int read_password(char *buf, int buf_size)
 {
     int c, i;
+
     printf("Password: ");
     fflush(stdout);
     i = 0;
     for(;;) {
         c = getchar();
-        if (c == '\n')
+        if (c < 0) {
+            buf[i] = '\0';
+            return -1;
+        } else if (c == '\n') {
             break;
-        if (i < (buf_size - 1))
+        } else if (i < (buf_size - 1)) {
             buf[i++] = c;
+        }
     }
     buf[i] = '\0';
     return 0;
-- 
1.7.10.4

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

* [Qemu-devel] [PULL 8/9] po: Add Chinese translation
  2014-08-08 20:38 [Qemu-devel] [PULL 0/9] Trivial patches for 2014-08-09 Michael Tokarev
                   ` (6 preceding siblings ...)
  2014-08-08 20:39 ` [Qemu-devel] [PULL 7/9] qemu-img: Check getchar() return value in read_password() for WIN32 Michael Tokarev
@ 2014-08-08 20:39 ` Michael Tokarev
  2014-08-08 20:39 ` [Qemu-devel] [PULL 9/9] build-sys: Move qapi-{types, visit, event}.o into util-obj-y Michael Tokarev
  2014-08-15 13:49 ` [Qemu-devel] [PULL 0/9] Trivial patches for 2014-08-09 Peter Maydell
  9 siblings, 0 replies; 11+ messages in thread
From: Michael Tokarev @ 2014-08-08 20:39 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Fam Zheng

From: Fam Zheng <famz@redhat.com>

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
Reviewed-by: Dongsheng Song <songdongsheng@live.cn>
Reviewed-by: Wei Huang <wehuang@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 po/zh_CN.po |   86 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 86 insertions(+)
 create mode 100644 po/zh_CN.po

diff --git a/po/zh_CN.po b/po/zh_CN.po
new file mode 100644
index 0000000..2b1d42e
--- /dev/null
+++ b/po/zh_CN.po
@@ -0,0 +1,86 @@
+# Chinese translation for QEMU.
+# This file is put in the public domain.
+#
+# Fam Zheng <famz@redhat.com>, 2014
+msgid ""
+msgstr ""
+"Project-Id-Version: QEMU 2.2\n"
+"Report-Msgid-Bugs-To: qemu-devel@nongnu.org\n"
+"POT-Creation-Date: 2014-07-31 10:03+0800\n"
+"PO-Revision-Date: 2014-07-31 10:00+0800\n"
+"Last-Translator: Fam Zheng <famz@redhat.com>\n"
+"Language-Team: Chinese <zh@li.org>\n"
+"Language: zh\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Lokalize 1.4\n"
+
+#: ui/gtk.c:321
+msgid " - Press Ctrl+Alt+G to release grab"
+msgstr " - 按下 Ctrl+Alt+G 取消捕获"
+
+#: ui/gtk.c:325
+msgid " [Paused]"
+msgstr " [已暂停]"
+
+#: ui/gtk.c:1601
+msgid "_Pause"
+msgstr "暂停(_P)"
+
+#: ui/gtk.c:1607
+msgid "_Reset"
+msgstr "重置(_R)"
+
+#: ui/gtk.c:1610
+msgid "Power _Down"
+msgstr "关闭电源(_D)"
+
+#: ui/gtk.c:1616
+msgid "_Quit"
+msgstr "退出(_Q)"
+
+#: ui/gtk.c:1692
+msgid "_Fullscreen"
+msgstr "全屏(_F)"
+
+#: ui/gtk.c:1702
+msgid "Zoom _In"
+msgstr "放大(_I)"
+
+#: ui/gtk.c:1709
+msgid "Zoom _Out"
+msgstr "缩小(_O)"
+
+#: ui/gtk.c:1716
+msgid "Best _Fit"
+msgstr "最合适大小(_F)"
+
+#: ui/gtk.c:1723
+msgid "Zoom To _Fit"
+msgstr "缩放以适应大小(_F)"
+
+#: ui/gtk.c:1729
+msgid "Grab On _Hover"
+msgstr "鼠标经过时捕获(_H)"
+
+#: ui/gtk.c:1732
+msgid "_Grab Input"
+msgstr "捕获输入(_G)"
+
+#: ui/gtk.c:1761
+msgid "Show _Tabs"
+msgstr "显示标签页(_T)"
+
+#: ui/gtk.c:1764
+msgid "Detach Tab"
+msgstr "分离标签页"
+
+#: ui/gtk.c:1778
+msgid "_Machine"
+msgstr "虚拟机(_M)"
+
+#: ui/gtk.c:1783
+msgid "_View"
+msgstr "视图(_V)"
-- 
1.7.10.4

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

* [Qemu-devel] [PULL 9/9] build-sys: Move qapi-{types, visit, event}.o into util-obj-y
  2014-08-08 20:38 [Qemu-devel] [PULL 0/9] Trivial patches for 2014-08-09 Michael Tokarev
                   ` (7 preceding siblings ...)
  2014-08-08 20:39 ` [Qemu-devel] [PULL 8/9] po: Add Chinese translation Michael Tokarev
@ 2014-08-08 20:39 ` Michael Tokarev
  2014-08-15 13:49 ` [Qemu-devel] [PULL 0/9] Trivial patches for 2014-08-09 Peter Maydell
  9 siblings, 0 replies; 11+ messages in thread
From: Michael Tokarev @ 2014-08-08 20:39 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Fam Zheng

From: Fam Zheng <famz@redhat.com>

These three objects are repeated in multiple times in Makefiles. Let's
just add them to libqemuutil.a, and don't list explicitly elsewhere.

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 Makefile       |    2 +-
 Makefile.objs  |   10 ++--------
 tests/Makefile |    2 +-
 3 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index d6b9dc1..c5751b8 100644
--- a/Makefile
+++ b/Makefile
@@ -202,7 +202,7 @@ Makefile: $(version-obj-y) $(version-lobj-y)
 # Build libraries
 
 libqemustub.a: $(stub-obj-y)
-libqemuutil.a: $(util-obj-y) qapi-types.o qapi-visit.o qapi-event.o
+libqemuutil.a: $(util-obj-y)
 
 block-modules = $(foreach o,$(block-obj-m),"$(basename $(subst /,-,$o))",) NULL
 util/module.o-cflags = -D'CONFIG_BLOCK_MODULES=$(block-modules)'
diff --git a/Makefile.objs b/Makefile.objs
index 1f76cea..efd9768 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -1,7 +1,7 @@
 #######################################################################
 # Common libraries for tools and emulators
 stub-obj-y = stubs/
-util-obj-y = util/ qobject/ qapi/ trace/
+util-obj-y = util/ qobject/ qapi/ trace/ qapi-types.o qapi-visit.o qapi-event.o
 
 #######################################################################
 # block-obj-y is code used by both qemu system emulation and qemu-img
@@ -12,7 +12,6 @@ block-obj-y += main-loop.o iohandler.o qemu-timer.o
 block-obj-$(CONFIG_POSIX) += aio-posix.o
 block-obj-$(CONFIG_WIN32) += aio-win32.o
 block-obj-y += block/
-block-obj-y += qapi-types.o qapi-visit.o qapi-event.o
 block-obj-y += qemu-io-cmds.o
 
 block-obj-y += qemu-coroutine.o qemu-coroutine-lock.o qemu-coroutine-io.o
@@ -88,11 +87,6 @@ common-obj-y += qmp-marshal.o
 common-obj-y += qmp.o hmp.o
 endif
 
-######################################################################
-# some qapi visitors are used by both system and user emulation:
-
-common-obj-y += qapi-visit.o qapi-types.o
-
 #######################################################################
 # Target-independent parts used in system and user emulation
 common-obj-y += qemu-log.o
@@ -111,5 +105,5 @@ version-lobj-$(CONFIG_WIN32) += $(BUILD_DIR)/version.lo
 
 # FIXME: a few definitions from qapi-types.o/qapi-visit.o are needed
 # by libqemuutil.a.  These should be moved to a separate .json schema.
-qga-obj-y = qga/ qapi-types.o qapi-visit.o
+qga-obj-y = qga/
 qga-vss-dll-obj-y = qga/
diff --git a/tests/Makefile b/tests/Makefile
index 4b2e1bb..837e9c8 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -282,7 +282,7 @@ tests/test-qmp-event$(EXESUF): tests/test-qmp-event.o $(test-qapi-obj-y) libqemu
 tests/test-qmp-output-visitor$(EXESUF): tests/test-qmp-output-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
 tests/test-qmp-input-visitor$(EXESUF): tests/test-qmp-input-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
 tests/test-qmp-input-strict$(EXESUF): tests/test-qmp-input-strict.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
-tests/test-qmp-commands$(EXESUF): tests/test-qmp-commands.o tests/test-qmp-marshal.o $(test-qapi-obj-y) qapi-types.o qapi-visit.o libqemuutil.a libqemustub.a
+tests/test-qmp-commands$(EXESUF): tests/test-qmp-commands.o tests/test-qmp-marshal.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
 tests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
 tests/test-opts-visitor$(EXESUF): tests/test-opts-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
 
-- 
1.7.10.4

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

* Re: [Qemu-devel] [PULL 0/9] Trivial patches for 2014-08-09
  2014-08-08 20:38 [Qemu-devel] [PULL 0/9] Trivial patches for 2014-08-09 Michael Tokarev
                   ` (8 preceding siblings ...)
  2014-08-08 20:39 ` [Qemu-devel] [PULL 9/9] build-sys: Move qapi-{types, visit, event}.o into util-obj-y Michael Tokarev
@ 2014-08-15 13:49 ` Peter Maydell
  9 siblings, 0 replies; 11+ messages in thread
From: Peter Maydell @ 2014-08-15 13:49 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: QEMU Trivial, QEMU Developers

On 8 August 2014 21:38, Michael Tokarev <mjt@tls.msk.ru> wrote:
> There's a next pull request for the -trivial tree.
> Nothing exciting in there this time.  Small things
> left from pre-2.1 time, small new things here and
> there, and 2 portability fixes on top of 2.1.
>
> Please consider applying.
>
> /mjt

Applied, thanks.

-- PMM

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

end of thread, other threads:[~2014-08-15 13:50 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-08 20:38 [Qemu-devel] [PULL 0/9] Trivial patches for 2014-08-09 Michael Tokarev
2014-08-08 20:38 ` [Qemu-devel] [PULL 1/9] hw/timer/imx_*: fix TIMER_MAX clash with system symbol Michael Tokarev
2014-08-08 20:38 ` [Qemu-devel] [PULL 2/9] l2tpv3 (configure): it is linux-specific Michael Tokarev
2014-08-08 20:38 ` [Qemu-devel] [PULL 3/9] target-i386/cpu.c: Fix two error output indentation Michael Tokarev
2014-08-08 20:38 ` [Qemu-devel] [PULL 4/9] Show length mismatch error is hex Michael Tokarev
2014-08-08 20:38 ` [Qemu-devel] [PULL 5/9] virtio: Move extern declaration to header file Michael Tokarev
2014-08-08 20:38 ` [Qemu-devel] [PULL 6/9] hw/timer: Move extern declaration from .c to .h file Michael Tokarev
2014-08-08 20:39 ` [Qemu-devel] [PULL 7/9] qemu-img: Check getchar() return value in read_password() for WIN32 Michael Tokarev
2014-08-08 20:39 ` [Qemu-devel] [PULL 8/9] po: Add Chinese translation Michael Tokarev
2014-08-08 20:39 ` [Qemu-devel] [PULL 9/9] build-sys: Move qapi-{types, visit, event}.o into util-obj-y Michael Tokarev
2014-08-15 13:49 ` [Qemu-devel] [PULL 0/9] Trivial patches for 2014-08-09 Peter Maydell

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.