Skip to contentSkip to conversation

Trivial patches for 2015-06-03

GIT PULL Applied Michael Tokarev 2 participants 32 messages Jun 3, 2015 – Jun 4, 2015

Subsystems (4)
lore
Share & tools
lore
#1 lore raw

[Qemu-devel] [PULL 10/30] hw/alpha/dp264.c: Fix memory leak spotted by valgrind

In reply to Michael Tokarev

From: Shannon Zhao <[email protected]>

valgrind complains about:
==7055== 58 bytes in 1 blocks are definitely lost in loss record 1,471 of 2,192

==7055==    at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==7055==    by 0x24410F: malloc_and_trace (vl.c:2556)
==7055==    by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3)
==7055==    by 0x64DEFD7: g_strndup (in /usr/lib64/libglib-2.0.so.0.3600.3)
==7055==    by 0x650181A: g_vasprintf (in /usr/lib64/libglib-2.0.so.0.3600.3)
==7055==    by 0x64DF0CC: g_strdup_vprintf (in /usr/lib64/libglib-2.0.so.0.3600.3)
==7055==    by 0x64DF188: g_strdup_printf (in /usr/lib64/libglib-2.0.so.0.3600.3)
==7055==    by 0x242F81: qemu_find_file (vl.c:2121)
==7055==    by 0x217A32: clipper_init (dp264.c:105)
==7055==    by 0x2484DA: main (vl.c:4249)
---
 hw/alpha/dp264.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
hw/alpha/dp264.c +4 -3
index 9fe7e8b..f86e7bb 100644
@@ -55,7 +55,7 @@ static void clipper_init(MachineState *machine)
     ISABus *isa_bus;
     qemu_irq rtc_irq;
     long size, i;
-    const char *palcode_filename;
+    char *palcode_filename;
     uint64_t palcode_entry, palcode_low, palcode_high;
     uint64_t kernel_entry, kernel_low, kernel_high;
 
@@ -101,8 +101,8 @@ static void clipper_init(MachineState *machine)
     /* Load PALcode.  Given that this is not "real" cpu palcode,
        but one explicitly written for the emulation, we might as
        well load it directly from and ELF image.  */
-    palcode_filename = (bios_name ? bios_name : "palcode-clipper");
-    palcode_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, palcode_filename);
+    palcode_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS,
+                                bios_name ? bios_name : "palcode-clipper");
     if (palcode_filename == NULL) {
         hw_error("no palcode provided\n");
         exit(1);
@@ -114,6 +114,7 @@ static void clipper_init(MachineState *machine)
         hw_error("could not load palcode '%s'\n", palcode_filename);
         exit(1);
     }
+    g_free(palcode_filename);
 
     /* Start all cpus at the PALcode RESET entry point.  */
     for (i = 0; i < smp_cpus; ++i) {
Signature · 1 line
2.1.4
#2 lore raw

[Qemu-devel] [PULL 07/30] hw/i386/acpi-build: decref after use

In reply to Michael Tokarev

From: Shannon Zhao <[email protected]>

valgrind complains about:
==16447== 48 bytes in 2 blocks are definitely lost in loss record 2,033 of 3,310

==16447==    at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==16447==    by 0x2E4FD7: malloc_and_trace (vl.c:2546)
==16447==    by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3)
==16447==    by 0x53EC3F: qint_from_int (qint.c:33)
==16447==    by 0x53B426: qmp_output_type_int (qmp-output-visitor.c:162)
==16447==    by 0x539257: visit_type_uint32 (qapi-visit-core.c:147)
==16447==    by 0x471D07: property_get_uint32_ptr (object.c:1651)
==16447==    by 0x47000C: object_property_get (object.c:822)
==16447==    by 0x472428: object_property_get_qobject (qom-qobject.c:37)
==16447==    by 0x25701A: build_append_pci_bus_devices (acpi-build.c:520)
==16447==    by 0x25902E: build_ssdt (acpi-build.c:1004)
==16447==    by 0x25A0A8: acpi_build (acpi-build.c:1420)
---
 hw/i386/acpi-build.c | 1 +
 1 file changed, 1 insertion(+)
hw/i386/acpi-build.c +1 -0
index 2c7399b..15fd4c5 100644
@@ -596,6 +596,7 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus,
         }
     }
     aml_append(parent_scope, method);
+    qobject_decref(bsel);
 }
 
 static void
Signature · 1 line
2.1.4
#0 lore raw

Here's another trivial-patches pull request.

There are many patches in there this time, mostly due to work by Shannon Zhao, who has been busy chasing memory leaks all over the place. I haven't applied _all_ of his patches yes, there's one series pending with more complex patches around qemu_allocate_irqs(), these needs some more review.

There's also a fix for CVE-2015-4037 (predictable directory name in slirp smb code).

Please consider applying/pulling.

Thanks,

/mjt

The following changes since commit 42d58e7c6760cb9c55627c28ae538e27dcf2f144:

Merge remote-tracking branch 'remotes/sstabellini/tags/xen-15-06-02-tag' into staging (2015-06-02 16:47:31 +0100)

are available in the git repository at:

git://git.corpit.ru/qemu.git tags/pull-trivial-patches-2015-06-03

for you to fetch changes up to de3852877f1e452321352fdb7e678f079876a41b:

  configure: postfix --extra-cflags to QEMU_CFLAGS (2015-06-03 16:04:39 +0300)

----------------------------------------------------------------
trivial patches for 2015-06-03

----------------------------------------------------------------
Alex Bennée (1):

      configure: postfix --extra-cflags to QEMU_CFLAGS

Chen Hanxiao (1):
docs/writing-qmp-commands: fix a typo

Dr. David Alan Gilbert (1):
Add -incoming help text

Fam Zheng (1):
iscsi: Remove pointless runtime check of macro value

Michael Tokarev (1):
slirp: use less predictable directory name in /tmp for smb config (CVE-2015-4037)

Paolo Bonzini (1):
translate-all: delete prototype for non-existent function

Peter Crosthwaite (2):
microblaze: cpu: Delete MMAP_SHIFT definition
device-tree: Make a common-obj

Peter Krempa (1):
util: socket: Add missing localaddr and localport option for DGRAM socket

Sai Pavan Boddu (1):
cadence_gem: Fix Rx buffer size field mask

Shannon Zhao (20):
hw/i386/pc_piix: Fix memory leak
hw/ide/pci: Fix memory leak
hw/i386/acpi-build: decref after use
vl: fix memory leak spotted by valgrind
hw/alpha/dp264.c: Fix memory leak spotted by valgrind hw/ppc/e500.c: Fix memory leak
hw/arm/omap_sx1.c: Fix memory leak spotted by valgrind hw/intc/exynos4210_gic.c: Fix memory leak by adjusting order hw/i386/pc: Fix misusing qemu_allocate_irqs for single irq hw/isa/lpc_ich9.c: Fix misusing qemu_allocate_irqs for single irq hw/isa/i82378.c: Fix misusing qemu_allocate_irqs for single irq hw/timer/arm_timer.c: Fix misusing qemu_allocate_irqs for single irq hw/sparc/sun4m.c: Fix misusing qemu_allocate_irqs for single irq hw/ppc/prep.c: Fix misusing qemu_allocate_irqs for single irq hw/lm32/lm32_boards.c: Fix misusing qemu_allocate_irqs for single irq hw/lm32/milkymist.c: Fix misusing qemu_allocate_irqs for single irq hw/unicore32/puv3.c: Fix misusing qemu_allocate_irqs for single irq hw/alpha/typhoon.c: Fix misusing qemu_allocate_irqs for single irq hw/arm/nseries.c: Fix misusing qemu_allocate_irqs for single irq hw/display/tc6393xb.c: Fix misusing qemu_allocate_irqs for single irq

 Makefile.objs                 |  2 ++
 Makefile.target               |  1 -
 block/iscsi.c                 |  7 -------
 configure                     |  2 +-
 device_tree.c                 |  1 -
 docs/writing-qmp-commands.txt |  2 +-
 hw/alpha/dp264.c              |  7 ++++---
 hw/alpha/typhoon.c            |  8 ++++----
 hw/arm/nseries.c              |  5 ++---
 hw/arm/omap_sx1.c             |  2 +-
 hw/display/tc6393xb.c         |  2 +-
 hw/i386/acpi-build.c          |  1 +
 hw/i386/pc.c                  |  4 ++--
 hw/i386/pc_piix.c             | 11 +++++------
 hw/i386/pc_q35.c              |  4 +---
 hw/ide/pci.c                  |  5 +----
 hw/intc/exynos4210_gic.c      |  7 +++----
 hw/isa/i82378.c               |  7 ++-----
 hw/isa/lpc_ich9.c             |  5 +----
 hw/lm32/lm32_boards.c         | 10 ++++------
 hw/lm32/milkymist.c           |  5 ++---
 hw/net/cadence_gem.c          |  2 +-
 hw/ppc/e500.c                 |  1 +
 hw/ppc/prep.c                 |  5 ++---
 hw/sparc/sun4m.c              |  6 ++----
 hw/timer/arm_timer.c          |  6 ++----
 hw/unicore32/puv3.c           |  8 ++++----
 include/hw/i386/pc.h          |  2 +-
 net/slirp.c                   |  7 +++----
 qemu-options.hx               |  9 ++++++++-
 target-microblaze/cpu.h       |  1 -
 translate-all.h               |  1 -
 util/qemu-sockets.c           |  6 ++++++
 vl.c                          |  5 +++--
 34 files changed, 71 insertions(+), 86 deletions(-)
#3 lore raw

[Qemu-devel] [PULL 03/30] util: socket: Add missing localaddr and localport option for DGRAM socket

From: Peter Krempa <[email protected]>

The 'socket_optslist' structure does not contain the 'localaddr' and 'localport' options that are parsed in case you are creating a 'connect' type UDP character device.

I've noticed it happening after commit f43e47dbf6de24db20ec9b588bb6cc762 made qemu abort() after seeing the invalid option.

A minimal reproducer for the case is:

$ qemu-system-x86_64 -chardev udp,id=charrng0,host=127.0.0.1,port=1234,localaddr=,localport=1234
qemu-system-x86_64: -chardev udp,id=charrng0,host=127.0.0.1,port=1234,localaddr=,localport=1234: Invalid parameter 'localaddr'
Aborted (core dumped)

Prior to the commit mentioned above the error would be printed but the value for localaddr and localport was simply ignored. I did not go through the code to find out when it was broken.

Add the two fields so that the options can again be parsed correctly and qemu doesn't abort().

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1220252

---
 util/qemu-sockets.c | 6 ++++++
 1 file changed, 6 insertions(+)
util/qemu-sockets.c +6 -0
index 22c8c4c..f9ad34e 100644
@@ -45,6 +45,12 @@ QemuOptsList socket_optslist = {
             .name = "port",
             .type = QEMU_OPT_STRING,
         },{
+            .name = "localaddr",
+            .type = QEMU_OPT_STRING,
+        },{
+            .name = "localport",
+            .type = QEMU_OPT_STRING,
+        },{
             .name = "to",
             .type = QEMU_OPT_NUMBER,
         },{
Signature · 1 line
2.1.4
#4 lore raw

[Qemu-devel] [PULL 05/30] hw/i386/pc_piix: Fix memory leak

In reply to Michael Tokarev

From: Shannon Zhao <[email protected]>

valgrind complains about:
==16447== 8 bytes in 1 blocks are definitely lost in loss record 552 of 3,310

==16447==    at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==16447==    by 0x2E4FD7: malloc_and_trace (vl.c:2546)
==16447==    by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3)
==16447==    by 0x36FB47: qemu_extend_irqs (irq.c:55)
==16447==    by 0x36FBD3: qemu_allocate_irqs (irq.c:64)
==16447==    by 0x24E622: pc_init1 (pc_piix.c:287)
==16447==    by 0x24E76A: pc_init_pci (pc_piix.c:310)
==16447==    by 0x2E9360: main (vl.c:4226)

==16447== 128 bytes in 1 blocks are definitely lost in loss record 2,569 of 3,310

==16447==    at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==16447==    by 0x2E4FD7: malloc_and_trace (vl.c:2546)
==16447==    by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3)
==16447==    by 0x36FB47: qemu_extend_irqs (irq.c:55)
==16447==    by 0x36FBD3: qemu_allocate_irqs (irq.c:64)
==16447==    by 0x25BEB2: kvm_i8259_init (i8259.c:133)
==16447==    by 0x24E1F1: pc_init1 (pc_piix.c:219)
==16447==    by 0x24E76A: pc_init_pci (pc_piix.c:310)
==16447==    by 0x2E9360: main (vl.c:4226)
---
 hw/i386/pc_piix.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
hw/i386/pc_piix.c +4 -3
index 6e7fa42..8d949a3 100644
@@ -89,7 +89,7 @@ static void pc_init1(MachineState *machine)
     qemu_irq *cpu_irq;
     qemu_irq *gsi;
     qemu_irq *i8259;
-    qemu_irq *smi_irq;
+    qemu_irq smi_irq;
     GSIState *gsi_state;
     DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
     BusState *idebus[MAX_IDE_BUS];
@@ -227,6 +227,7 @@ static void pc_init1(MachineState *machine)
     for (i = 0; i < ISA_NUM_IRQS; i++) {
         gsi_state->i8259_irq[i] = i8259[i];
     }
+    g_free(i8259);
     if (pci_enabled) {
         ioapic_init_gsi(gsi_state, "i440fx");
     }
@@ -284,10 +285,10 @@ static void pc_init1(MachineState *machine)
         DeviceState *piix4_pm;
         I2CBus *smbus;
 
-        smi_irq = qemu_allocate_irqs(pc_acpi_smi_interrupt, first_cpu, 1);
+        smi_irq = qemu_allocate_irq(pc_acpi_smi_interrupt, first_cpu, 0);
         /* TODO: Populate SPD eeprom data.  */
         smbus = piix4_pm_init(pci_bus, piix3_devfn + 3, 0xb100,
-                              gsi[9], *smi_irq,
+                              gsi[9], smi_irq,
                               kvm_enabled(), fw_cfg, &piix4_pm);
         smbus_eeprom_init(smbus, 8, NULL, 0);
 
Signature · 1 line
2.1.4
#5 lore raw

[Qemu-devel] [PULL 04/30] docs/writing-qmp-commands: fix a typo

In reply to Michael Tokarev

From: Chen Hanxiao <[email protected]>

s/interation/iteration

---
 docs/writing-qmp-commands.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
docs/writing-qmp-commands.txt +1 -1
index f3df206..ab1fdd3 100644
@@ -598,7 +598,7 @@ stored in its "value" member. In our example, the "value" member is a pointer
 to an TimerAlarmMethod instance.
 
 Notice that the "current" variable is used as "true" only in the first
-interation of the loop. That's because the alarm timer method in use is the
+iteration of the loop. That's because the alarm timer method in use is the
 first element of the alarm_timers array. Also notice that QAPI lists are handled
 by hand and we return the head of the list.
 
Signature · 1 line
2.1.4
#6 lore raw

[Qemu-devel] [PULL 28/30] slirp: use less predictable directory name in /tmp for smb config (CVE-2015-4037)

In reply to Michael Tokarev

In this version I used mkdtemp(3) which is:

        _BSD_SOURCE
        || /* Since glibc 2.10: */
            (_POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700)

(POSIX.1-2008), so should be available on systems we care about.

While at it, reset the resulting directory name within smb structure on error so cleanup function wont try to remove directory which we failed to create.

---
 net/slirp.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
net/slirp.c +3 -4
index 0e15cf6..3533837 100644
@@ -481,7 +481,6 @@ static void slirp_smb_cleanup(SlirpState *s)
 static int slirp_smb(SlirpState* s, const char *exported_dir,
                      struct in_addr vserver_addr)
 {
-    static int instance;
     char smb_conf[128];
     char smb_cmdline[128];
     struct passwd *passwd;
@@ -505,10 +504,10 @@ static int slirp_smb(SlirpState* s, const char *exported_dir,
         return -1;
     }
 
-    snprintf(s->smb_dir, sizeof(s->smb_dir), "/tmp/qemu-smb.%ld-%d",
-             (long)getpid(), instance++);
-    if (mkdir(s->smb_dir, 0700) < 0) {
+    snprintf(s->smb_dir, sizeof(s->smb_dir), "/tmp/qemu-smb.XXXXXX");
+    if (!mkdtemp(s->smb_dir)) {
         error_report("could not create samba server dir '%s'", s->smb_dir);
+        s->smb_dir[0] = 0;
         return -1;
     }
     snprintf(smb_conf, sizeof(smb_conf), "%s/%s", s->smb_dir, "smb.conf");
Signature · 1 line
2.1.4
#7 lore raw

[Qemu-devel] [PULL 17/30] hw/timer/arm_timer.c: Fix misusing qemu_allocate_irqs for single irq

In reply to Michael Tokarev

From: Shannon Zhao <[email protected]>

---
 hw/timer/arm_timer.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
hw/timer/arm_timer.c +2 -4
index 1452910..d53f39a 100644
@@ -280,14 +280,12 @@ static int sp804_init(SysBusDevice *sbd)
 {
     DeviceState *dev = DEVICE(sbd);
     SP804State *s = SP804(dev);
-    qemu_irq *qi;
 
-    qi = qemu_allocate_irqs(sp804_set_irq, s, 2);
     sysbus_init_irq(sbd, &s->irq);
     s->timer[0] = arm_timer_init(s->freq0);
     s->timer[1] = arm_timer_init(s->freq1);
-    s->timer[0]->irq = qi[0];
-    s->timer[1]->irq = qi[1];
+    s->timer[0]->irq = qemu_allocate_irq(sp804_set_irq, s, 0);
+    s->timer[1]->irq = qemu_allocate_irq(sp804_set_irq, s, 1);
     memory_region_init_io(&s->iomem, OBJECT(s), &sp804_ops, s,
                           "sp804", 0x1000);
     sysbus_init_mmio(sbd, &s->iomem);
Signature · 1 line
2.1.4
#8 lore raw

[Qemu-devel] [PULL 08/30] device-tree: Make a common-obj

In reply to Michael Tokarev

From: Peter Crosthwaite <[email protected]>

There is no reason for device tree API to be built per-target. common-obj it. There is an extraneous inclusion of config.h that needs to be removed.

---
 Makefile.objs   | 2 ++
 Makefile.target | 1 -
 device_tree.c   | 1 -
 3 files changed, 2 insertions(+), 2 deletions(-)
Makefile.objs +2 -0
index 28999d3..4881d2c 100644
@@ -76,6 +76,8 @@ common-obj-$(CONFIG_SECCOMP) += qemu-seccomp.o
 
 common-obj-$(CONFIG_SMARTCARD_NSS) += $(libcacard-y)
 
+common-obj-$(CONFIG_FDT) += device_tree.o
+
 ######################################################################
 # qapi
 
Makefile.target +0 -1
index be01dd3..3e861c8 100644
@@ -129,7 +129,6 @@ ifdef CONFIG_SOFTMMU
 obj-y += arch_init.o cpus.o monitor.o gdbstub.o balloon.o ioport.o numa.o
 obj-y += qtest.o bootdevice.o
 obj-y += hw/
-obj-$(CONFIG_FDT) += device_tree.o
 obj-$(CONFIG_KVM) += kvm-all.o
 obj-y += memory.o savevm.o cputlb.o
 obj-y += memory_mapping.o
device_tree.c +0 -1
index 3d119ef..d2de580 100644
@@ -18,7 +18,6 @@
 #include <unistd.h>
 #include <stdlib.h>
 
-#include "config.h"
 #include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "sysemu/device_tree.h"
Signature · 1 line
2.1.4
#9 lore raw

[Qemu-devel] [PULL 15/30] hw/isa/lpc_ich9.c: Fix misusing qemu_allocate_irqs for single irq

In reply to Michael Tokarev

From: Shannon Zhao <[email protected]>

Since ich9_lpc_pm_init only requests one irq, so let it just call qemu_allocate_irq.

---
 hw/isa/lpc_ich9.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
hw/isa/lpc_ich9.c +1 -4
index dba7585..144b210 100644
@@ -360,11 +360,8 @@ static void ich9_set_sci(void *opaque, int irq_num, int level)
 void ich9_lpc_pm_init(PCIDevice *lpc_pci)
 {
     ICH9LPCState *lpc = ICH9_LPC_DEVICE(lpc_pci);
-    qemu_irq *sci_irq;
-
-    sci_irq = qemu_allocate_irqs(ich9_set_sci, lpc, 1);
-    ich9_pm_init(lpc_pci, &lpc->pm, sci_irq[0]);
 
+    ich9_pm_init(lpc_pci, &lpc->pm, qemu_allocate_irq(ich9_set_sci, lpc, 0));
     ich9_lpc_reset(&lpc->d.qdev);
 }
 
Signature · 1 line
2.1.4
#10 lore raw

[Qemu-devel] [PULL 24/30] hw/arm/nseries.c: Fix misusing qemu_allocate_irqs for single irq

In reply to Michael Tokarev

From: Shannon Zhao <[email protected]>

---
 hw/arm/nseries.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
hw/arm/nseries.c +2 -3
index d243159..a659e85 100644
@@ -133,9 +133,8 @@ static void n800_mmc_cs_cb(void *opaque, int line, int level)
 
 static void n8x0_gpio_setup(struct n800_s *s)
 {
-    qemu_irq *mmc_cs = qemu_allocate_irqs(n800_mmc_cs_cb, s->mpu->mmc, 1);
-    qdev_connect_gpio_out(s->mpu->gpio, N8X0_MMC_CS_GPIO, mmc_cs[0]);
-
+    qdev_connect_gpio_out(s->mpu->gpio, N8X0_MMC_CS_GPIO,
+                          qemu_allocate_irq(n800_mmc_cs_cb, s->mpu->mmc, 0));
     qemu_irq_lower(qdev_get_gpio_in(s->mpu->gpio, N800_BAT_COVER_GPIO));
 }
 
Signature · 1 line
2.1.4
#11 lore raw

[Qemu-devel] [PULL 06/30] hw/ide/pci: Fix memory leak

In reply to Michael Tokarev

From: Shannon Zhao <[email protected]>

valgrind complains about:
==16447== 16 bytes in 2 blocks are definitely lost in loss record 1,304 of 3,310

==16447==    at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==16447==    by 0x2E4FD7: malloc_and_trace (vl.c:2546)
==16447==    by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3)
==16447==    by 0x36FB47: qemu_extend_irqs (irq.c:55)
==16447==    by 0x36FBD3: qemu_allocate_irqs (irq.c:64)
==16447==    by 0x3B4B44: bmdma_init (pci.c:464)
==16447==    by 0x3B547B: pci_piix_init_ports (piix.c:144)
==16447==    by 0x3B55D2: pci_piix_ide_realize (piix.c:164)
==16447==    by 0x3EAEC6: pci_qdev_realize (pci.c:1790)
==16447==    by 0x36C685: device_set_realized (qdev.c:1058)
==16447==    by 0x47179E: property_set_bool (object.c:1514)
==16447==    by 0x470098: object_property_set (object.c:837)
---
 hw/ide/pci.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
hw/ide/pci.c +1 -4
index 1b3d1c1..4b5e32d 100644
@@ -452,8 +452,6 @@ static const struct IDEDMAOps bmdma_ops = {
 
 void bmdma_init(IDEBus *bus, BMDMAState *bm, PCIIDEState *d)
 {
-    qemu_irq *irq;
-
     if (bus->dma == &bm->dma) {
         return;
     }
@@ -461,8 +459,7 @@ void bmdma_init(IDEBus *bus, BMDMAState *bm, PCIIDEState *d)
     bm->dma.ops = &bmdma_ops;
     bus->dma = &bm->dma;
     bm->irq = bus->irq;
-    irq = qemu_allocate_irqs(bmdma_irq, bm, 1);
-    bus->irq = *irq;
+    bus->irq = qemu_allocate_irq(bmdma_irq, bm, 0);
     bm->pci_dev = d;
 }
 
Signature · 1 line
2.1.4
#12 lore raw

[Qemu-devel] [PULL 25/30] hw/display/tc6393xb.c: Fix misusing qemu_allocate_irqs for single irq

In reply to Michael Tokarev

From: Shannon Zhao <[email protected]>

---
 hw/display/tc6393xb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/display/tc6393xb.c +1 -1
index 66b7ade..f5f3f3e 100644
@@ -571,7 +571,7 @@ TC6393xbState *tc6393xb_init(MemoryRegion *sysmem, uint32_t base, qemu_irq irq)
     s->irq = irq;
     s->gpio_in = qemu_allocate_irqs(tc6393xb_gpio_set, s, TC6393XB_GPIOS);
 
-    s->l3v = *qemu_allocate_irqs(tc6393xb_l3v, s, 1);
+    s->l3v = qemu_allocate_irq(tc6393xb_l3v, s, 0);
     s->blanked = 1;
 
     s->sub_irqs = qemu_allocate_irqs(tc6393xb_sub_irq, s, TC6393XB_NR_IRQS);
Signature · 1 line
2.1.4
#13 lore raw

[Qemu-devel] [PULL 22/30] hw/unicore32/puv3.c: Fix misusing qemu_allocate_irqs for single irq

In reply to Michael Tokarev

From: Shannon Zhao <[email protected]>

---
 hw/unicore32/puv3.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
hw/unicore32/puv3.c +4 -4
index cc9a21a..703e29d 100644
@@ -40,15 +40,15 @@ static void puv3_intc_cpu_handler(void *opaque, int irq, int level)
 
 static void puv3_soc_init(CPUUniCore32State *env)
 {
-    qemu_irq *cpu_intc, irqs[PUV3_IRQS_NR];
+    qemu_irq cpu_intc, irqs[PUV3_IRQS_NR];
     DeviceState *dev;
     MemoryRegion *i8042 = g_new(MemoryRegion, 1);
     int i;
 
     /* Initialize interrupt controller */
-    cpu_intc = qemu_allocate_irqs(puv3_intc_cpu_handler,
-                                  uc32_env_get_cpu(env), 1);
-    dev = sysbus_create_simple("puv3_intc", PUV3_INTC_BASE, *cpu_intc);
+    cpu_intc = qemu_allocate_irq(puv3_intc_cpu_handler,
+                                 uc32_env_get_cpu(env), 0);
+    dev = sysbus_create_simple("puv3_intc", PUV3_INTC_BASE, cpu_intc);
     for (i = 0; i < PUV3_IRQS_NR; i++) {
         irqs[i] = qdev_get_gpio_in(dev, i);
     }
Signature · 1 line
2.1.4
#14 lore raw

[Qemu-devel] [PULL 29/30] cadence_gem: Fix Rx buffer size field mask

In reply to Michael Tokarev

From: Sai Pavan Boddu <[email protected]>

This patch corrects the Rx buffer size field mask to mask bits 23 to 16 to match Xilinx UG585 documentation.

---
 hw/net/cadence_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/net/cadence_gem.c +1 -1
index dafe914..494a346 100644
@@ -155,7 +155,7 @@
 #define GEM_NWCFG_BCAST_REJ    0x00000020 /* Reject broadcast packets */
 #define GEM_NWCFG_PROMISC      0x00000010 /* Accept all packets */
 
-#define GEM_DMACFG_RBUFSZ_M    0x007F0000 /* DMA RX Buffer Size mask */
+#define GEM_DMACFG_RBUFSZ_M    0x00FF0000 /* DMA RX Buffer Size mask */
 #define GEM_DMACFG_RBUFSZ_S    16         /* DMA RX Buffer Size shift */
 #define GEM_DMACFG_RBUFSZ_MUL  64         /* DMA RX Buffer Size multiplier */
 #define GEM_DMACFG_TXCSUM_OFFL 0x00000800 /* Transmit checksum offload */
Signature · 1 line
2.1.4
#15 lore raw

[Qemu-devel] [PULL 18/30] hw/sparc/sun4m.c: Fix misusing qemu_allocate_irqs for single irq

In reply to Michael Tokarev

From: Shannon Zhao <[email protected]>

---
 hw/sparc/sun4m.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
hw/sparc/sun4m.c +2 -4
index a69bf2d..8a3599c 100644
@@ -897,7 +897,6 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
         espdma_irq, ledma_irq;
     qemu_irq esp_reset, dma_enable;
     qemu_irq fdc_tc;
-    qemu_irq *cpu_halt;
     unsigned long kernel_size;
     DriveInfo *fd[MAX_FD];
     FWCfgState *fw_cfg;
@@ -1024,9 +1023,8 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
     escc_init(hwdef->serial_base, slavio_irq[15], slavio_irq[15],
               serial_hds[0], serial_hds[1], ESCC_CLOCK, 1);
 
-    cpu_halt = qemu_allocate_irqs(cpu_halt_signal, NULL, 1);
     if (hwdef->apc_base) {
-        apc_init(hwdef->apc_base, cpu_halt[0]);
+        apc_init(hwdef->apc_base, qemu_allocate_irq(cpu_halt_signal, NULL, 0));
     }
 
     if (hwdef->fd_base) {
@@ -1036,7 +1034,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
         sun4m_fdctrl_init(slavio_irq[22], hwdef->fd_base, fd,
                           &fdc_tc);
     } else {
-        fdc_tc = *qemu_allocate_irqs(dummy_fdc_tc, NULL, 1);
+        fdc_tc = qemu_allocate_irq(dummy_fdc_tc, NULL, 0);
     }
 
     slavio_misc_init(hwdef->slavio_base, hwdef->aux1_base, hwdef->aux2_base,
Signature · 1 line
2.1.4
#16 lore raw

[Qemu-devel] [PULL 20/30] hw/lm32/lm32_boards.c: Fix misusing qemu_allocate_irqs for single irq

In reply to Michael Tokarev

From: Shannon Zhao <[email protected]>

---
 hw/lm32/lm32_boards.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
hw/lm32/lm32_boards.c +4 -6
index 14d0efc..70f48d3 100644
@@ -78,7 +78,7 @@ static void lm32_evr_init(MachineState *machine)
     DriveInfo *dinfo;
     MemoryRegion *address_space_mem =  get_system_memory();
     MemoryRegion *phys_ram = g_new(MemoryRegion, 1);
-    qemu_irq *cpu_irq, irq[32];
+    qemu_irq irq[32];
     ResetInfo *reset_info;
     int i;
 
@@ -123,8 +123,7 @@ static void lm32_evr_init(MachineState *machine)
                           1, 2, 0x01, 0x7e, 0x43, 0x00, 0x555, 0x2aa, 1);
 
     /* create irq lines */
-    cpu_irq = qemu_allocate_irqs(cpu_irq_handler, cpu, 1);
-    env->pic_state = lm32_pic_init(*cpu_irq);
+    env->pic_state = lm32_pic_init(qemu_allocate_irq(cpu_irq_handler, cpu, 0));
     for (i = 0; i < 32; i++) {
         irq[i] = qdev_get_gpio_in(env->pic_state, i);
     }
@@ -173,7 +172,7 @@ static void lm32_uclinux_init(MachineState *machine)
     DriveInfo *dinfo;
     MemoryRegion *address_space_mem =  get_system_memory();
     MemoryRegion *phys_ram = g_new(MemoryRegion, 1);
-    qemu_irq *cpu_irq, irq[32];
+    qemu_irq irq[32];
     HWSetup *hw;
     ResetInfo *reset_info;
     int i;
@@ -225,8 +224,7 @@ static void lm32_uclinux_init(MachineState *machine)
                           1, 2, 0x01, 0x7e, 0x43, 0x00, 0x555, 0x2aa, 1);
 
     /* create irq lines */
-    cpu_irq = qemu_allocate_irqs(cpu_irq_handler, env, 1);
-    env->pic_state = lm32_pic_init(*cpu_irq);
+    env->pic_state = lm32_pic_init(qemu_allocate_irq(cpu_irq_handler, env, 0));
     for (i = 0; i < 32; i++) {
         irq[i] = qdev_get_gpio_in(env->pic_state, i);
     }
Signature · 1 line
2.1.4
#17 lore raw

[Qemu-devel] [PULL 30/30] configure: postfix --extra-cflags to QEMU_CFLAGS

In reply to Michael Tokarev

From: Alex Bennée <[email protected]>

It makes sense that extra-cflags should be appended after the normal CFLAGS so they don't get overridden by default behaviour. This way if you specify something like:

  ./configure --extra-cflags="-O0"

You will see the requested behaviour.

---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure +1 -1
index 4e2f78a..69190d2 100755
@@ -353,7 +353,7 @@ for opt do
   ;;
   --cpu=*) cpu="$optarg"
   ;;
-  --extra-cflags=*) QEMU_CFLAGS="$optarg $QEMU_CFLAGS"
+  --extra-cflags=*) QEMU_CFLAGS="$QEMU_CFLAGS $optarg"
                     EXTRA_CFLAGS="$optarg"
   ;;
   --extra-ldflags=*) LDFLAGS="$optarg $LDFLAGS"
Signature · 1 line
2.1.4
#18 lore raw

[Qemu-devel] [PULL 23/30] hw/alpha/typhoon.c: Fix misusing qemu_allocate_irqs for single irq

In reply to Michael Tokarev

From: Shannon Zhao <[email protected]>

---
 hw/alpha/typhoon.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
hw/alpha/typhoon.c +4 -4
index 7df842d..421162e 100644
@@ -841,7 +841,7 @@ PCIBus *typhoon_init(ram_addr_t ram_size, ISABus **isa_bus,
         }
     }
 
-    *p_rtc_irq = *qemu_allocate_irqs(typhoon_set_timer_irq, s, 1);
+    *p_rtc_irq = qemu_allocate_irq(typhoon_set_timer_irq, s, 0);
 
     /* Main memory region, 0x00.0000.0000.  Real hardware supports 32GB,
        but the address space hole reserved at this point is 8TB.  */
@@ -918,11 +918,11 @@ PCIBus *typhoon_init(ram_addr_t ram_size, ISABus **isa_bus,
     /* Init the ISA bus.  */
     /* ??? Technically there should be a cy82c693ub pci-isa bridge.  */
     {
-        qemu_irq isa_pci_irq, *isa_irqs;
+        qemu_irq *isa_irqs;
 
         *isa_bus = isa_bus_new(NULL, get_system_memory(), &s->pchip.reg_io);
-        isa_pci_irq = *qemu_allocate_irqs(typhoon_set_isa_irq, s, 1);
-        isa_irqs = i8259_init(*isa_bus, isa_pci_irq);
+        isa_irqs = i8259_init(*isa_bus,
+                              qemu_allocate_irq(typhoon_set_isa_irq, s, 0));
         isa_bus_irqs(*isa_bus, isa_irqs);
     }
 
Signature · 1 line
2.1.4
#19 lore raw

[Qemu-devel] [PULL 13/30] hw/intc/exynos4210_gic.c: Fix memory leak by adjusting order

In reply to Michael Tokarev

From: Shannon Zhao <[email protected]>

---
 hw/intc/exynos4210_gic.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
hw/intc/exynos4210_gic.c +3 -4
index 0590d5d..b2a4950 100644
@@ -213,9 +213,6 @@ void exynos4210_init_board_irqs(Exynos4210Irq *s)
     uint32_t grp, bit, irq_id, n;
 
     for (n = 0; n < EXYNOS4210_MAX_EXT_COMBINER_IN_IRQ; n++) {
-        s->board_irqs[n] = qemu_irq_split(s->int_combiner_irq[n],
-                s->ext_combiner_irq[n]);
-
         irq_id = 0;
         if (n == EXYNOS4210_COMBINER_GET_IRQ_NUM(1, 4) ||
                 n == EXYNOS4210_COMBINER_GET_IRQ_NUM(12, 4)) {
@@ -230,8 +227,10 @@ void exynos4210_init_board_irqs(Exynos4210Irq *s)
         if (irq_id) {
             s->board_irqs[n] = qemu_irq_split(s->int_combiner_irq[n],
                     s->ext_gic_irq[irq_id-32]);
+        } else {
+            s->board_irqs[n] = qemu_irq_split(s->int_combiner_irq[n],
+                    s->ext_combiner_irq[n]);
         }
-
     }
     for (; n < EXYNOS4210_MAX_INT_COMBINER_IN_IRQ; n++) {
         /* these IDs are passed to Internal Combiner and External GIC */
Signature · 1 line
2.1.4
#20 lore raw

[Qemu-devel] [PULL 14/30] hw/i386/pc: Fix misusing qemu_allocate_irqs for single irq

In reply to Michael Tokarev

From: Shannon Zhao <[email protected]>

Since pc_allocate_cpu_irq only requests one irq, so let it just call qemu_allocate_irq.

---
 hw/i386/pc.c         | 4 ++--
 hw/i386/pc_piix.c    | 4 +---
 hw/i386/pc_q35.c     | 4 +---
 include/hw/i386/pc.h | 2 +-
 4 files changed, 5 insertions(+), 9 deletions(-)
hw/i386/pc.c +2 -2
index 1eb1db0..886151b 100644
@@ -1345,9 +1345,9 @@ FWCfgState *pc_memory_init(MachineState *machine,
     return fw_cfg;
 }
 
-qemu_irq *pc_allocate_cpu_irq(void)
+qemu_irq pc_allocate_cpu_irq(void)
 {
-    return qemu_allocate_irqs(pic_irq_request, NULL, 1);
+    return qemu_allocate_irq(pic_irq_request, NULL, 0);
 }
 
 DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus)
hw/i386/pc_piix.c +1 -3
index 8d949a3..768b09b 100644
@@ -86,7 +86,6 @@ static void pc_init1(MachineState *machine)
     ISABus *isa_bus;
     PCII440FXState *i440fx_state;
     int piix3_devfn = -1;
-    qemu_irq *cpu_irq;
     qemu_irq *gsi;
     qemu_irq *i8259;
     qemu_irq smi_irq;
@@ -220,8 +219,7 @@ static void pc_init1(MachineState *machine)
     } else if (xen_enabled()) {
         i8259 = xen_interrupt_controller_init();
     } else {
-        cpu_irq = pc_allocate_cpu_irq();
-        i8259 = i8259_init(isa_bus, cpu_irq[0]);
+        i8259 = i8259_init(isa_bus, pc_allocate_cpu_irq());
     }
 
     for (i = 0; i < ISA_NUM_IRQS; i++) {
hw/i386/pc_q35.c +1 -3
index 66220b3..110dfb7 100644
@@ -79,7 +79,6 @@ static void pc_q35_init(MachineState *machine)
     GSIState *gsi_state;
     ISABus *isa_bus;
     int pci_enabled = 1;
-    qemu_irq *cpu_irq;
     qemu_irq *gsi;
     qemu_irq *i8259;
     int i;
@@ -230,8 +229,7 @@ static void pc_q35_init(MachineState *machine)
     } else if (xen_enabled()) {
         i8259 = xen_interrupt_controller_init();
     } else {
-        cpu_irq = pc_allocate_cpu_irq();
-        i8259 = i8259_init(isa_bus, cpu_irq[0]);
+        i8259 = i8259_init(isa_bus, pc_allocate_cpu_irq());
     }
 
     for (i = 0; i < ISA_NUM_IRQS; i++) {
include/hw/i386/pc.h +1 -1
index 27bd748..261155f 100644
@@ -193,7 +193,7 @@ FWCfgState *pc_memory_init(MachineState *machine,
                            MemoryRegion *rom_memory,
                            MemoryRegion **ram_memory,
                            PcGuestInfo *guest_info);
-qemu_irq *pc_allocate_cpu_irq(void);
+qemu_irq pc_allocate_cpu_irq(void);
 DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus);
 void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
                           ISADevice **rtc_state,
Signature · 1 line
2.1.4
#21 lore raw

[Qemu-devel] [PULL 16/30] hw/isa/i82378.c: Fix misusing qemu_allocate_irqs for single irq

In reply to Michael Tokarev

From: Shannon Zhao <[email protected]>

---
 hw/isa/i82378.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
hw/isa/i82378.c +2 -5
index 9da9dfc..fcf97d8 100644
@@ -65,7 +65,6 @@ static void i82378_realize(PCIDevice *pci, Error **errp)
     uint8_t *pci_conf;
     ISABus *isabus;
     ISADevice *isa;
-    qemu_irq *out0_irq;
 
     pci_conf = pci->config;
     pci_set_word(pci_conf + PCI_COMMAND,
@@ -88,11 +87,9 @@ static void i82378_realize(PCIDevice *pci, Error **errp)
        All devices accept byte access only, except timer
      */
 
-    /* Workaround the fact that i8259 is not qdev'ified... */
-    out0_irq = qemu_allocate_irqs(i82378_request_out0_irq, s, 1);
-
     /* 2 82C59 (irq) */
-    s->i8259 = i8259_init(isabus, *out0_irq);
+    s->i8259 = i8259_init(isabus,
+                          qemu_allocate_irq(i82378_request_out0_irq, s, 0));
     isa_bus_irqs(isabus, s->i8259);
 
     /* 1 82C54 (pit) */
Signature · 1 line
2.1.4
#22 lore raw

[Qemu-devel] [PULL 19/30] hw/ppc/prep.c: Fix misusing qemu_allocate_irqs for single irq

In reply to Michael Tokarev

From: Shannon Zhao <[email protected]>

---
 hw/ppc/prep.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
hw/ppc/prep.c +2 -3
index 7f52662..998ee2d 100644
@@ -528,7 +528,6 @@ static void ppc_prep_init(MachineState *machine)
     PCIDevice *pci;
     ISABus *isa_bus;
     ISADevice *isa;
-    qemu_irq *cpu_exit_irq;
     int ppc_boot_device;
     DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
 
@@ -625,11 +624,11 @@ static void ppc_prep_init(MachineState *machine)
 
     /* PCI -> ISA bridge */
     pci = pci_create_simple(pci_bus, PCI_DEVFN(1, 0), "i82378");
-    cpu_exit_irq = qemu_allocate_irqs(cpu_request_exit, NULL, 1);
     cpu = POWERPC_CPU(first_cpu);
     qdev_connect_gpio_out(&pci->qdev, 0,
                           cpu->env.irq_inputs[PPC6xx_INPUT_INT]);
-    qdev_connect_gpio_out(&pci->qdev, 1, *cpu_exit_irq);
+    qdev_connect_gpio_out(&pci->qdev, 1,
+                          qemu_allocate_irq(cpu_request_exit, NULL, 0));
     sysbus_connect_irq(&pcihost->busdev, 0, qdev_get_gpio_in(&pci->qdev, 9));
     sysbus_connect_irq(&pcihost->busdev, 1, qdev_get_gpio_in(&pci->qdev, 11));
     sysbus_connect_irq(&pcihost->busdev, 2, qdev_get_gpio_in(&pci->qdev, 9));
Signature · 1 line
2.1.4
#23 lore raw

[Qemu-devel] [PULL 01/30] iscsi: Remove pointless runtime check of macro value

In reply to Michael Tokarev

From: Fam Zheng <[email protected]>

raw_bsd already has QEMU_BUILD_BUG_ON(BDRV_SECTOR_SIZE != 512), so iscsi should relax.

---
 block/iscsi.c | 7 -------
 1 file changed, 7 deletions(-)
block/iscsi.c +0 -7
index 8fca1d3..14e97a6 100644
@@ -1323,13 +1323,6 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
     const char *filename;
     int i, ret = 0;
 
-    if ((BDRV_SECTOR_SIZE % 512) != 0) {
-        error_setg(errp, "iSCSI: Invalid BDRV_SECTOR_SIZE. "
-                   "BDRV_SECTOR_SIZE(%lld) is not a multiple "
-                   "of 512", BDRV_SECTOR_SIZE);
-        return -EINVAL;
-    }
-
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
     qemu_opts_absorb_qdict(opts, options, &local_err);
     if (local_err) {
Signature · 1 line
2.1.4
#24 lore raw

[Qemu-devel] [PULL 12/30] hw/arm/omap_sx1.c: Fix memory leak spotted by valgrind

In reply to Michael Tokarev

From: Shannon Zhao <[email protected]>

---
 hw/arm/omap_sx1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/omap_sx1.c +1 -1
index 671e02c..4b0f7f9 100644
@@ -103,7 +103,6 @@ static void sx1_init(MachineState *machine, const int version)
     struct omap_mpu_state_s *mpu;
     MemoryRegion *address_space = get_system_memory();
     MemoryRegion *flash = g_new(MemoryRegion, 1);
-    MemoryRegion *flash_1 = g_new(MemoryRegion, 1);
     MemoryRegion *cs = g_new(MemoryRegion, 4);
     static uint32_t cs0val = 0x00213090;
     static uint32_t cs1val = 0x00215070;
@@ -165,6 +164,7 @@ static void sx1_init(MachineState *machine, const int version)
 
     if ((version == 1) &&
             (dinfo = drive_get(IF_PFLASH, 0, fl_idx)) != NULL) {
+        MemoryRegion *flash_1 = g_new(MemoryRegion, 1);
         memory_region_init_ram(flash_1, NULL, "omap_sx1.flash1-0", flash1_size,
                                &error_abort);
         vmstate_register_ram_global(flash_1);
Signature · 1 line
2.1.4
#25 lore raw

[Qemu-devel] [PULL 27/30] translate-all: delete prototype for non-existent function

In reply to Michael Tokarev

From: Paolo Bonzini <[email protected]>

Missed in commit 3a808cc40

---
 translate-all.h | 1 -
 1 file changed, 1 deletion(-)
translate-all.h +0 -1
index 02832b2..b6a07bd 100644
@@ -21,7 +21,6 @@
 
 /* translate-all.c */
 void tb_invalidate_phys_page_fast(tb_page_addr_t start, int len);
-void cpu_unlink_tb(CPUState *cpu);
 void tb_check_watchpoint(CPUState *cpu);
 
 #endif /* TRANSLATE_ALL_H */
Signature · 1 line
2.1.4
#26 lore raw

[Qemu-devel] [PULL 02/30] microblaze: cpu: Delete MMAP_SHIFT definition

In reply to Michael Tokarev

From: Peter Crosthwaite <[email protected]>

Just fallback on the default of 12 like other architectures. This allows changing the system-mode-affecting definition of TARGET_PAGE_BITS without affecting microblaze linux-user.

---
 target-microblaze/cpu.h | 1 -
 1 file changed, 1 deletion(-)
target-microblaze/cpu.h +0 -1
index 4ea04ac..d73e1c7 100644
@@ -285,7 +285,6 @@ int cpu_mb_signal_handler(int host_signum, void *pinfo,
 
 /* FIXME: MB uses variable pages down to 1K but linux only uses 4k.  */
 #define TARGET_PAGE_BITS 12
-#define MMAP_SHIFT TARGET_PAGE_BITS
 
 #define TARGET_PHYS_ADDR_SPACE_BITS 32
 #define TARGET_VIRT_ADDR_SPACE_BITS 32
Signature · 1 line
2.1.4
#27 lore raw

[Qemu-devel] [PULL 21/30] hw/lm32/milkymist.c: Fix misusing qemu_allocate_irqs for single irq

In reply to Michael Tokarev

From: Shannon Zhao <[email protected]>

---
 hw/lm32/milkymist.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
hw/lm32/milkymist.c +2 -3
index e0cec7d..e755f5b 100644
@@ -86,7 +86,7 @@ milkymist_init(MachineState *machine)
     DriveInfo *dinfo;
     MemoryRegion *address_space_mem = get_system_memory();
     MemoryRegion *phys_sdram = g_new(MemoryRegion, 1);
-    qemu_irq irq[32], *cpu_irq;
+    qemu_irq irq[32];
     int i;
     char *bios_filename;
     ResetInfo *reset_info;
@@ -130,8 +130,7 @@ milkymist_init(MachineState *machine)
                           2, 0x00, 0x89, 0x00, 0x1d, 1);
 
     /* create irq lines */
-    cpu_irq = qemu_allocate_irqs(cpu_irq_handler, cpu, 1);
-    env->pic_state = lm32_pic_init(*cpu_irq);
+    env->pic_state = lm32_pic_init(qemu_allocate_irq(cpu_irq_handler, cpu, 0));
     for (i = 0; i < 32; i++) {
         irq[i] = qdev_get_gpio_in(env->pic_state, i);
     }
Signature · 1 line
2.1.4
#28 lore raw

[Qemu-devel] [PULL 11/30] hw/ppc/e500.c: Fix memory leak

In reply to Michael Tokarev

From: Shannon Zhao <[email protected]>

---
 hw/ppc/e500.c | 1 +
 1 file changed, 1 insertion(+)
hw/ppc/e500.c +1 -0
index c10e1b5..d300846 100644
@@ -1030,6 +1030,7 @@ void ppce500_init(MachineState *machine, PPCE500Params *params)
             exit(1);
         }
     }
+    g_free(filename);
 
     /* Reserve space for dtb */
     dt_base = (loadaddr + bios_size + DTC_LOAD_PAD) & ~DTC_PAD_MASK;
Signature · 1 line
2.1.4
#29 lore raw

[Qemu-devel] [PULL 26/30] Add -incoming help text

In reply to Michael Tokarev

From: "Dr. David Alan Gilbert" <[email protected]>

The help/man text for

-incoming defer

didn't make it through the merge of the code that implemented it.

---
 qemu-options.hx | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
qemu-options.hx +8 -1
index 7edd1f1..b3db6cb 100644
@@ -3239,7 +3239,9 @@ DEF("incoming", HAS_ARG, QEMU_OPTION_incoming, \
     "-incoming fd:fd\n" \
     "-incoming exec:cmdline\n" \
     "                accept incoming migration on given file descriptor\n" \
-    "                or from given external command\n",
+    "                or from given external command\n" \
+    "-incoming defer\n" \
+    "                wait for the URI to be specified via migrate_incoming\n",
     QEMU_ARCH_ALL)
 STEXI
 @item -incoming tcp:[@var{host}]:@var{port}[,to=@var{maxport}][,ipv4][,ipv6]
@@ -3255,6 +3257,11 @@ Accept incoming migration from a given filedescriptor.
 
 @item -incoming exec:@var{cmdline}
 Accept incoming migration as an output from specified external command.
+
+@item -incoming defer
+Wait for the URI to be specified via migrate_incoming.  The monitor can
+be used to change settings (such as migration parameters) prior to issuing
+the migrate_incoming to allow the migration to begin.
 ETEXI
 
 DEF("nodefaults", 0, QEMU_OPTION_nodefaults, \
Signature · 1 line
2.1.4
#30 lore raw

[Qemu-devel] [PULL 09/30] vl: fix memory leak spotted by valgrind

In reply to Michael Tokarev

From: Shannon Zhao <[email protected]>

valgrind complains about:
==9276== 13 bytes in 1 blocks are definitely lost in loss record 1,046 of 3,673

==9276==    at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==9276==    by 0x2EAFBB: malloc_and_trace (vl.c:2556)
==9276==    by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3)
==9276==    by 0x4A28BD: addr_to_string (vnc.c:123)
==9276==    by 0x4A29AD: vnc_socket_local_addr (vnc.c:139)
==9276==    by 0x4A9AFE: vnc_display_local_addr (vnc.c:3240)
==9276==    by 0x2EF4FE: main (vl.c:4321)
---
 vl.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
vl.c +3 -2
index 1d4c089..3893c84 100644
@@ -4312,8 +4312,9 @@ int main(int argc, char **argv, char **envp)
     /* init remote displays */
     qemu_opts_foreach(qemu_find_opts("vnc"), vnc_init_func, NULL, 0);
     if (show_vnc_port) {
-        printf("VNC server running on `%s'\n",
-               vnc_display_local_addr("default"));
+        char *ret = vnc_display_local_addr("default");
+        printf("VNC server running on `%s'\n", ret);
+        g_free(ret);
     }
 #endif
 #ifdef CONFIG_SPICE
Signature · 1 line
2.1.4
#31 lore raw
In reply to Michael Tokarev
Quoted 24 lines · Michael Tokarev

Here's another trivial-patches pull request.

There are many patches in there this time, mostly due to work by Shannon Zhao, who has been busy chasing memory leaks all over the place. I haven't applied _all_ of his patches yes, there's one series pending with more complex patches around qemu_allocate_irqs(), these needs some more review.

There's also a fix for CVE-2015-4037 (predictable directory name in slirp smb code).

Please consider applying/pulling.

Thanks,

/mjt

The following changes since commit 42d58e7c6760cb9c55627c28ae538e27dcf2f144:

Merge remote-tracking branch 'remotes/sstabellini/tags/xen-15-06-02-tag' into staging (2015-06-02 16:47:31 +0100)

are available in the git repository at:

Quoted 8 lines

git://git.corpit.ru/qemu.git tags/pull-trivial-patches-2015-06-03

for you to fetch changes up to de3852877f1e452321352fdb7e678f079876a41b:

  configure: postfix --extra-cflags to QEMU_CFLAGS (2015-06-03 16:04:39 +0300)

----------------------------------------------------------------
trivial patches for 2015-06-03

Applied, thanks.

-- PMM