Commit 33e60e01 authored by Peter Maydell's avatar Peter Maydell
Browse files

Merge remote-tracking branch 'remotes/elmarco/tags/leak-pull-request' into staging



Pull request

v2:
- dropped "tests: fix small leak in test-io-channel-command" that Daniel Berrange will pick
- fixed "tests: add qtest_add_data_func_full" to work with glib < 2.26

# gpg: Signature made Thu 08 Sep 2016 15:16:54 BST
# gpg:                using RSA key 0xDAE8E10975969CE5
# gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>"
# gpg:                 aka "Marc-André Lureau <marcandre.lureau@gmail.com>"
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5

* remotes/elmarco/tags/leak-pull-request: (25 commits)
  tests: fix postcopy-test leaks
  tests: fix rsp leak in postcopy-test
  tests: pc-cpu-test leaks fixes
  tests: add qtest_add_data_func_full
  bus: simplify name handling
  ipmi: free extern timer
  sd: free timer
  pc: keep gsi reference
  pc: free i8259
  tests: fix qom-test leaks
  acpi-build: fix array leak
  machine: use class base init generated name
  pc: don't leak a20_line
  pc: simplify passing qemu_irq
  portio: keep references on portio
  tests: fix leak in test-string-input-visitor
  tests: fix check-qom-proplist leaks
  tests: fix check-qom-interface leaks
  tests: fix test-iov leaks
  tests: fix test-vmstate leaks
  ...

Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parents 59351d9b e2dd21e5
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -60,6 +60,8 @@ typedef struct GUSState {
    int64_t last_ticks;
    qemu_irq pic;
    IsaDma *isa_dma;
    PortioList portio_list1;
    PortioList portio_list2;
} GUSState;

static uint32_t gus_readb(void *opaque, uint32_t nport)
@@ -265,8 +267,9 @@ static void gus_realizefn (DeviceState *dev, Error **errp)
    s->samples = AUD_get_buffer_size_out (s->voice) >> s->shift;
    s->mixbuf = g_malloc0 (s->samples << s->shift);

    isa_register_portio_list (d, s->port, gus_portio_list1, s, "gus");
    isa_register_portio_list (d, (s->port + 0x100) & 0xf00,
    isa_register_portio_list(d, &s->portio_list1, s->port,
                             gus_portio_list1, s, "gus");
    isa_register_portio_list(d, &s->portio_list2, (s->port + 0x100) & 0xf00,
                             gus_portio_list2, s, "gus");

    s->isa_dma = isa_get_dma(isa_bus_from_device(d), s->emu.gusdma);
+3 −1
Original line number Diff line number Diff line
@@ -106,6 +106,7 @@ typedef struct SB16State {
    /* mixer state */
    int mixer_nreg;
    uint8_t mixer_regs[256];
    PortioList portio_list;
} SB16State;

static void SB_audio_callback (void *opaque, int free);
@@ -1378,7 +1379,8 @@ static void sb16_realizefn (DeviceState *dev, Error **errp)
        dolog ("warning: Could not create auxiliary timer\n");
    }

    isa_register_portio_list (isadev, s->port, sb16_ioport_list, s, "sb16");
    isa_register_portio_list(isadev, &s->portio_list, s->port,
                             sb16_ioport_list, s, "sb16");

    s->isa_hdma = isa_get_dma(isa_bus_from_device(isadev), s->hdma);
    k = ISADMA_GET_CLASS(s->isa_hdma);
+3 −1
Original line number Diff line number Diff line
@@ -692,6 +692,7 @@ struct FDCtrl {
    /* Timers state */
    uint8_t timer0;
    uint8_t timer1;
    PortioList portio_list;
};

static FloppyDriveType get_fallback_drive_type(FDrive *drv)
@@ -2495,7 +2496,8 @@ static void isabus_fdc_realize(DeviceState *dev, Error **errp)
    FDCtrl *fdctrl = &isa->state;
    Error *err = NULL;

    isa_register_portio_list(isadev, isa->iobase, fdc_portio_list, fdctrl,
    isa_register_portio_list(isadev, &fdctrl->portio_list,
                             isa->iobase, fdc_portio_list, fdctrl,
                             "fdc");

    isa_init_irq(isadev, &fdctrl->irq, isa->irq);
+2 −1
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@ typedef struct ParallelState {
    uint32_t last_read_offset; /* For debugging */
    /* Memory-mapped interface */
    int it_shift;
    PortioList portio_list;
} ParallelState;

#define TYPE_ISA_PARALLEL "isa-parallel"
@@ -532,7 +533,7 @@ static void parallel_isa_realizefn(DeviceState *dev, Error **errp)
        s->status = dummy;
    }

    isa_register_portio_list(isadev, base,
    isa_register_portio_list(isadev, &s->portio_list, base,
                             (s->hw_driver
                              ? &isa_parallel_portio_hw_list[0]
                              : &isa_parallel_portio_sw_list[0]),
+6 −15
Original line number Diff line number Diff line
@@ -78,8 +78,7 @@ static void qbus_realize(BusState *bus, DeviceState *parent, const char *name)
{
    const char *typename = object_get_typename(OBJECT(bus));
    BusClass *bc;
    char *buf;
    int i, len, bus_id;
    int i, bus_id;

    bus->parent = parent;

@@ -88,23 +87,15 @@ static void qbus_realize(BusState *bus, DeviceState *parent, const char *name)
    } else if (bus->parent && bus->parent->id) {
        /* parent device has id -> use it plus parent-bus-id for bus name */
        bus_id = bus->parent->num_child_bus;

        len = strlen(bus->parent->id) + 16;
        buf = g_malloc(len);
        snprintf(buf, len, "%s.%d", bus->parent->id, bus_id);
        bus->name = buf;
        bus->name = g_strdup_printf("%s.%d", bus->parent->id, bus_id);
    } else {
        /* no id -> use lowercase bus type plus global bus-id for bus name */
        bc = BUS_GET_CLASS(bus);
        bus_id = bc->automatic_ids++;

        len = strlen(typename) + 16;
        buf = g_malloc(len);
        len = snprintf(buf, len, "%s.%d", typename, bus_id);
        for (i = 0; i < len; i++) {
            buf[i] = qemu_tolower(buf[i]);
        bus->name = g_strdup_printf("%s.%d", typename, bus_id);
        for (i = 0; bus->name[i]; i++) {
            bus->name[i] = qemu_tolower(bus->name[i]);
        }
        bus->name = buf;
    }

    if (bus->parent) {
@@ -229,7 +220,7 @@ static void qbus_finalize(Object *obj)
{
    BusState *bus = BUS(obj);

    g_free((char *)bus->name);
    g_free(bus->name);
}

static const TypeInfo bus_info = {
Loading