qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 78a4b8: libcacard: g_malloc cleanups


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 78a4b8: libcacard: g_malloc cleanups
Date: Tue, 27 May 2014 16:00:07 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 78a4b8d2051bff8e8794e9419b7925122212b096
      
https://github.com/qemu/qemu/commit/78a4b8d2051bff8e8794e9419b7925122212b096
  Author: Michael Tokarev <address@hidden>
  Date:   2014-05-24 (Sat, 24 May 2014)

  Changed paths:
    M libcacard/cac.c
    M libcacard/card_7816.c
    M libcacard/event.c
    M libcacard/vcard.c
    M libcacard/vcard_emul_nss.c
    M libcacard/vreader.c

  Log Message:
  -----------
  libcacard: g_malloc cleanups

This patch replaces g_malloc() in libcacard into g_new()
or g_new0() where appropriate (removing some init-to-zero
surrounding code), g_malloc+memcpy into g_memdup() and the
like.

Signed-off-by: Michael Tokarev <address@hidden>
Reviewed-by: Alon Levy <address@hidden>


  Commit: aef553fdcabbea8760cd4647ab14859095300023
      
https://github.com/qemu/qemu/commit/aef553fdcabbea8760cd4647ab14859095300023
  Author: Peter Maydell <address@hidden>
  Date:   2014-05-24 (Sat, 24 May 2014)

  Changed paths:
    M iohandler.c

  Log Message:
  -----------
  iohandler.c: Properly initialize sigaction struct

The code in qemu_init_child_watch() wasn't clearing the 'struct
sigaction' before passing it to sigaction(); this meant that we
would block a random set of signals while executing the SIGCHLD
handler. Initialize properly by using memset() on the struct,
as we do in similar cases elsewhere.

Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>


  Commit: 36af599417dde11747a27dc8550ff2281657a8ff
      
https://github.com/qemu/qemu/commit/36af599417dde11747a27dc8550ff2281657a8ff
  Author: Hani Benhabiles <address@hidden>
  Date:   2014-05-24 (Sat, 24 May 2014)

  Changed paths:
    M blockdev-nbd.c
    M qemu-nbd.c

  Log Message:
  -----------
  nbd: Close socket on negotiation failure.

Otherwise, the nbd client may hang waiting for the server response.

Signed-off-by: Hani Benhabiles <address@hidden>
Acked-by: Paolo Bonzini <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>


  Commit: 5672ee54d5b52b838e4e6b9976e757f28a68c4ec
      
https://github.com/qemu/qemu/commit/5672ee54d5b52b838e4e6b9976e757f28a68c4ec
  Author: Hani Benhabiles <address@hidden>
  Date:   2014-05-24 (Sat, 24 May 2014)

  Changed paths:
    M nbd.c
    M qemu-nbd.c
    M qemu-nbd.texi

  Log Message:
  -----------
  nbd: Miscellaneous typo fixes.

Signed-off-by: Hani Benhabiles <address@hidden>
Acked-by: Paolo Bonzini <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>


  Commit: 9e04c683fca3da265b1d4f80e1c9cf31bd4f6606
      
https://github.com/qemu/qemu/commit/9e04c683fca3da265b1d4f80e1c9cf31bd4f6606
  Author: Stefan Weil <address@hidden>
  Date:   2014-05-24 (Sat, 24 May 2014)

  Changed paths:
    M configure

  Log Message:
  -----------
  configure: Automatically select GTK+ 3.0 if GTK+ 2.0 is unavailable

The configure option --with-gtkabi=3.0 is still supported, but no longer
needed when GTK+-2.0 is missing. When no GTK+ ABI is selected by the
user, configure first tries 2.0, then 3.0.

For some platforms (e.g. Windows) newer binaries of GTK+ are only
available for GTK+ 3.0. Now building on these platforms is a little bit
easier.

Signed-off-by: Stefan Weil <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>


  Commit: 1a3de8dbecd9a1f628f3e95085158d085725ae52
      
https://github.com/qemu/qemu/commit/1a3de8dbecd9a1f628f3e95085158d085725ae52
  Author: Peter Maydell <address@hidden>
  Date:   2014-05-24 (Sat, 24 May 2014)

  Changed paths:
    M include/qemu/bswap.h

  Log Message:
  -----------
  bswap.h: Rename ldl_p, stl_p, etc to ldl_he_p, stl_he_p, etc

We have an unfortunate naming clash between the functions
ldl_p, stl_p, etc defined in bswap.h (which have semantics
"load/store in host endianness") and the #defines of the same
name in cpu-all.h (which have the semantics "load/store in
target endianness").

Fortunately it turns out that the only users of the bswap.h
functions are all within bswap.h itself, so we can simply
rename them to include a _he_ infix for "host endianness".

Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>


  Commit: e35f29ded3602a2ff6776290787c596ce6afc802
      
https://github.com/qemu/qemu/commit/e35f29ded3602a2ff6776290787c596ce6afc802
  Author: Saravanakumar <address@hidden>
  Date:   2014-05-24 (Sat, 24 May 2014)

  Changed paths:
    M hw/display/jazz_led.c

  Log Message:
  -----------
  jazz_led: Add missing break in switch case

Signed-off-by: Saravanakumar <address@hidden>
Reviewed-by: Paolo Bonizni <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>


  Commit: b645000e1ac430601eddb0b435936837aea94bb4
      
https://github.com/qemu/qemu/commit/b645000e1ac430601eddb0b435936837aea94bb4
  Author: Saravanakumar <address@hidden>
  Date:   2014-05-24 (Sat, 24 May 2014)

  Changed paths:
    M hw/pci/pci.c

  Log Message:
  -----------
  pci: move dereferencing of root only after verifying valid root pointer

Signed-off-by: Saravanakumar <address@hidden>
Reviewed-by: Andreas Färber <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>


  Commit: 0971f1bed21b16e59eb5d15cd03180f110a1e8c0
      
https://github.com/qemu/qemu/commit/0971f1bed21b16e59eb5d15cd03180f110a1e8c0
  Author: Le Tan <address@hidden>
  Date:   2014-05-24 (Sat, 24 May 2014)

  Changed paths:
    M arch_init.c

  Log Message:
  -----------
  arch_init: replace fprintf(stderr, ...) with error_report()

Replace fprintf(stderr,...) with error_report() in the file
arch_init.c. The trailing "\n"s of the @fmt argument have been removed
because @fmt of error_report() should not contain newline.

Signed-off-by: Le Tan <address@hidden>
Reviewed-by: Andreas Färber <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>


  Commit: 9c132c7f64c0605f5c5be79508fa53676be642f9
      
https://github.com/qemu/qemu/commit/9c132c7f64c0605f5c5be79508fa53676be642f9
  Author: Jules Wang <address@hidden>
  Date:   2014-05-24 (Sat, 24 May 2014)

  Changed paths:
    M dma-helpers.c

  Log Message:
  -----------
  dma-helpers: avoid calling dma_bdrv_unmap() twice

Calling dma_bdrv_unmap() twice is not necessary and may cause
potential problems if some code changes.

Signed-off-by: Jules Wang <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>


  Commit: 8cd05ab65a92a592e771a0a1847c7e5505d9a024
      
https://github.com/qemu/qemu/commit/8cd05ab65a92a592e771a0a1847c7e5505d9a024
  Author: Peter Maydell <address@hidden>
  Date:   2014-05-24 (Sat, 24 May 2014)

  Changed paths:
    M .gitignore
    M configure

  Log Message:
  -----------
  configure: Put tempfiles in a subdir of the build directory

When libtool support was added to configure, the new temporary files
were left out of the list of files cleaned up on exit; this results
in a lot of stale .lo files being left around in /tmp. Worse, libtool
creates a /tmp/.libs directory which we can't easily clean up.

Put all our temporary files in a single temporary directory created
as a subdirectory of the build directory, so we can easily clean it up,
and don't need fragile or complicated code for creation to avoid it
clashing with temporary directories from other instances of QEMU
configure or being subject to attack from adversaries who can write
to /tmp.

Since the temporaries now live in the build tree, we have no
need to jump through hoops with a trap handler to try to remove
them when configure exits; this fixes some weird bugs where hitting
^C during a configure run wouldn't actually make it stop, because
we would run the trap handler but then not stop. (It is possible
to get the trap handler semantics right but it is convoluted largely
because of bugs in dash, so it is simpler to just avoid it.)

Note that "temporary files go in the build directory, not /tmp" is
the way autoconf behaves.

Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>


  Commit: 5b9d313e3f820f50129887f0a59e88dc376a8b1a
      
https://github.com/qemu/qemu/commit/5b9d313e3f820f50129887f0a59e88dc376a8b1a
  Author: Dr. David Alan Gilbert <address@hidden>
  Date:   2014-05-24 (Sat, 24 May 2014)

  Changed paths:
    M vl.c

  Log Message:
  -----------
  vl: fix 'name' option to work with -readconfig

The 'name' option silently failed when used in config files
( http://lists.gnu.org/archive/html/qemu-devel/2014-04/msg00378.html )

-readconfig stores the configuration read in QemuOpts.  Command line
option parsing should do the same, and no more.  In particular it should
not act upon the option.  That needs to be done separately, where both
command line and -readconfig settings are visible in QemuOpts.

Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Reported-by: William Dauchy <address@hidden>
Tested-by: William Dauchy <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
(mjt: added commit message by ambru@ and subject prefix)


  Commit: d357e3d9d24c8a9e99c994c3c1ee5acb32484a3d
      
https://github.com/qemu/qemu/commit/d357e3d9d24c8a9e99c994c3c1ee5acb32484a3d
  Author: Markus Armbruster <address@hidden>
  Date:   2014-05-24 (Sat, 24 May 2014)

  Changed paths:
    M libcacard/vscclient.c

  Log Message:
  -----------
  libcacard/vscclient: Bury some dead code

Spotted by Coverity.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Alon Levy <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>


  Commit: 124fe7fb1b7a1db8cb2ebb9edae84716ffaf37ce
      
https://github.com/qemu/qemu/commit/124fe7fb1b7a1db8cb2ebb9edae84716ffaf37ce
  Author: Markus Armbruster <address@hidden>
  Date:   2014-05-24 (Sat, 24 May 2014)

  Changed paths:
    M libcacard/vcard_emul_nss.c
    M libcacard/vscclient.c

  Log Message:
  -----------
  libcacard: Plug memory leaks around vreader_get_reader_list()

Spotted by Coverity.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Alon Levy <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>


  Commit: fa5912a17b51b807c4ec78a4aa914891c7770781
      
https://github.com/qemu/qemu/commit/fa5912a17b51b807c4ec78a4aa914891c7770781
  Author: Markus Armbruster <address@hidden>
  Date:   2014-05-24 (Sat, 24 May 2014)

  Changed paths:
    M libcacard/vreader.c

  Log Message:
  -----------
  libcacard/vreader: Drop broken recovery from failed assertion

We suppress some code when we got unexpected status and assertion
checking is off:

     assert(card_status == VCARD_DONE);
     if (card_status == VCARD_DONE) {
   int size = MIN(*receive_buf_len, response->b_total_len);
   memcpy(receive_buf, response->b_data, size);
   *receive_buf_len = size;
    }

Such "recovery" is of dubious value even when it works.  This one
doesn't: it fails to assign to receive_buf[] and *receive_buf_len,
which the callers expect.

Make the code unconditional.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Alon Levy <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>


  Commit: f33a984d512dbcb6762b002a65de4ea748e31d4a
      
https://github.com/qemu/qemu/commit/f33a984d512dbcb6762b002a65de4ea748e31d4a
  Author: Markus Armbruster <address@hidden>
  Date:   2014-05-24 (Sat, 24 May 2014)

  Changed paths:
    M libcacard/vreader.c

  Log Message:
  -----------
  libcacard/vreader: Tighten assertion to clarify intent

Bonus: hushes up Coverity.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Alon Levy <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>


  Commit: 26b78f4d3c3f45f84067440e56c3ebf2d25a9574
      
https://github.com/qemu/qemu/commit/26b78f4d3c3f45f84067440e56c3ebf2d25a9574
  Author: Markus Armbruster <address@hidden>
  Date:   2014-05-24 (Sat, 24 May 2014)

  Changed paths:
    M libcacard/cac.c
    M libcacard/vcard_emul_nss.c

  Log Message:
  -----------
  libcacard: Convert two leftover realloc() to GLib

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Alon Levy <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>


  Commit: 42119fa3568dc7e8c82447c861678a5987d06d91
      
https://github.com/qemu/qemu/commit/42119fa3568dc7e8c82447c861678a5987d06d91
  Author: Markus Armbruster <address@hidden>
  Date:   2014-05-24 (Sat, 24 May 2014)

  Changed paths:
    M libcacard/vcard_emul_nss.c

  Log Message:
  -----------
  libcacard/vcard_emul_nss: Drop a redundant conditional

Bailing out when PK11_FindGenericObjects() returns null ensures the
loop that follows it executes at least once.  The "loop did not
execute" test right after it is useless.  Drop it.

Spotted by Coverity.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Alon Levy <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>


  Commit: d09b8fa161ed6a61339d4d0870f76f13c033b2a3
      
https://github.com/qemu/qemu/commit/d09b8fa161ed6a61339d4d0870f76f13c033b2a3
  Author: Michael Tokarev <address@hidden>
  Date:   2014-05-26 (Mon, 26 May 2014)

  Changed paths:
    M libcacard/vcard_emul_nss.c

  Log Message:
  -----------
  libcacard: fix wrong array expansion logic

The currrent code in libcacard/vcard_emul_nss.c:vcard_emul_options()
has a weird bug in variable usage around expanding opts->vreader
array.

There's a helper variable, vreaderOpt, which is first needlessly
initialized to NULL, next, conditionally, only we have to expand
opts->vreader, receives array expansion from g_renew(), and next,
even if we don't actually perform expansion, the value of this
variable is assigned to the actual array, opts->vreader, which
was supposed to be expanded.

So, since we expand the array by READER_STEP increments, only
once in READER_STEP (=4) the code will work, in other 3/4 times
it will fail badly.

Fix this by not using this temp variable when expanding the
array, and by dropping the useless =NULL initializer too -
if it wasn't in place initially, compiler would have warned
us about this problem at the beginning.

Signed-off-by: Michael Tokarev <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>


  Commit: 69e995040c3dc31274c8fd2732391192272ec465
      
https://github.com/qemu/qemu/commit/69e995040c3dc31274c8fd2732391192272ec465
  Author: Le Tan <address@hidden>
  Date:   2014-05-26 (Mon, 26 May 2014)

  Changed paths:
    M audio/spiceaudio.c
    M audio/wavcapture.c

  Log Message:
  -----------
  audio: replace fprintf(stderr, ...) with error_report() in audio

Replace fprintf(stderr,...) with error_report() in files audio/*.
The trailing "\n"s of the @fmt argument have been removed
because @fmt of error_report() should not contain newline.

Signed-off-by: Le Tan <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>


  Commit: 1fba509527beb74bdcf50bc07ad3cd8244ad9c61
      
https://github.com/qemu/qemu/commit/1fba509527beb74bdcf50bc07ad3cd8244ad9c61
  Author: Le Tan <address@hidden>
  Date:   2014-05-26 (Mon, 26 May 2014)

  Changed paths:
    M bsd-user/bsdload.c
    M bsd-user/elfload.c
    M bsd-user/main.c

  Log Message:
  -----------
  bsd-user: replace fprintf(stderr, ...) with error_report()

Replace fprintf(stderr,...) with error_report() in files bsd-user/*.
The trailing "\n"s of the @fmt argument have been removed
because @fmt of error_report() should not contain newline.

Signed-off-by: Le Tan <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>


  Commit: 116d55460186d8568428072a5bbc355fb0129fce
      
https://github.com/qemu/qemu/commit/116d55460186d8568428072a5bbc355fb0129fce
  Author: Peter Crosthwaite <address@hidden>
  Date:   2014-05-26 (Mon, 26 May 2014)

  Changed paths:
    M hw/net/cadence_gem.c

  Log Message:
  -----------
  net: cadence_gem: Fix top comment

To indicate Cadence GEM not Xilinx.

Signed-off-by: Peter Crosthwaite <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>


  Commit: 1687a089f103f9b7a1b4a1555068054cb46ee9e9
      
https://github.com/qemu/qemu/commit/1687a089f103f9b7a1b4a1555068054cb46ee9e9
  Author: Michael Tokarev <address@hidden>
  Date:   2014-05-26 (Mon, 26 May 2014)

  Changed paths:
    M libcacard/cac.c
    M libcacard/card_7816.c
    M libcacard/vcard.c
    M libcacard/vcard_emul_nss.c
    M libcacard/vreader.c
    M libcacard/vscclient.c

  Log Message:
  -----------
  libcacard: remove useless initializers

libcacard has many functions which initializes local variables
at declaration time, which are always assigned some values later
(often right after declaration).  Clean up these initializers.

Signed-off-by: Michael Tokarev <address@hidden>


  Commit: 9474ab1487cc70140099c8500ae4a1947ca966c1
      
https://github.com/qemu/qemu/commit/9474ab1487cc70140099c8500ae4a1947ca966c1
  Author: Peter Maydell <address@hidden>
  Date:   2014-05-27 (Tue, 27 May 2014)

  Changed paths:
    M .gitignore
    M arch_init.c
    M audio/spiceaudio.c
    M audio/wavcapture.c
    M blockdev-nbd.c
    M bsd-user/bsdload.c
    M bsd-user/elfload.c
    M bsd-user/main.c
    M configure
    M dma-helpers.c
    M hw/display/jazz_led.c
    M hw/net/cadence_gem.c
    M hw/pci/pci.c
    M include/qemu/bswap.h
    M iohandler.c
    M libcacard/cac.c
    M libcacard/card_7816.c
    M libcacard/event.c
    M libcacard/vcard.c
    M libcacard/vcard_emul_nss.c
    M libcacard/vreader.c
    M libcacard/vscclient.c
    M nbd.c
    M qemu-nbd.c
    M qemu-nbd.texi
    M vl.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-2014-05-26' 
into staging

trivial patches for 2014-05-26

# gpg: Signature made Mon 26 May 2014 08:17:08 BST using RSA key ID A4C3D7DB
# gpg: Can't check signature: public key not found

* remotes/mjt/tags/trivial-patches-2014-05-26: (23 commits)
  libcacard: remove useless initializers
  net: cadence_gem: Fix top comment
  bsd-user: replace fprintf(stderr, ...) with error_report()
  audio: replace fprintf(stderr, ...) with error_report() in audio
  libcacard: fix wrong array expansion logic
  libcacard/vcard_emul_nss: Drop a redundant conditional
  libcacard: Convert two leftover realloc() to GLib
  libcacard/vreader: Tighten assertion to clarify intent
  libcacard/vreader: Drop broken recovery from failed assertion
  libcacard: Plug memory leaks around vreader_get_reader_list()
  libcacard/vscclient: Bury some dead code
  vl: fix 'name' option to work with -readconfig
  configure: Put tempfiles in a subdir of the build directory
  dma-helpers: avoid calling dma_bdrv_unmap() twice
  arch_init: replace fprintf(stderr, ...) with error_report()
  pci: move dereferencing of root only after verifying valid root pointer
  jazz_led: Add missing break in switch case
  bswap.h: Rename ldl_p, stl_p, etc to ldl_he_p, stl_he_p, etc
  configure: Automatically select GTK+ 3.0 if GTK+ 2.0 is unavailable
  nbd: Miscellaneous typo fixes.
  ...

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/2f21ff25c058...9474ab1487cc

reply via email to

[Prev in Thread] Current Thread [Next in Thread]