Skip to content
Snippets Groups Projects
  1. Sep 19, 2017
    • Alistair Francis's avatar
      Convert single line fprintf(.../n) to warn_report() · 2ab4b135
      Alistair Francis authored
      
      Convert all the single line uses of fprintf(stderr, "warning:"..."\n"...
      to use warn_report() instead. This helps standardise on a single
      method of printing warnings to the user.
      
      All of the warnings were changed using this command:
        find ./* -type f -exec sed -i \
          's|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig' \
          {} +
      
      Some of the lines were manually edited to reduce the line length to below
      80 charecters.
      
      The #include lines were manually updated to allow the code to compile.
      
      Signed-off-by: default avatarAlistair Francis <alistair.francis@xilinx.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Igor Mammedov <imammedo@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: Yongbok Kim <yongbok.kim@imgtec.com>
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: James Hogan <james.hogan@imgtec.com> [mips]
      Message-Id: <ae8f8a7f0a88ded61743dff2adade21f8122a9e7.1505158760.git.alistair.francis@xilinx.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      2ab4b135
  2. Aug 08, 2017
  3. Jul 18, 2017
  4. Jul 17, 2017
  5. Jul 11, 2017
  6. Jun 20, 2017
  7. Jun 04, 2017
  8. May 09, 2017
  9. May 07, 2017
  10. Apr 27, 2017
  11. Apr 24, 2017
  12. Mar 30, 2017
    • Michael Roth's avatar
      qga: don't fail if mount doesn't have slave devices · 8251a72f
      Michael Roth authored
      
      In some cases the slave devices of a virtual block device are tracked
      by the parent in the corresponding sysfs node. For instance, if we
      have a loop-back mount of the form:
      
        /dev/loop3p1 on /home/mdroth/mnt type ext4 (rw,relatime,data=ordered)
      
      this will be reflected in sysfs as:
      
        /sys/devices/virtual/block/loop3/
        ...
        /sys/devices/virtual/block/loop3/slaves
        /sys/devices/virtual/block/loop3/loop3p1
      
      The current code however assumes the mounted virtual block device,
      loop3p1 in this case, contains the slaves directory, and reports an
      error otherwise. This breaks 'make check' in certain environments.
      
      Fix this by simply skipping attempts to generate disk topology
      information in these cases. Since this information is documented
      in QAPI as optionally-reported, this should be ok from an API
      perspective.
      
      In the future, this can possibly be improved upon by collecting
      topology information from the parent in these cases.
      
      Reported-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarMichael Roth <mdroth@linux.vnet.ibm.com>
      Tested-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      8251a72f
  13. Mar 19, 2017
    • Paolo Bonzini's avatar
      qemu-ga: obey LISTEN_PID when using systemd socket activation · 53fabd4b
      Paolo Bonzini authored
      
      qemu-ga's socket activation support was not obeying the LISTEN_PID
      environment variable, which avoids that a process uses a socket-activation
      file descriptor meant for its parent.
      
      Mess can for example ensue if a process forks a children before consuming
      the socket-activation file descriptor and therefore setting O_CLOEXEC
      on it.
      
      Luckily, qemu-nbd also got socket activation code, and its copy does
      support LISTEN_PID.  Some extra fixups are needed to ensure that the
      code can be used for both, but that's what this patch does.  The
      main change is to replace get_listen_fds's "consume" argument with
      the FIRST_SOCKET_ACTIVATION_FD macro from the qemu-nbd code.
      
      Cc: "Richard W.M. Jones" <rjones@redhat.com>
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      53fabd4b
  14. Mar 16, 2017
    • Markus Armbruster's avatar
      qapi: The #optional tag is redundant, drop · 1d8bda12
      Markus Armbruster authored
      
      We traditionally mark optional members #optional in the doc comment.
      Before commit 3313b612, this was entirely manual.
      
      Commit 3313b612 added some automation because its qapi2texi.py relied
      on #optional to determine whether a member is optional.  This is no
      longer the case since the previous commit: the only thing qapi2texi.py
      still does with #optional is stripping it out.  We still reject bogus
      qapi-schema.json and six places for qga/qapi-schema.json.
      
      Thus, you can't actually rely on #optional to see whether something is
      optional.  Yet we still make people add it manually.  That's just
      busy-work.
      
      Drop the code to check, fix up and strip out #optional, along with all
      instances of #optional.  To keep it out, add code to reject it, to be
      dropped again once the dust settles.
      
      No change to generated documentation.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <1489582656-31133-18-git-send-email-armbru@redhat.com>
      1d8bda12
    • Markus Armbruster's avatar
      qapi: Have each QAPI schema declare its returns white-list · 1554a8fa
      Markus Armbruster authored
      
      qapi.py has a hardcoded white-list of command names that may violate
      the rules on permitted return types.  Add a new pragma directive
      'returns-whitelist', and use it to replace the hard-coded white-list.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1489582656-31133-6-git-send-email-armbru@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      1554a8fa
    • Markus Armbruster's avatar
      qapi: Make doc comments optional where we don't need them · bc52d03f
      Markus Armbruster authored
      
      Since we added the documentation generator in commit 3313b612, doc
      comments are mandatory.  That's a very good idea for a schema that
      needs to be documented, but has proven to be annoying for testing.
      
      Make doc comments optional again, but add a new directive
      
          { 'pragma': { 'doc-required': true } }
      
      to let a QAPI schema require them.
      
      Add test cases for the new pragma directive.  While there, plug a
      minor hole in includ directive test coverage.
      
      Require documentation in the schemas we actually want documented:
      qapi-schema.json and qga/qapi-schema.json.
      
      We could probably make qapi2texi.py cope with incomplete
      documentation, but for now, simply make it refuse to run unless the
      schema has 'doc-required': true.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1489582656-31133-3-git-send-email-armbru@redhat.com>
      [qapi-code-gen.txt wording tweaked]
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      bc52d03f
  15. Mar 06, 2017
  16. Mar 05, 2017
    • Markus Armbruster's avatar
      qapi: Support multiple command registries per program · 1527badb
      Markus Armbruster authored
      
      The command registry encapsulates a single command list.  Give the
      functions using it a parameter instead.  Define suitable command lists
      in monitor, guest agent and test-qmp-commands.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1488544368-30622-6-git-send-email-armbru@redhat.com>
      [Debugging turds buried]
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      1527badb
    • Markus Armbruster's avatar
      qmp: Dumb down how we run QMP command registration · 05875687
      Markus Armbruster authored
      
      The way we get QMP commands registered is high tech:
      
      * qapi-commands.py generates qmp_init_marshal() that does the actual work
      
      * it also generates the magic to register it as a MODULE_INIT_QAPI
        function, so it runs when someone calls
        module_call_init(MODULE_INIT_QAPI)
      
      * main() calls module_call_init()
      
      QEMU needs to register a few non-qapified commands.  Same high tech
      works: monitor.c has its own qmp_init_marshal() along with the magic
      to make it run in module_call_init(MODULE_INIT_QAPI).
      
      QEMU also needs to unregister commands that are not wanted in this
      build's configuration (commit 5032a16d).  Simple enough:
      qmp_unregister_commands_hack().  The difficulty is to make it run
      after the generated qmp_init_marshal().  We can't simply run it in
      monitor.c's qmp_init_marshal(), because the order in which the
      registered functions run is indeterminate.  So qmp_init_marshal()
      registers qmp_unregister_commands_hack() separately.  Since
      registering *appends* to the list of registered functions, this will
      make it run after all the functions that have been registered already.
      
      I suspect it takes a long and expensive computer science education to
      not find this silly.
      
      Dumb it down as follows:
      
      * Drop MODULE_INIT_QAPI entirely
      
      * Give the generated qmp_init_marshal() external linkage.
      
      * Call it instead of module_call_init(MODULE_INIT_QAPI)
      
      * Except in QEMU proper, call new monitor_init_qmp_commands() that in
        turn calls the generated qmp_init_marshal(), registers the
        additional commands and unregisters the unwanted ones.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <1488544368-30622-5-git-send-email-armbru@redhat.com>
      05875687
  17. Jan 24, 2017
  18. Jan 16, 2017
  19. Dec 05, 2016
Loading