Skip to content
Snippets Groups Projects
  1. Mar 07, 2023
  2. Feb 27, 2023
  3. Feb 15, 2023
  4. Feb 14, 2023
  5. Feb 08, 2023
  6. Jan 20, 2023
    • Markus Armbruster's avatar
      coroutine: Split qemu/coroutine-core.h off qemu/coroutine.h · 68ba85ce
      Markus Armbruster authored
      
      qemu/coroutine.h and qemu/lockable.h include each other.
      
      They need each other only in macro expansions, so we could simply drop
      both inclusions to break the loop, and add suitable includes to files
      that expand the macros.
      
      Instead, move a part of qemu/coroutine.h to new qemu/coroutine-core.h
      so that qemu/coroutine-core.h doesn't need qemu/lockable.h, and
      qemu/lockable.h only needs qemu/coroutine-core.h.  Result:
      qemu/coroutine.h includes qemu/lockable.h includes
      qemu/coroutine-core.h.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20221221131435.3851212-5-armbru@redhat.com>
      [Semantic rebase conflict with 7c10cb38 "accel/tcg: Add debuginfo
      support" resolved]
      68ba85ce
  7. Jan 19, 2023
  8. Jan 08, 2023
    • Markus Armbruster's avatar
      include/hw/pci: Split pci_device.h off pci.h · edf5ca5d
      Markus Armbruster authored
      
      PCIDeviceClass and PCIDevice are defined in pci.h.  Many users of the
      header don't actually need them.  Similar structs live in their own
      headers: PCIBusClass and PCIBus in pci_bus.h, PCIBridge in
      pci_bridge.h, PCIHostBridgeClass and PCIHostState in pci_host.h,
      PCIExpressHost in pcie_host.h, and PCIERootPortClass, PCIEPort, and
      PCIESlot in pcie_port.h.
      
      Move PCIDeviceClass and PCIDeviceClass to new pci_device.h, along with
      the code that needs them.  Adjust include directives.
      
      This also enables the next commit.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20221222100330.380143-6-armbru@redhat.com>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      edf5ca5d
  9. Dec 14, 2022
    • Markus Armbruster's avatar
      qapi ui: Elide redundant has_FOO in generated C · 3f41a3ad
      Markus Armbruster authored
      
      The has_FOO for pointer-valued FOO are redundant, except for arrays.
      They are also a nuisance to work with.  Recent commit "qapi: Start to
      elide redundant has_FOO in generated C" provided the means to elide
      them step by step.  This is the step for qapi/ui.json.
      
      Said commit explains the transformation in more detail.  The invariant
      violations mentioned there do not occur here.
      
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      Message-Id: <20221104160712.3005652-28-armbru@redhat.com>
      3f41a3ad
    • Markus Armbruster's avatar
      qapi block: Elide redundant has_FOO in generated C · 54fde4ff
      Markus Armbruster authored
      
      The has_FOO for pointer-valued FOO are redundant, except for arrays.
      They are also a nuisance to work with.  Recent commit "qapi: Start to
      elide redundant has_FOO in generated C" provided the means to elide
      them step by step.  This is the step for qapi/block*.json.
      
      Said commit explains the transformation in more detail.
      
      There is one instance of the invariant violation mentioned there:
      qcow2_signal_corruption() passes false, "" when node_name is an empty
      string.  Take care to pass NULL then.
      
      The previous two commits cleaned up two more.
      
      Additionally, helper bdrv_latency_histogram_stats() loses its output
      parameters and returns a value instead.
      
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Hanna Reitz <hreitz@redhat.com>
      Cc: qemu-block@nongnu.org
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20221104160712.3005652-11-armbru@redhat.com>
      [Fixes for #ifndef LIBRBD_SUPPORTS_ENCRYPTION and MacOS squashed in]
      54fde4ff
    • Markus Armbruster's avatar
      error: Drop a few superfluous ERRP_GUARD() · 740d6c4e
      Markus Armbruster authored
      
      include/qapi/error.h on ERRP_GUARD():
      
       * It must be used when the function dereferences @errp or passes
       * @errp to error_prepend(), error_vprepend(), or error_append_hint().
       * It is safe to use even when it's not needed, but please avoid
       * cluttering the source with useless code.
      
      Clean up some of this clutter.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20221121085054.683122-3-armbru@redhat.com>
      740d6c4e
  10. Nov 23, 2022
  11. Nov 08, 2022
  12. Nov 06, 2022
    • Claudio Fontana's avatar
      module: add Error arguments to module_load and module_load_qom · c551fb0b
      Claudio Fontana authored
      
      improve error handling during module load, by changing:
      
      bool module_load(const char *prefix, const char *lib_name);
      void module_load_qom(const char *type);
      
      to:
      
      int module_load(const char *prefix, const char *name, Error **errp);
      int module_load_qom(const char *type, Error **errp);
      
      where the return value is:
      
       -1 on module load error, and errp is set with the error
        0 on module or one of its dependencies are not installed
        1 on module load success
        2 on module load success (module already loaded or built-in)
      
      module_load_qom_one has been introduced in:
      
      commit 28457744 ("module: qom module support"), which built on top of
      module_load_one, but discarded the bool return value. Restore it.
      
      Adapt all callers to emit errors, or ignore them, or fail hard,
      as appropriate in each context.
      
      Replace the previous emission of errors via fprintf in _some_ error
      conditions with Error and error_report, so as to emit to the appropriate
      target.
      
      A memory leak is also fixed as part of the module_load changes.
      
      audio: when attempting to load an audio module, report module load errors.
      Note that still for some callers, a single issue may generate multiple
      error reports, and this could be improved further.
      Regarding the audio code itself, audio_add() seems to ignore errors,
      and this should probably be improved.
      
      block: when attempting to load a block module, report module load errors.
      For the code paths that already use the Error API, take advantage of those
      to report module load errors into the Error parameter.
      For the other code paths, we currently emit the error, but this could be
      improved further by adding Error parameters to all possible code paths.
      
      console: when attempting to load a display module, report module load errors.
      
      qdev: when creating a new qdev Device object (DeviceState), report load errors.
            If a module cannot be loaded to create that device, now abort execution
            (if no CONFIG_MODULE) or exit (if CONFIG_MODULE).
      
      qom/object.c: when initializing a QOM object, or looking up class_by_name,
                    report module load errors.
      
      qtest: when processing the "module_load" qtest command, report errors
             in the load of the module.
      
      Signed-off-by: default avatarClaudio Fontana <cfontana@suse.de>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-Id: <20220929093035.4231-4-cfontana@suse.de>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      c551fb0b
    • Claudio Fontana's avatar
      module: rename module_load_one to module_load · dbc0e805
      Claudio Fontana authored
      
      Signed-off-by: default avatarClaudio Fontana <cfontana@suse.de>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-Id: <20220929093035.4231-3-cfontana@suse.de>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      dbc0e805
  13. Oct 24, 2022
  14. Oct 22, 2022
  15. Oct 12, 2022
  16. Oct 11, 2022
  17. Sep 29, 2022
    • Paolo Bonzini's avatar
      ui: fix path to dbus-display1.h · 0e902f59
      Paolo Bonzini authored
      
      While the source directory is always included in the include path,
      the corresponding directory in the build tree is not.  Therefore,
      custom_targets (e.g. ui/dbus-display1.h) must be referred to using
      the full path.
      
      This avoids a build failure when ui/dbus-chardev.c is not built as
      a module:
      
      In file included from ../ui/dbus-chardev.c:32:
      ../ui/dbus.h:34:10: fatal error: dbus-display1.h: No such file or directory
         34 | #include "dbus-display1.h"
            |          ^~~~~~~~~~~~~~~~~
      
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      0e902f59
  18. Sep 23, 2022
Loading