Skip to content
Snippets Groups Projects
  1. May 02, 2021
  2. Jan 08, 2021
  3. Dec 18, 2020
  4. Sep 18, 2020
  5. Sep 09, 2020
  6. Aug 21, 2020
  7. Jul 17, 2020
    • Cédric Le Goater's avatar
      ipmi: add SET_SENSOR_READING command · e3f7320c
      Cédric Le Goater authored
      
      SET_SENSOR_READING is a complex IPMI command (see IPMI spec 35.17)
      which enables the host software to set the reading value and the event
      status of sensors supporting it.
      
      Below is a proposal for all the operations (reading, assert, deassert,
      event data) with the following limitations :
      
       - No event are generated for threshold-based sensors.
       - The case in which the BMC needs to generate its own events is not
         supported.
      
      Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
      Reviewed-by: default avatarCorey Minyard <cminyard@mvista.com>
      Message-Id: <20191118092429.16149-1-clg@kaod.org>
      [Moved the break statement for case SENSOR_GEN_EVENT_DATA above the
       closing brace to keep the indention consistent.]
      Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
      e3f7320c
  8. May 15, 2020
    • Philippe Mathieu-Daudé's avatar
      various: Remove unnecessary OBJECT() cast · 688ffbb4
      Philippe Mathieu-Daudé authored
      
      The OBJECT() macro is defined as:
      
        #define OBJECT(obj) ((Object *)(obj))
      
      Remove the unnecessary OBJECT() casts when we already know the
      pointer is of Object type.
      
      Patch created mechanically using spatch with this script:
      
        @@
        typedef Object;
        Object *o;
        @@
        -   OBJECT(o)
        +   o
      
      Acked-by: default avatarCornelia Huck <cohuck@redhat.com>
      Acked-by: default avatarCorey Minyard <cminyard@mvista.com>
      Acked-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <20200512070020.22782-3-f4bug@amsat.org>
      [Trivial rebase conflict in hw/s390x/sclp.c resolved]
      688ffbb4
    • Markus Armbruster's avatar
      qom: Drop parameter @errp of object_property_add() & friends · d2623129
      Markus Armbruster authored
      
      The only way object_property_add() can fail is when a property with
      the same name already exists.  Since our property names are all
      hardcoded, failure is a programming error, and the appropriate way to
      handle it is passing &error_abort.
      
      Same for its variants, except for object_property_add_child(), which
      additionally fails when the child already has a parent.  Parentage is
      also under program control, so this is a programming error, too.
      
      We have a bit over 500 callers.  Almost half of them pass
      &error_abort, slightly fewer ignore errors, one test case handles
      errors, and the remaining few callers pass them to their own callers.
      
      The previous few commits demonstrated once again that ignoring
      programming errors is a bad idea.
      
      Of the few ones that pass on errors, several violate the Error API.
      The Error ** argument must be NULL, &error_abort, &error_fatal, or a
      pointer to a variable containing NULL.  Passing an argument of the
      latter kind twice without clearing it in between is wrong: if the
      first call sets an error, it no longer points to NULL for the second
      call.  ich9_pm_add_properties(), sparc32_ledma_realize(),
      sparc32_dma_realize(), xilinx_axidma_realize(), xilinx_enet_realize()
      are wrong that way.
      
      When the one appropriate choice of argument is &error_abort, letting
      users pick the argument is a bad idea.
      
      Drop parameter @errp and assert the preconditions instead.
      
      There's one exception to "duplicate property name is a programming
      error": the way object_property_add() implements the magic (and
      undocumented) "automatic arrayification".  Don't drop @errp there.
      Instead, rename object_property_add() to object_property_try_add(),
      and add the obvious wrapper object_property_add().
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20200505152926.18877-15-armbru@redhat.com>
      [Two semantic rebase conflicts resolved]
      d2623129
  9. Jan 24, 2020
  10. Jan 08, 2020
  11. Jan 07, 2020
  12. Dec 18, 2019
    • Markus Armbruster's avatar
      hw/ipmi: Fix realize() error API violations · f6166a4d
      Markus Armbruster authored
      
      isa_ipmi_bt_realize(), ipmi_isa_realize(), pci_ipmi_bt_realize(), and
      pci_ipmi_kcs_realize() dereference @errp when IPMIInterfaceClass
      method init() fails.  That's wrong; see the big comment in error.h.
      Introduced in commit 0719029c "ipmi: Add an ISA KCS low-level
      interface", then imitated in commit a9b74079 "ipmi: Add a BT
      low-level interface" and commit 12f983c6 "ipmi: Add PCI IPMI
      interfaces".
      
      No caller actually passes null.
      
      Fix anyway: splice in a local Error *err, and error_propagate().
      
      Cc: Corey Minyard <cminyard@mvista.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20191204093625.14836-9-armbru@redhat.com>
      f6166a4d
  13. Dec 16, 2019
  14. Sep 20, 2019
  15. Aug 21, 2019
  16. Aug 16, 2019
    • Markus Armbruster's avatar
      sysemu: Split sysemu/runstate.h off sysemu/sysemu.h · 54d31236
      Markus Armbruster authored
      
      sysemu/sysemu.h is a rather unfocused dumping ground for stuff related
      to the system-emulator.  Evidence:
      
      * It's included widely: in my "build everything" tree, changing
        sysemu/sysemu.h still triggers a recompile of some 1100 out of 6600
        objects (not counting tests and objects that don't depend on
        qemu/osdep.h, down from 5400 due to the previous two commits).
      
      * It pulls in more than a dozen additional headers.
      
      Split stuff related to run state management into its own header
      sysemu/runstate.h.
      
      Touching sysemu/sysemu.h now recompiles some 850 objects.  qemu/uuid.h
      also drops from 1100 to 850, and qapi/qapi-types-run-state.h from 4400
      to 4200.  Touching new sysemu/runstate.h recompiles some 500 objects.
      
      Since I'm touching MAINTAINERS to add sysemu/runstate.h anyway, also
      add qemu/main-loop.h.
      
      Suggested-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190812052359.30071-30-armbru@redhat.com>
      Reviewed-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      [Unbreak OS-X build]
      54d31236
    • Markus Armbruster's avatar
      Clean up inclusion of sysemu/sysemu.h · d5938f29
      Markus Armbruster authored
      
      In my "build everything" tree, changing sysemu/sysemu.h triggers a
      recompile of some 5400 out of 6600 objects (not counting tests and
      objects that don't depend on qemu/osdep.h).
      
      Almost a third of its inclusions are actually superfluous.  Delete
      them.  Downgrade two more to qapi/qapi-types-run-state.h, and move one
      from char/serial.h to char/serial.c.
      
      hw/semihosting/config.c, monitor/monitor.c, qdev-monitor.c, and
      stubs/semihost.c define variables declared in sysemu/sysemu.h without
      including it.  The compiler is cool with that, but include it anyway.
      
      This doesn't reduce actual use much, as it's still included into
      widely included headers.  The next commit will tackle that.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Message-Id: <20190812052359.30071-27-armbru@redhat.com>
      Reviewed-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      d5938f29
    • Markus Armbruster's avatar
      Include hw/qdev-properties.h less · a27bd6c7
      Markus Armbruster authored
      
      In my "build everything" tree, changing hw/qdev-properties.h triggers
      a recompile of some 2700 out of 6600 objects (not counting tests and
      objects that don't depend on qemu/osdep.h).
      
      Many places including hw/qdev-properties.h (directly or via hw/qdev.h)
      actually need only hw/qdev-core.h.  Include hw/qdev-core.h there
      instead.
      
      hw/qdev.h is actually pointless: all it does is include hw/qdev-core.h
      and hw/qdev-properties.h, which in turn includes hw/qdev-core.h.
      Replace the remaining uses of hw/qdev.h by hw/qdev-properties.h.
      
      While there, delete a few superfluous inclusions of hw/qdev-core.h.
      
      Touching hw/qdev-properties.h now recompiles some 1200 objects.
      
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: "Daniel P. Berrangé" <berrange@redhat.com>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <20190812052359.30071-22-armbru@redhat.com>
      a27bd6c7
    • Markus Armbruster's avatar
      Include hw/hw.h exactly where needed · 650d103d
      Markus Armbruster authored
      
      In my "build everything" tree, changing hw/hw.h triggers a recompile
      of some 2600 out of 6600 objects (not counting tests and objects that
      don't depend on qemu/osdep.h).
      
      The previous commits have left only the declaration of hw_error() in
      hw/hw.h.  This permits dropping most of its inclusions.  Touching it
      now recompiles less than 200 objects.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Message-Id: <20190812052359.30071-19-armbru@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Tested-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      650d103d
    • Markus Armbruster's avatar
      Include migration/vmstate.h less · d6454270
      Markus Armbruster authored
      
      In my "build everything" tree, changing migration/vmstate.h triggers a
      recompile of some 2700 out of 6600 objects (not counting tests and
      objects that don't depend on qemu/osdep.h).
      
      hw/hw.h supposedly includes it for convenience.  Several other headers
      include it just to get VMStateDescription.  The previous commit made
      that unnecessary.
      
      Include migration/vmstate.h only where it's still needed.  Touching it
      now recompiles only some 1600 objects.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Message-Id: <20190812052359.30071-16-armbru@redhat.com>
      Tested-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      d6454270
    • Markus Armbruster's avatar
      Include hw/irq.h a lot less · 64552b6b
      Markus Armbruster authored
      
      In my "build everything" tree, changing hw/irq.h triggers a recompile
      of some 5400 out of 6600 objects (not counting tests and objects that
      don't depend on qemu/osdep.h).
      
      hw/hw.h supposedly includes it for convenience.  Several other headers
      include it just to get qemu_irq and.or qemu_irq_handler.
      
      Move the qemu_irq and qemu_irq_handler typedefs from hw/irq.h to
      qemu/typedefs.h, and then include hw/irq.h only where it's still
      needed.  Touching it now recompiles only some 500 objects.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Tested-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Message-Id: <20190812052359.30071-13-armbru@redhat.com>
      64552b6b
  17. Jun 12, 2019
  18. Mar 07, 2019
  19. Aug 23, 2018
    • Corey Minyard's avatar
      ipmi: Use proper struct reference for BT vmstate · efbb649d
      Corey Minyard authored
      
      The vmstate for isa_ipmi_bt was referencing into the bt structure,
      instead create a bt structure separate and use that.
      
      The version 1 of the BT transfer was fairly broken, if a migration
      occured during an IPMI operation, it is likely the migration would
      be corrupted because I misunderstood the VMSTATE_VBUFFER_UINT32()
      handling, I thought it handled transferring the length field,
      too.  So I just remove support for that.  I doubt anyone is using
      it at this point.
      
      This also removes the transfer of use_irq, since that should come
      from configuration.
      
      Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Message-Id: <1534798644-13587-1-git-send-email-minyard@acm.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      efbb649d
  20. Jun 12, 2018
    • Marc-André Lureau's avatar
      object: fix OBJ_PROP_LINK_UNREF_ON_RELEASE ambivalence · 265b578c
      Marc-André Lureau authored
      
      A link property can be set during creation, with
      object_property_add_link() and later with object_property_set_link().
      
      add_link() doesn't add a reference to the target object, while
      set_link() does.
      
      Furthemore, OBJ_PROP_LINK_UNREF_ON_RELEASE flags, set during add_link,
      says whether a reference must be released when the property is destroyed.
      This can lead to leaks if the property was later set_link(), as the
      added reference is never released.
      
      Instead, rename OBJ_PROP_LINK_UNREF_ON_RELEASE to OBJ_PROP_LINK_STRONG
      and use that has an indication on how the link handle reference
      management in set_link().
      
      Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-id: 20180531195119.22021-3-marcandre.lureau@redhat.com
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      265b578c
  21. Jun 01, 2018
    • Corey Minyard's avatar
      ipmi: Use proper struct reference for KCS vmstate · 7e57b82e
      Corey Minyard authored
      
      The vmstate for isa_ipmi_kcs was referencing into the kcs structure,
      instead create a kcs structure separate and use that.
      
      There were also some issues in the state transfer.  The inlen field
      was not being transferred, so if a transaction was in process during
      the transfer it would be messed up.  And the use_irq field was
      transferred, but that should come from the configuration.
      
      To fix this, the new VMS_VSTRUCT macros are used so the exact
      version of the structure can be specified, depending on what
      version was being received.  So an upgrade should work for KCS.
      
      Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
      Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
      Message-Id: <1524670052-28373-3-git-send-email-minyard@acm.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      7e57b82e
  22. Mar 02, 2018
    • Markus Armbruster's avatar
      qapi: Empty out qapi-schema.json · 112ed241
      Markus Armbruster authored
      
      The previous commit improved compile time by including less of the
      generated QAPI headers.  This is impossible for stuff defined directly
      in qapi-schema.json, because that ends up in headers that that pull in
      everything.
      
      Move everything but include directives from qapi-schema.json to new
      sub-module qapi/misc.json, then include just the "misc" shard where
      possible.
      
      It's possible everywhere, except:
      
      * monitor.c needs qmp-command.h to get qmp_init_marshal()
      
      * monitor.c, ui/vnc.c and the generated qapi-event-FOO.c need
        qapi-event.h to get enum QAPIEvent
      
      Perhaps we'll get rid of those some other day.
      
      Adding a type to qapi/migration.json now recompiles some 120 instead
      of 2300 out of 5100 objects.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20180211093607.27351-25-armbru@redhat.com>
      [eblake: rebase to master]
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      112ed241
Loading