qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] a3c2f1: vl: introduce machine_merge_property


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] a3c2f1: vl: introduce machine_merge_property
Date: Mon, 02 Aug 2021 09:22:19 -0700

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: a3c2f12830683e285e1ef32d459717dcdf9b70c6
      
https://github.com/qemu/qemu/commit/a3c2f12830683e285e1ef32d459717dcdf9b70c6
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2021-07-30 (Fri, 30 Jul 2021)

  Changed paths:
    M softmmu/vl.c

  Log Message:
  -----------
  vl: introduce machine_merge_property

It will be used to parse smp-opts config groups from configuration
files.  The point to note is that it does not steal a reference
from the caller.  This is better because this function will be called
from qemu_config_foreach's callback; qemu_config_foreach does not cede
its reference to the qdict to the callback, and wants to free it.  To
balance that extra reference, machine_parse_property_opt now needs
a qobject_unref.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: e4383ca240d804bf1c472ed004d6c7b8a505fc63
      
https://github.com/qemu/qemu/commit/e4383ca240d804bf1c472ed004d6c7b8a505fc63
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2021-07-30 (Fri, 30 Jul 2021)

  Changed paths:
    M softmmu/vl.c

  Log Message:
  -----------
  vl: stop recording -smp in QemuOpts

-readconfig is still recording SMP options in QemuOpts instead of
using machine_opts_dict.  This means that SMP options from -readconfig
are ignored.

Just stop using QemuOpts for -smp, making it return false for
is_qemuopts_group.  Configuration files will merge the values in
machine_opts_dict using the new function machine_merge_property.

At the same time, fix -mem-prealloc which looked at QemuOpts to find the
number of guest CPUs, which it used as the default number of preallocation
threads.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: d4b3d152ee005825520dc171e1e650174ae5ebe6
      
https://github.com/qemu/qemu/commit/d4b3d152ee005825520dc171e1e650174ae5ebe6
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2021-07-30 (Fri, 30 Jul 2021)

  Changed paths:
    M scripts/coverity-scan/model.c

  Log Message:
  -----------
  coverity-model: update address_space_read/write models

Use void * for consistency with the actual function; provide a model
for MemoryRegionCache functions and for address_space_rw.  These
let Coverity understand the bounds of the data that various functions
read and write even at very high levels of inlining (e.g. pci_dma_read).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 243a545bffc7e86c0f5ae97c0f7d32c079ab78a3
      
https://github.com/qemu/qemu/commit/243a545bffc7e86c0f5ae97c0f7d32c079ab78a3
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2021-07-30 (Fri, 30 Jul 2021)

  Changed paths:
    M scripts/coverity-scan/model.c

  Log Message:
  -----------
  coverity-model: make g_free a synonym of free

Recently, Coverity has started complaining about using g_free() to free
memory areas allocated by GLib functions not included in model.c,
such as g_strfreev.  This unfortunately goes against the GLib
documentation, which suggests that g_malloc() should be matched
with g_free() and plain malloc() with free(); since GLib 2.46 however
g_malloc() is hardcoded to always use the system malloc implementation,
and g_free is just "free" plus a tracepoint.  Therefore, this
should not cause any problem in practice.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 96915d638cb83aa139e39096815b8dd9832f264b
      
https://github.com/qemu/qemu/commit/96915d638cb83aa139e39096815b8dd9832f264b
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2021-07-30 (Fri, 30 Jul 2021)

  Changed paths:
    M scripts/coverity-scan/model.c

  Log Message:
  -----------
  coverity-model: remove model for more allocation functions

These models are not needed anymore now that Coverity does not check
anymore that the result is used with "g_free".  Coverity understands
GCC attributes and uses them to detect leaks.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 05ad6857a57238c27df84f6c0c1943dd162a82ad
      
https://github.com/qemu/qemu/commit/05ad6857a57238c27df84f6c0c1943dd162a82ad
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2021-07-30 (Fri, 30 Jul 2021)

  Changed paths:
    M scripts/coverity-scan/model.c

  Log Message:
  -----------
  coverity-model: clean up the models for array allocation functions

sz is only used in one place, so replace it with nmemb * size in
that one place.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 0da41187dfda6abecbcbc237471254ab614e063d
      
https://github.com/qemu/qemu/commit/0da41187dfda6abecbcbc237471254ab614e063d
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2021-07-30 (Fri, 30 Jul 2021)

  Changed paths:
    M scripts/coverity-scan/model.c

  Log Message:
  -----------
  coverity-model: constrain g_malloc/g_malloc0/g_realloc as never returning NULL

g_malloc/g_malloc0/g_realloc only return NULL if the size is 0; we do not need
to cover that in the model, and so far have expected __coverity_alloc__
to model a non-NULL return value.  But that apparently does not work
anymore, so add some extra conditionals that invoke __coverity_panic__
for NULL pointers.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: e17bdaab2b36db54f0214a14f394fa773cee58df
      
https://github.com/qemu/qemu/commit/e17bdaab2b36db54f0214a14f394fa773cee58df
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2021-07-30 (Fri, 30 Jul 2021)

  Changed paths:
    M scripts/coverity-scan/model.c

  Log Message:
  -----------
  coverity-model: write models fully for non-array allocation functions

Coverity seems to have issues figuring out the properties of g_malloc0
and other non *_n functions.  While this was "fixed" by removing the
custom second argument to __coverity_mark_as_afm_allocated__, inline
the code from the array-based allocation functions to avoid future
issues.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 7f1cab9c628a798ae2607940993771e6300e9e00
      
https://github.com/qemu/qemu/commit/7f1cab9c628a798ae2607940993771e6300e9e00
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2021-08-02 (Mon, 02 Aug 2021)

  Changed paths:
    M scripts/coverity-scan/model.c
    M softmmu/vl.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into 
staging

Fix for smp-opts in configuration file.
Update Coverity model to what's currently uploaded.

# gpg: Signature made Mon 02 Aug 2021 11:06:41 BST
# gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg:                issuer "pbonzini@redhat.com"
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [full]
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* remotes/bonzini-gitlab/tags/for-upstream:
  coverity-model: write models fully for non-array allocation functions
  coverity-model: constrain g_malloc/g_malloc0/g_realloc as never returning NULL
  coverity-model: clean up the models for array allocation functions
  coverity-model: remove model for more allocation functions
  coverity-model: make g_free a synonym of free
  coverity-model: update address_space_read/write models
  vl: stop recording -smp in QemuOpts
  vl: introduce machine_merge_property

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/526f1f3a5c67...7f1cab9c628a



reply via email to

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