Skip to contentSkip to conversation

Trivial patches for 2013-12-06

GIT PULL Michael Tokarev 1 participant 15 messages Dec 6, 2013

lore
Share & tools
lore
#0 lore raw

Here's the first trivial-patches pull request after 1.7. It contains the few patches which were requested for 1.7 but hasn't been applied, plus a few more patches which weren't supposed to be included in 1.7.

Please pull.

Thanks,

/mjt

The following changes since commit 7dc65c02fe3fb8f3146ce0b9ff5fec5945329f0e:

Open 2.0 development tree (2013-11-27 14:02:45 -0800)

are available in the git repository at:

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

for you to fetch changes up to 6fedcaa1c5419fa89c31fd34dabbd71861c615d2:

eeprom93xx: fix coding style (2013-12-06 22:56:51 +0400)

----------------------------------------------------------------
Antony Pavlov (1):
eeprom93xx: fix coding style

Don Koch (1):
Don't crash on keyboard input with no handler

Fam Zheng (1):
.gitignore: Ignore config.status

Michael Tokarev (1):
hw/ppc/mac.h: remove unused BIOS_FILENAME definition

Stefan Weil (9):
trace: Remove trace.h from console.h (less dependencies)
trace: Remove trace.h from hw/usb/hcd-ehci.h (less dependencies)
console: Replace conditional debug messages by trace methods
gtk: Replace conditional debug messages by trace methods
acpi-build: Fix compiler warning (missing gnu_printf format attribute)
qobject: Fix compiler warning (missing gnu_printf format attribute)
misc: Replace 'struct QEMUTimer' by 'QEMUTimer'
libcacard/cac: Remove unused statement (value stored is never read) libcacard/vcard_emul_nss: Remove unused statement (value stored is never read)

Zhi Yong Wu (1):
virtio-net: fix the indent

 .gitignore                 |    1 +
 hw/char/cadence_uart.c     |    4 +--
 hw/display/vmware_vga.c    |    1 +
 hw/i386/acpi-build.c       |    5 ++--
 hw/net/virtio-net.c        |    2 +-
 hw/nvram/eeprom93xx.c      |   62 ++++++++++++++++++++++----------------------
 hw/ppc/mac.h               |    1 -
 hw/ppc/ppc.c               |    6 ++---
 hw/ppc/ppc405_uc.c         |    2 +-
 hw/ppc/ppc_booke.c         |    4 +--
 hw/timer/m48t59.c          |    4 +--
 hw/usb/hcd-ehci.c          |    1 +
 hw/usb/hcd-ehci.h          |    1 -
 include/hw/char/serial.h   |    4 +--
 include/hw/ppc/ppc.h       |    4 +--
 include/ui/console.h       |    1 -
 libcacard/cac.c            |    1 -
 libcacard/vcard_emul_nss.c |    1 -
 qobject/qerror.c           |    4 +--
 target-alpha/cpu-qom.h     |    2 +-
 target-mips/cpu.h          |    2 +-
 target-openrisc/cpu.h      |    2 +-
 target-sparc/cpu.h         |    2 +-
 trace-events               |    7 +++++
 ui/console.c               |   14 ++++------
 ui/gtk.c                   |   19 ++++----------
 ui/input.c                 |    2 +-
 27 files changed, 76 insertions(+), 83 deletions(-)
#1 lore raw

[Qemu-devel] [PULL 02/14] trace: Remove trace.h from hw/usb/hcd-ehci.h (less dependencies)

From: Stefan Weil <[email protected]>

This reduces the dependencies on trace.h.
Only one source file which needs hcd-ehci.h also needs trace.h.

---
 hw/usb/hcd-ehci.c |    1 +
 hw/usb/hcd-ehci.h |    1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
hw/usb/hcd-ehci.c +1 -0
index 22bdbf4..0ba38c9 100644
@@ -28,6 +28,7 @@
  */
 
 #include "hw/usb/hcd-ehci.h"
+#include "trace.h"
 
 /* Capability Registers Base Address - section 2.2 */
 #define CAPLENGTH        0x0000  /* 1-byte, 0x0001 reserved */
hw/usb/hcd-ehci.h +0 -1
index 065c9fa..1ad4b96 100644
@@ -21,7 +21,6 @@
 #include "qemu/timer.h"
 #include "hw/usb.h"
 #include "monitor/monitor.h"
-#include "trace.h"
 #include "sysemu/dma.h"
 #include "sysemu/sysemu.h"
 #include "hw/pci/pci.h"
Signature · 1 line
1.7.10.4
#2 lore raw

[Qemu-devel] [PULL 05/14] .gitignore: Ignore config.status

In reply to Michael Tokarev

From: Fam Zheng <[email protected]>

---
 .gitignore |    1 +
 1 file changed, 1 insertion(+)
.gitignore +1 -0
index 5584b5f..1c9d63d 100644
@@ -3,6 +3,7 @@ config-all-devices.*
 config-all-disas.*
 config-host.*
 config-target.*
+config.status
 trace/generated-tracers.h
 trace/generated-tracers.c
 trace/generated-tracers-dtrace.h
Signature · 1 line
1.7.10.4
#3 lore raw

[Qemu-devel] [PULL 03/14] console: Replace conditional debug messages by trace methods

In reply to Michael Tokarev

From: Stefan Weil <[email protected]>

---
 trace-events |    2 ++
 ui/console.c |   11 +++--------
 2 files changed, 5 insertions(+), 8 deletions(-)
trace-events +2 -0
index 8695e9e..d196234 100644
@@ -1010,6 +1010,8 @@ dma_map_wait(void *dbs) "dbs=%p"
 
 # ui/console.c
 console_gfx_new(void) ""
+console_putchar_csi(int esc_param0, int esc_param1, int ch, int nb_esc_params) "escape sequence CSI%d;%d%c, %d parameters"
+console_putchar_unhandled(int ch) "unhandled escape character '%c'"
 console_txt_new(int w, int h) "%dx%d"
 console_select(int nr) "%d"
 console_refresh(int interval) "interval %d ms"
ui/console.c +3 -8
index 61ed219..586fc6d 100644
@@ -29,7 +29,6 @@
 #include "sysemu/char.h"
 #include "trace.h"
 
-//#define DEBUG_CONSOLE
 #define DEFAULT_BACKSCROLL 512
 #define MAX_CONSOLES 12
 #define CONSOLE_CURSOR_PERIOD 500
@@ -867,10 +866,8 @@ static void console_putchar(QemuConsole *s, int ch)
                 s->nb_esc_params++;
             if (ch == ';')
                 break;
-#ifdef DEBUG_CONSOLE
-            fprintf(stderr, "escape sequence CSI%d;%d%c, %d parameters\n",
-                    s->esc_params[0], s->esc_params[1], ch, s->nb_esc_params);
-#endif
+            trace_console_putchar_csi(s->esc_params[0], s->esc_params[1],
+                                      ch, s->nb_esc_params);
             s->state = TTY_STATE_NORM;
             switch(ch) {
             case 'A':
@@ -984,9 +981,7 @@ static void console_putchar(QemuConsole *s, int ch)
                 s->y = s->y_saved;
                 break;
             default:
-#ifdef DEBUG_CONSOLE
-                fprintf(stderr, "unhandled escape character '%c'\n", ch);
-#endif
+                trace_console_putchar_unhandled(ch);
                 break;
             }
             break;
Signature · 1 line
1.7.10.4
#4 lore raw

[Qemu-devel] [PULL 01/14] trace: Remove trace.h from console.h (less dependencies)

In reply to Michael Tokarev

From: Stefan Weil <[email protected]>

This reduces the dependencies on trace.h.
Only two source files which need console.h also need trace.h.

---
 hw/display/vmware_vga.c |    1 +
 include/ui/console.h    |    1 -
 ui/console.c            |    1 +
 3 files changed, 2 insertions(+), 1 deletion(-)
hw/display/vmware_vga.c +1 -0
index a6a8cdc..aba292c 100644
@@ -23,6 +23,7 @@
  */
 #include "hw/hw.h"
 #include "hw/loader.h"
+#include "trace.h"
 #include "ui/console.h"
 #include "hw/pci/pci.h"
 
include/ui/console.h +0 -1
index 98edf41..4156a87 100644
@@ -6,7 +6,6 @@
 #include "qapi/qmp/qdict.h"
 #include "qemu/notify.h"
 #include "monitor/monitor.h"
-#include "trace.h"
 #include "qapi-types.h"
 #include "qapi/error.h"
 
ui/console.c +1 -0
index 199ba69..61ed219 100644
@@ -27,6 +27,7 @@
 #include "qemu/timer.h"
 #include "qmp-commands.h"
 #include "sysemu/char.h"
+#include "trace.h"
 
 //#define DEBUG_CONSOLE
 #define DEFAULT_BACKSCROLL 512
Signature · 1 line
1.7.10.4
#5 lore raw

[Qemu-devel] [PULL 04/14] gtk: Replace conditional debug messages by trace methods

In reply to Michael Tokarev

From: Stefan Weil <[email protected]>

---
 trace-events |    5 +++++
 ui/gtk.c     |   19 +++++--------------
 2 files changed, 10 insertions(+), 14 deletions(-)
trace-events +5 -0
index d196234..bc6788f 100644
@@ -1022,6 +1022,11 @@ displaychangelistener_register(void *dcl, const char *name) "%p [ %s ]"
 displaychangelistener_unregister(void *dcl, const char *name) "%p [ %s ]"
 ppm_save(const char *filename, void *display_surface) "%s surface=%p"
 
+# ui/gtk.c
+gd_switch(int width, int height) "width=%d, height=%d"
+gd_update(int x, int y, int w, int h) "x=%d, y=%d, w=%d, h=%d"
+gd_key_event(int gdk_keycode, int qemu_keycode, const char *action) "translated GDK keycode %d to QEMU keycode %d (%s)"
+
 # hw/display/vmware_vga.c
 vmware_value_read(uint32_t index, uint32_t value) "index %d, value 0x%x"
 vmware_value_write(uint32_t index, uint32_t value) "index %d, value 0x%x"
ui/gtk.c +5 -14
index b5f4f0b..6316f5b 100644
@@ -53,6 +53,7 @@
 #include <vte/vte.h>
 #include <math.h>
 
+#include "trace.h"
 #include "ui/console.h"
 #include "sysemu/sysemu.h"
 #include "qmp-commands.h"
@@ -60,14 +61,6 @@
 #include "keymaps.h"
 #include "sysemu/char.h"
 
-//#define DEBUG_GTK
-
-#ifdef DEBUG_GTK
-#define DPRINTF(fmt, ...) printf(fmt, ## __VA_ARGS__)
-#else
-#define DPRINTF(fmt, ...) do { } while (0)
-#endif
-
 #define MAX_VCS 10
 
 
@@ -302,7 +295,7 @@ static void gd_update(DisplayChangeListener *dcl,
     int fbw, fbh;
     int ww, wh;
 
-    DPRINTF("update(x=%d, y=%d, w=%d, h=%d)\n", x, y, w, h);
+    trace_gd_update(x, y, w, h);
 
     if (s->convert) {
         pixman_image_composite(PIXMAN_OP_SRC, s->ds->image, NULL, s->convert,
@@ -396,8 +389,7 @@ static void gd_switch(DisplayChangeListener *dcl,
     GtkDisplayState *s = container_of(dcl, GtkDisplayState, dcl);
     bool resized = true;
 
-    DPRINTF("resize(width=%d, height=%d)\n",
-            surface_width(surface), surface_height(surface));
+    trace_gd_switch(surface_width(surface), surface_height(surface));
 
     if (s->surface) {
         cairo_surface_destroy(s->surface);
@@ -732,9 +724,8 @@ static gboolean gd_key_event(GtkWidget *widget, GdkEventKey *key, void *opaque)
         qemu_keycode = 0;
     }
 
-    DPRINTF("translated GDK keycode %d to QEMU keycode %d (%s)\n",
-            gdk_keycode, qemu_keycode,
-            (key->type == GDK_KEY_PRESS) ? "down" : "up");
+    trace_gd_key_event(gdk_keycode, qemu_keycode,
+                       (key->type == GDK_KEY_PRESS) ? "down" : "up");
 
     for (i = 0; i < ARRAY_SIZE(modifier_keycode); i++) {
         if (qemu_keycode == modifier_keycode[i]) {
Signature · 1 line
1.7.10.4
#6 lore raw

[Qemu-devel] [PULL 12/14] Don't crash on keyboard input with no handler

In reply to Michael Tokarev

From: Don Koch <[email protected]>

Prevent a call to put_kbd if null.

On shutdown of some OSes, the keyboard handler goes away before the system is down. If a key is typed during this window, qemu crashes.

---
 ui/input.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ui/input.c +1 -1
index 10d8c05..1c70f60 100644
@@ -414,7 +414,7 @@ void kbd_put_keycode(int keycode)
     if (!runstate_is_running() && !runstate_check(RUN_STATE_SUSPENDED)) {
         return;
     }
-    if (entry) {
+    if (entry && entry->put_kbd) {
         entry->put_kbd(entry->opaque, keycode);
     }
 }
Signature · 1 line
1.7.10.4
#7 lore raw

[Qemu-devel] [PULL 10/14] libcacard/cac: Remove unused statement (value stored is never read)

In reply to Michael Tokarev

From: Stefan Weil <[email protected]>

Warning from ccc-analyzer:

libcacard/cac.c:192:13: warning: Value stored to 'ret' is never read

            ret = VCARD_DONE;
            ^     ~~~~~~~~~~

Here 'ret' is assigned a value inside of a switch statement and also after that switch statement.

---
 libcacard/cac.c |    1 -
 1 file changed, 1 deletion(-)
libcacard/cac.c +0 -1
index 7a06b5a..74ef3e3 100644
@@ -189,7 +189,6 @@ cac_applet_pki_process_apdu(VCard *card, VCardAPDU *apdu,
             pki_applet->sign_buffer = sign_buffer;
             pki_applet->sign_buffer_len = size;
             *response = vcard_make_response(VCARD7816_STATUS_SUCCESS);
-            ret = VCARD_DONE;
             break;
         case 0x00:
             /* we now have the whole buffer, do the operation, result will be
Signature · 1 line
1.7.10.4
#8 lore raw

[Qemu-devel] [PULL 11/14] libcacard/vcard_emul_nss: Remove unused statement (value stored is never read)

In reply to Michael Tokarev

From: Stefan Weil <[email protected]>

Warning from ccc-analyzer:

libcacard/vcard_emul_nss.c:937:9: warning:
Value stored to 'cert_count' is never read

        cert_count = options->vreader[i].cert_count;
        ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
 libcacard/vcard_emul_nss.c |    1 -
 1 file changed, 1 deletion(-)
libcacard/vcard_emul_nss.c +0 -1
index fb429b1..ee2dfae 100644
@@ -934,7 +934,6 @@ vcard_emul_init(const VCardEmulOptions *options)
         vreader = vreader_new(options->vreader[i].vname, vreader_emul,
                               vreader_emul_delete);
         vreader_add_reader(vreader);
-        cert_count = options->vreader[i].cert_count;
 
         vcard_emul_alloc_arrays(&certs, &cert_len, &keys,
                                 options->vreader[i].cert_count);
Signature · 1 line
1.7.10.4
#9 lore raw

[Qemu-devel] [PULL 14/14] eeprom93xx: fix coding style

In reply to Michael Tokarev

From: Antony Pavlov <[email protected]>

scripts/checkpatch.pl reports about some style problems, this commit fixes some of them:

ERROR: space prohibited before open square bracket '['
+ .fields = (VMStateField []) {

ERROR: space prohibited after that '!' (ctx:BxW)

+    if (! eeprom->eecs && eecs) {
         ^

ERROR: space prohibited after that '!' (ctx:WxW)

+    } else if (eeprom->eecs && ! eecs) {
                                ^

ERROR: space prohibited after that '!' (ctx:WxW)

+    } else if (eecs && ! eeprom->eesk && eesk) {
                        ^

ERROR: switch and case should be at the same indent

                     switch (address >> (eeprom->addrbits - 2)) {

+ case 0:
[...]
+ case 1:
[...]
+ case 2:
[...]
+ case 3:

ERROR: return is not a function, parentheses are not required
+ return (eeprom->eedo);

ERROR: switch and case should be at the same indent

     switch (nwords) {

+ case 16:
+ case 64:
[...]
+ case 128:
+ case 256:
[...]
+ default:

---
 hw/nvram/eeprom93xx.c |   62 ++++++++++++++++++++++++-------------------------
 1 file changed, 31 insertions(+), 31 deletions(-)
hw/nvram/eeprom93xx.c +31 -31
index 08f4df5..a98f924 100644
@@ -126,7 +126,7 @@ static const VMStateDescription vmstate_eeprom = {
     .version_id = EEPROM_VERSION,
     .minimum_version_id = OLD_EEPROM_VERSION,
     .minimum_version_id_old = OLD_EEPROM_VERSION,
-    .fields      = (VMStateField []) {
+    .fields      = (VMStateField[]) {
         VMSTATE_UINT8(tick, eeprom_t),
         VMSTATE_UINT8(address, eeprom_t),
         VMSTATE_UINT8(command, eeprom_t),
@@ -157,13 +157,13 @@ void eeprom93xx_write(eeprom_t *eeprom, int eecs, int eesk, int eedi)
     logout("CS=%u SK=%u DI=%u DO=%u, tick = %u\n",
            eecs, eesk, eedi, eedo, tick);
 
-    if (! eeprom->eecs && eecs) {
+    if (!eeprom->eecs && eecs) {
         /* Start chip select cycle. */
         logout("Cycle start, waiting for 1st start bit (0)\n");
         tick = 0;
         command = 0x0;
         address = 0x0;
-    } else if (eeprom->eecs && ! eecs) {
+    } else if (eeprom->eecs && !eecs) {
         /* End chip select cycle. This triggers write / erase. */
         if (eeprom->writable) {
             uint8_t subcommand = address >> (eeprom->addrbits - 2);
@@ -189,7 +189,7 @@ void eeprom93xx_write(eeprom_t *eeprom, int eecs, int eesk, int eedi)
         }
         /* Output DO is tristate, read results in 1. */
         eedo = 1;
-    } else if (eecs && ! eeprom->eesk && eesk) {
+    } else if (eecs && !eeprom->eesk && eesk) {
         /* Raising edge of clock shifts data in. */
         if (tick == 0) {
             /* Wait for 1st start bit. */
@@ -230,20 +230,20 @@ void eeprom93xx_write(eeprom_t *eeprom, int eecs, int eesk, int eedi)
                 if (command == 0) {
                     /* Command code in upper 2 bits of address. */
                     switch (address >> (eeprom->addrbits - 2)) {
-                        case 0:
-                            logout("write disable command\n");
-                            eeprom->writable = 0;
-                            break;
-                        case 1:
-                            logout("write all command\n");
-                            break;
-                        case 2:
-                            logout("erase all command\n");
-                            break;
-                        case 3:
-                            logout("write enable command\n");
-                            eeprom->writable = 1;
-                            break;
+                    case 0:
+                        logout("write disable command\n");
+                        eeprom->writable = 0;
+                        break;
+                    case 1:
+                        logout("write all command\n");
+                        break;
+                    case 2:
+                        logout("erase all command\n");
+                        break;
+                    case 3:
+                        logout("write enable command\n");
+                        eeprom->writable = 1;
+                        break;
                     }
                 } else {
                     /* Read, write or erase word. */
@@ -276,7 +276,7 @@ uint16_t eeprom93xx_read(eeprom_t *eeprom)
 {
     /* Return status of pin DO (0 or 1). */
     logout("CS=%u DO=%u\n", eeprom->eecs, eeprom->eedo);
-    return (eeprom->eedo);
+    return eeprom->eedo;
 }
 
 #if 0
@@ -296,18 +296,18 @@ eeprom_t *eeprom93xx_new(DeviceState *dev, uint16_t nwords)
     uint8_t addrbits;
 
     switch (nwords) {
-        case 16:
-        case 64:
-            addrbits = 6;
-            break;
-        case 128:
-        case 256:
-            addrbits = 8;
-            break;
-        default:
-            assert(!"Unsupported EEPROM size, fallback to 64 words!");
-            nwords = 64;
-            addrbits = 6;
+    case 16:
+    case 64:
+        addrbits = 6;
+        break;
+    case 128:
+    case 256:
+        addrbits = 8;
+        break;
+    default:
+        assert(!"Unsupported EEPROM size, fallback to 64 words!");
+        nwords = 64;
+        addrbits = 6;
     }
 
     eeprom = (eeprom_t *)g_malloc0(sizeof(*eeprom) + nwords * 2);
Signature · 1 line
1.7.10.4
#10 lore raw

[Qemu-devel] [PULL 08/14] misc: Replace 'struct QEMUTimer' by 'QEMUTimer'

In reply to Michael Tokarev

From: Stefan Weil <[email protected]>

Most code already used QEMUTimer without the redundant 'struct' keyword.

---
 hw/char/cadence_uart.c   |    4 ++--
 hw/ppc/ppc.c             |    6 +++---
 hw/ppc/ppc405_uc.c       |    2 +-
 hw/ppc/ppc_booke.c       |    4 ++--
 hw/timer/m48t59.c        |    4 ++--
 include/hw/char/serial.h |    4 ++--
 include/hw/ppc/ppc.h     |    4 ++--
 target-alpha/cpu-qom.h   |    2 +-
 target-mips/cpu.h        |    2 +-
 target-openrisc/cpu.h    |    2 +-
 target-sparc/cpu.h       |    2 +-
 ui/console.c             |    2 +-
 12 files changed, 19 insertions(+), 19 deletions(-)
hw/char/cadence_uart.c +2 -2
index f8ccbdd..f18db53 100644
@@ -120,8 +120,8 @@ typedef struct {
     uint64_t char_tx_time;
     CharDriverState *chr;
     qemu_irq irq;
-    struct QEMUTimer *fifo_trigger_handle;
-    struct QEMUTimer *tx_time_handle;
+    QEMUTimer *fifo_trigger_handle;
+    QEMUTimer *tx_time_handle;
 } UartState;
 
 static void uart_update_status(UartState *s)
hw/ppc/ppc.c +3 -3
index bf2d3d4..114be64 100644
@@ -684,7 +684,7 @@ static inline void cpu_ppc_hdecr_excp(PowerPCCPU *cpu)
 }
 
 static void __cpu_ppc_store_decr(PowerPCCPU *cpu, uint64_t *nextp,
-                                 struct QEMUTimer *timer,
+                                 QEMUTimer *timer,
                                  void (*raise_excp)(PowerPCCPU *),
                                  uint32_t decr, uint32_t value,
                                  int is_excp)
@@ -856,9 +856,9 @@ typedef struct ppc40x_timer_t ppc40x_timer_t;
 struct ppc40x_timer_t {
     uint64_t pit_reload;  /* PIT auto-reload value        */
     uint64_t fit_next;    /* Tick for next FIT interrupt  */
-    struct QEMUTimer *fit_timer;
+    QEMUTimer *fit_timer;
     uint64_t wdt_next;    /* Tick for next WDT interrupt  */
-    struct QEMUTimer *wdt_timer;
+    QEMUTimer *wdt_timer;
 
     /* 405 have the PIT, 440 have a DECR.  */
     unsigned int decr_excp;
hw/ppc/ppc405_uc.c +1 -1
index 6d6a7f1..8109f92 100644
@@ -1234,7 +1234,7 @@ struct ppc4xx_gpt_t {
     MemoryRegion iomem;
     int64_t tb_offset;
     uint32_t tb_freq;
-    struct QEMUTimer *timer;
+    QEMUTimer *timer;
     qemu_irq irqs[5];
     uint32_t oe;
     uint32_t ol;
hw/ppc/ppc_booke.c +2 -2
index b421620..d839960 100644
@@ -64,10 +64,10 @@ typedef struct booke_timer_t booke_timer_t;
 struct booke_timer_t {
 
     uint64_t fit_next;
-    struct QEMUTimer *fit_timer;
+    QEMUTimer *fit_timer;
 
     uint64_t wdt_next;
-    struct QEMUTimer *wdt_timer;
+    QEMUTimer *wdt_timer;
 
     uint32_t flags;
 };
hw/timer/m48t59.c +2 -2
index d3d78ec..be0592b 100644
@@ -61,8 +61,8 @@ struct M48t59State {
     time_t   stop_time;
     /* Alarm & watchdog */
     struct tm alarm;
-    struct QEMUTimer *alrm_timer;
-    struct QEMUTimer *wd_timer;
+    QEMUTimer *alrm_timer;
+    QEMUTimer *wd_timer;
     /* NVRAM storage */
     uint8_t *buffer;
     /* Model parameters */
include/hw/char/serial.h +2 -2
index 85f58ac..f431764 100644
@@ -65,13 +65,13 @@ struct SerialState {
     /* Interrupt trigger level for recv_fifo */
     uint8_t recv_fifo_itl;
 
-    struct QEMUTimer *fifo_timeout_timer;
+    QEMUTimer *fifo_timeout_timer;
     int timeout_ipending;           /* timeout interrupt pending state */
 
     uint64_t char_transmit_time;    /* time to transmit a char in ticks */
     int poll_msl;
 
-    struct QEMUTimer *modem_status_poll;
+    QEMUTimer *modem_status_poll;
     MemoryRegion io;
 };
 
include/hw/ppc/ppc.h +2 -2
index 132ab97..835418a 100644
@@ -24,10 +24,10 @@ struct ppc_tb_t {
     /* Decrementer management */
     uint64_t decr_next;    /* Tick for next decr interrupt    */
     uint32_t decr_freq;    /* decrementer frequency           */
-    struct QEMUTimer *decr_timer;
+    QEMUTimer *decr_timer;
     /* Hypervisor decrementer management */
     uint64_t hdecr_next;    /* Tick for next hdecr interrupt  */
-    struct QEMUTimer *hdecr_timer;
+    QEMUTimer *hdecr_timer;
     uint64_t purr_load;
     uint64_t purr_start;
     void *opaque;
target-alpha/cpu-qom.h +1 -1
index 2ebc9bc..198f1b1 100644
@@ -62,7 +62,7 @@ typedef struct AlphaCPU {
     CPUAlphaState env;
 
     /* This alarm doesn't exist in real hardware; we wish it did.  */
-    struct QEMUTimer *alarm_timer;
+    QEMUTimer *alarm_timer;
 } AlphaCPU;
 
 static inline AlphaCPU *alpha_env_get_cpu(CPUAlphaState *env)
target-mips/cpu.h +1 -1
index a29c82f..9caf447 100644
@@ -476,7 +476,7 @@ struct CPUMIPSState {
 
     const mips_def_t *cpu_model;
     void *irq[8];
-    struct QEMUTimer *timer; /* Internal timer */
+    QEMUTimer *timer; /* Internal timer */
 };
 
 #include "cpu-qom.h"
target-openrisc/cpu.h +1 -1
index 0f9efdf..51d6afd 100644
@@ -307,7 +307,7 @@ typedef struct CPUOpenRISCState {
 #ifndef CONFIG_USER_ONLY
     CPUOpenRISCTLBContext * tlb;
 
-    struct QEMUTimer *timer;
+    QEMUTimer *timer;
     uint32_t ttmr;          /* Timer tick mode register */
     uint32_t ttcr;          /* Timer tick count register */
 
target-sparc/cpu.h +1 -1
index 41194ec..c519063 100644
@@ -370,7 +370,7 @@ struct CPUTimer
     uint32_t    disabled;
     uint64_t    disabled_mask;
     int64_t     clock_offset;
-    struct QEMUTimer  *qtimer;
+    QEMUTimer  *qtimer;
 };
 
 typedef struct CPUTimer CPUTimer;
ui/console.c +1 -1
index 586fc6d..502e160 100644
@@ -161,7 +161,7 @@ struct QemuConsole {
 };
 
 struct DisplayState {
-    struct QEMUTimer *gui_timer;
+    QEMUTimer *gui_timer;
     uint64_t last_update;
     uint64_t update_interval;
     bool refreshing;
Signature · 1 line
1.7.10.4
#11 lore raw

[Qemu-devel] [PULL 13/14] hw/ppc/mac.h: remove unused BIOS_FILENAME definition

In reply to Michael Tokarev

This definition has been moved to prep.c.

---
 hw/ppc/mac.h |    1 -
 1 file changed, 1 deletion(-)
hw/ppc/mac.h +0 -1
index 1e578dd..c1faf9c 100644
@@ -34,7 +34,6 @@
 #define MAX_CPUS 1
 
 #define BIOS_SIZE     (1024 * 1024)
-#define BIOS_FILENAME "ppc_rom.bin"
 #define NVRAM_SIZE        0x2000
 #define PROM_FILENAME    "openbios-ppc"
 #define PROM_ADDR         0xfff00000
Signature · 1 line
1.7.10.4
#12 lore raw

[Qemu-devel] [PULL 06/14] acpi-build: Fix compiler warning (missing gnu_printf format attribute)

In reply to Michael Tokarev

From: Stefan Weil <[email protected]>

gcc 4.8.2 reports this warning when extra warnings are enabled (-Wextra):

CC m68k-softmmu/hw/m68k/mcf5206.o
hw/i386/acpi-build.c: In function ‘build_append_nameseg’:
hw/i386/acpi-build.c:294:5: error:
function might be possible candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format]

     g_string_vprintf(s, format, args);
     ^

When this warning is fixed, there is a new compiler warning:

CC i386-softmmu/hw/i386/acpi-build.o
hw/i386/acpi-build.c: In function ‘build_append_notify’:
hw/i386/acpi-build.c:632:5: error:
format not a string literal and no format arguments [-Werror=format-security]

     build_append_nameseg(method, name);
     ^

This is fixed here, too.

---
 hw/i386/acpi-build.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
hw/i386/acpi-build.c +3 -2
index 1f22fb6..befc39f 100644
@@ -285,7 +285,8 @@ static inline void build_append_array(GArray *array, GArray *val)
     g_array_append_vals(array, val->data, val->len);
 }
 
-static void build_append_nameseg(GArray *array, const char *format, ...)
+static void GCC_FMT_ATTR(2, 3)
+build_append_nameseg(GArray *array, const char *format, ...)
 {
     /* It would be nicer to use g_string_vprintf but it's only there in 2.22 */
     char s[] = "XXXX";
@@ -630,7 +631,7 @@ build_append_notify(GArray *device, const char *name,
     GArray *method = build_alloc_array();
     uint8_t op = 0x14; /* MethodOp */
 
-    build_append_nameseg(method, name);
+    build_append_nameseg(method, "%s", name);
     build_append_byte(method, 0x02); /* MethodFlags: ArgCount */
     for (i = skip; i < count; i++) {
         GArray *target = build_alloc_array();
Signature · 1 line
1.7.10.4
#13 lore raw

[Qemu-devel] [PULL 07/14] qobject: Fix compiler warning (missing gnu_printf format attribute)

In reply to Michael Tokarev

From: Stefan Weil <[email protected]>

gcc 4.8.2 reports this warning when extra warnings are enabled (-Wextra):

CC qobject/qerror.o
qobject/qerror.c: In function ‘qerror_from_info’:
qobject/qerror.c:53:5: error:
function might be possible candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format]

     qerr->err_msg = g_strdup_vprintf(fmt, *va);
     ^
---
 qobject/qerror.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
qobject/qerror.c +2 -2
index 3aee1cf..fc8331a 100644
@@ -42,8 +42,8 @@ static QError *qerror_new(void)
  *
  * Return strong reference.
  */
-static QError *qerror_from_info(ErrorClass err_class, const char *fmt,
-                                va_list *va)
+static QError * GCC_FMT_ATTR(2, 0)
+qerror_from_info(ErrorClass err_class, const char *fmt, va_list *va)
 {
     QError *qerr;
 
Signature · 1 line
1.7.10.4
#14 lore raw

[Qemu-devel] [PULL 09/14] virtio-net: fix the indent

In reply to Michael Tokarev

From: Zhi Yong Wu <[email protected]>

---
 hw/net/virtio-net.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/net/virtio-net.c +1 -1
index b75c753..90eca9a 100644
@@ -1428,7 +1428,7 @@ static NetClientInfo net_virtio_info = {
     .size = sizeof(NICState),
     .can_receive = virtio_net_can_receive,
     .receive = virtio_net_receive,
-        .cleanup = virtio_net_cleanup,
+    .cleanup = virtio_net_cleanup,
     .link_status_changed = virtio_net_set_link_status,
     .query_rx_filter = virtio_net_query_rxfilter,
 };
Signature · 1 line
1.7.10.4