Trivial patches for 28 March to 5 April 2013
PATCH 1/5 test-visitor-serialization: Fix some memory leaks
In reply to Stefan HajnocziFrom: Stefan Berger <[email protected]>
This patch fixes some of the memory leaks in test-visitor-serialization but not all of them.
--- tests/test-visitor-serialization.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
tests/test-visitor-serialization.c +11 -1
@@ -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 */
Signature · 1 line
1.8.1.4
The following changes since commit d05ef160453e98546a4197496dc8a3cb2defac53:
Allow clock_gettime() monotonic clock to be utilized on more OS's (2013-04-04 20:22:45 -0500)
are available in the git repository at:
git://github.com/stefanha/qemu.git trivial-patches
for you to fetch changes up to f1922e36e267eae0c9d70e8660830e081878bdfc:
xilinx_zynq: Cleanup ssi_create_slave (2013-04-05 15:04:10 +0200)
----------------------------------------------------------------
Peter Crosthwaite (2):
petalogix_ml605_mmu: Cleanup ssi_create_slave()
xilinx_zynq: Cleanup ssi_create_slave
Peter Maydell (1):
linux-user: Don't omit comma for strace of rt_sigaction()
Richard Henderson (1):
target-s390: Fix SRNMT
Stefan Berger (1):
test-visitor-serialization: Fix some memory leaks
hw/arm/xilinx_zynq.c | 3 +-- hw/microblaze/petalogix_ml605_mmu.c | 3 +-- linux-user/strace.c | 2 +- target-s390x/translate.c | 1 + tests/test-visitor-serialization.c | 12 +++++++++++- 5 files changed, 15 insertions(+), 6 deletions(-)
Signature · 1 line
1.8.1.4
PATCH 3/5 target-s390: Fix SRNMT
From: Richard Henderson <[email protected]>
Fallthough into abort = oops.
--- target-s390x/translate.c | 1 + 1 file changed, 1 insertion(+)
target-s390x/translate.c +1 -0
@@ -3088,6 +3088,7 @@ static ExitStatus op_srnm(DisasContext *s, DisasOps *o)break ;case 0xb9 :/* SRNMT */ pos =4 , len =3 ; +break ;default :tcg_abort (); }
Signature · 1 line
1.8.1.4
PATCH 2/5 linux-user: Don't omit comma for strace of rt_sigaction()
In reply to Stefan HajnocziFrom: Peter Maydell <[email protected]>
Pass the 'last' parameter of print_signal() through to print_raw_param(); this fixes a problem where we weren't printing the comma separator for strace of rt_sigaction() when the signal was an unnamed (ie realtime) one:
6856 rt_sigaction(230xf6fff870,0xf6fff8fc) = 0
--- linux-user/strace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
linux-user/strace.c +1 -1
@@ -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));
Signature · 1 line
1.8.1.4
PATCH 4/5 petalogix_ml605_mmu: Cleanup ssi_create_slave()
In reply to Stefan HajnocziFrom: Peter Crosthwaite <[email protected]>
With the recent m25p80 cleanup there is no need to use ssi_create_slave_no_init() anymore. Just use ssi_create_slave().
--- hw/microblaze/petalogix_ml605_mmu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
hw/microblaze/petalogix_ml605_mmu.c +1 -2
@@ -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); }
Signature · 1 line
1.8.1.4
PATCH 5/5 xilinx_zynq: Cleanup ssi_create_slave
In reply to Stefan HajnocziFrom: Peter Crosthwaite <[email protected]>
With the recent m25p80 cleanup there is no need to use ssi_create_slave_no_init() anymore. Just use ssi_create_slave().
--- hw/arm/xilinx_zynq.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
hw/arm/xilinx_zynq.c +1 -2
@@ -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);
Signature · 1 line
1.8.1.4