Merge remote-tracking branch 'stefanha/trivial-patches' into staging

# By Peter Crosthwaite (2) and others
# Via Stefan Hajnoczi
* stefanha/trivial-patches:
  xilinx_zynq: Cleanup ssi_create_slave
  petalogix_ml605_mmu: Cleanup ssi_create_slave()
  target-s390: Fix SRNMT
  linux-user: Don't omit comma for strace of rt_sigaction()
  test-visitor-serialization: Fix some memory leaks
This commit is contained in:
Anthony Liguori 2013-04-05 12:52:48 -05:00
commit 91b53e4407
5 changed files with 15 additions and 6 deletions

View file

@ -86,8 +86,7 @@ static inline void zynq_init_spi_flashes(uint32_t base_addr, qemu_irq irq,
spi = (SSIBus *)qdev_get_child_bus(dev, bus_name);
for (j = 0; j < num_ss; ++j) {
flash_dev = ssi_create_slave_no_init(spi, "n25q128");
qdev_init_nofail(flash_dev);
flash_dev = ssi_create_slave(spi, "n25q128");
cs_line = qdev_get_gpio_in(flash_dev, 0);
sysbus_connect_irq(busdev, i * num_ss + j + 1, cs_line);

View file

@ -158,8 +158,7 @@ petalogix_ml605_init(QEMUMachineInitArgs *args)
for (i = 0; i < NUM_SPI_FLASHES; i++) {
qemu_irq cs_line;
dev = ssi_create_slave_no_init(spi, "n25q128");
qdev_init_nofail(dev);
dev = ssi_create_slave(spi, "n25q128");
cs_line = qdev_get_gpio_in(dev, 0);
sysbus_connect_irq(busdev, i+1, cs_line);
}

View file

@ -143,7 +143,7 @@ print_signal(abi_ulong arg, int last)
case TARGET_SIGTTOU: signal_name = "SIGTTOU"; break;
}
if (signal_name == NULL) {
print_raw_param("%ld", arg, 1);
print_raw_param("%ld", arg, last);
return;
}
gemu_log("%s%s", signal_name, get_comma(last));

View file

@ -3088,6 +3088,7 @@ static ExitStatus op_srnm(DisasContext *s, DisasOps *o)
break;
case 0xb9: /* SRNMT */
pos = 4, len = 3;
break;
default:
tcg_abort();
}

View file

@ -258,6 +258,7 @@ static void test_primitives(gconstpointer opaque)
g_assert(pt_copy != NULL);
if (pt->type == PTYPE_STRING) {
g_assert_cmpstr(pt->value.string, ==, pt_copy->value.string);
g_free((char *)pt_copy->value.string);
} else if (pt->type == PTYPE_NUMBER) {
/* we serialize with %f for our reference visitors, so rather than fuzzy
* floating math to test "equality", just compare the formatted values
@ -275,6 +276,7 @@ static void test_primitives(gconstpointer opaque)
ops->cleanup(serialize_data);
g_free(args);
g_free(pt_copy);
}
static void test_struct(gconstpointer opaque)
@ -660,6 +662,7 @@ static void qmp_deserialize(void **native_out, void *datap,
QDECREF(output_json);
d->qiv = qmp_input_visitor_new(obj);
qobject_decref(obj);
visit(qmp_input_get_visitor(d->qiv), native_out, errp);
}
@ -668,9 +671,12 @@ static void qmp_cleanup(void *datap)
QmpSerializeData *d = datap;
qmp_output_visitor_cleanup(d->qov);
qmp_input_visitor_cleanup(d->qiv);
g_free(d);
}
typedef struct StringSerializeData {
char *string;
StringOutputVisitor *sov;
StringInputVisitor *siv;
} StringSerializeData;
@ -690,15 +696,19 @@ static void string_deserialize(void **native_out, void *datap,
{
StringSerializeData *d = datap;
d->siv = string_input_visitor_new(string_output_get_string(d->sov));
d->string = string_output_get_string(d->sov);
d->siv = string_input_visitor_new(d->string);
visit(string_input_get_visitor(d->siv), native_out, errp);
}
static void string_cleanup(void *datap)
{
StringSerializeData *d = datap;
string_output_visitor_cleanup(d->sov);
string_input_visitor_cleanup(d->siv);
g_free(d->string);
g_free(d);
}
/* visitor registration, test harness */