Skip to content
Snippets Groups Projects
  1. Dec 21, 2020
  2. Dec 19, 2020
    • Markus Armbruster's avatar
      qobject: Change qobject_to_json()'s value to GString · eab3a467
      Markus Armbruster authored
      
      qobject_to_json() and qobject_to_json_pretty() build a GString, then
      covert it to QString.  Just one of the callers actually needs a
      QString: qemu_rbd_parse_filename().  A few others need a string they
      can modify: qmp_send_response(), qga's send_response(), to_json_str(),
      and qmp_fd_vsend_fds().  The remainder just need a string.
      
      Change qobject_to_json() and qobject_to_json_pretty() to return the
      GString.
      
      qemu_rbd_parse_filename() now has to convert to QString.  All others
      save a QString temporary.  to_json_str() actually becomes a bit
      simpler, because GString provides more convenient modification
      functions.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20201211171152.146877-6-armbru@redhat.com>
      eab3a467
    • Eric Blake's avatar
      qapi: Use QAPI_LIST_PREPEND() where possible · 54aa3de7
      Eric Blake authored
      
      Anywhere we create a list of just one item or by prepending items
      (typically because order doesn't matter), we can use
      QAPI_LIST_PREPEND().  But places where we must keep the list in order
      by appending remain open-coded until later patches.
      
      Note that as a side effect, this also performs a cleanup of two minor
      issues in qga/commands-posix.c: the old code was performing
       new = g_malloc0(sizeof(*ret));
      which 1) is confusing because you have to verify whether 'new' and
      'ret' are variables with the same type, and 2) would conflict with C++
      compilation (not an actual problem for this file, but makes
      copy-and-paste harder).
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <20201113011340.463563-5-eblake@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Acked-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      [Straightforward conflicts due to commit a8aa94b5 "qga: update
      schema for guest-get-disks 'dependents' field" and commit a10b453a
      "target/mips: Move mips_cpu_add_definition() from helper.c to cpu.c"
      resolved.  Commit message tweaked.]
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      54aa3de7
  3. Dec 10, 2020
  4. Nov 18, 2020
  5. Nov 16, 2020
    • Michael Roth's avatar
      qga: update schema for guest-get-disks 'dependents' field · a8aa94b5
      Michael Roth authored
      
      The recently-added 'guest-get-disk' command returns a list of
      GuestDiskInfo entries, which in turn have a 'dependents' field which
      lists devices these entries are dependent upon. Thus, 'dependencies'
      is a better name for this field. Address this by renaming the field
      accordingly.
      
      Additionally, 'dependents' is specified as non-optional, even though
      it's not implemented for w32. This is misleading, since it gives users
      the impression that a particular disk might not have dependencies,
      when in reality that information is simply not known to the guest
      agent. Address this by making 'dependents' an optional field, and only
      marking it as in-use when the facilities to obtain this information are
      available to the guest agent.
      
      Cc: Eric Blake <eblake@redhat.com>
      Cc: Tomáš Golembiovský <tgolembi@redhat.com>
      Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: default avatarMichael Roth <michael.roth@amd.com>
      a8aa94b5
  6. Nov 09, 2020
  7. Nov 03, 2020
  8. Nov 02, 2020
  9. Oct 09, 2020
  10. Sep 30, 2020
  11. Sep 29, 2020
  12. Sep 23, 2020
    • Stefan Hajnoczi's avatar
      qemu/atomic.h: rename atomic_ to qatomic_ · d73415a3
      Stefan Hajnoczi authored
      
      clang's C11 atomic_fetch_*() functions only take a C11 atomic type
      pointer argument. QEMU uses direct types (int, etc) and this causes a
      compiler error when a QEMU code calls these functions in a source file
      that also included <stdatomic.h> via a system header file:
      
        $ CC=clang CXX=clang++ ./configure ... && make
        ../util/async.c:79:17: error: address argument to atomic operation must be a pointer to _Atomic type ('unsigned int *' invalid)
      
      Avoid using atomic_*() names in QEMU's atomic.h since that namespace is
      used by <stdatomic.h>. Prefix QEMU's APIs with 'q' so that atomic.h
      and <stdatomic.h> can co-exist. I checked /usr/include on my machine and
      searched GitHub for existing "qatomic_" users but there seem to be none.
      
      This patch was generated using:
      
        $ git grep -h -o '\<atomic\(64\)\?_[a-z0-9_]\+' include/qemu/atomic.h | \
          sort -u >/tmp/changed_identifiers
        $ for identifier in $(</tmp/changed_identifiers); do
              sed -i "s%\<$identifier\>%q$identifier%g" \
                  $(git grep -I -l "\<$identifier\>")
          done
      
      I manually fixed line-wrap issues and misaligned rST tables.
      
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Acked-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20200923105646.47864-1-stefanha@redhat.com>
      d73415a3
  13. Sep 16, 2020
  14. Sep 13, 2020
  15. Sep 01, 2020
  16. Aug 21, 2020
  17. Aug 03, 2020
    • Andrea Bolognani's avatar
      schemas: Add vim modeline · f7160f32
      Andrea Bolognani authored
      
      The various schemas included in QEMU use a JSON-based format which
      is, however, strictly speaking not valid JSON.
      
      As a consequence, when vim tries to apply syntax highlight rules
      for JSON (as guessed from the file name), the result is an unreadable
      mess which mostly consist of red markers pointing out supposed errors
      in, well, pretty much everything.
      
      Using Python syntax highlighting produces much better results, and
      in fact these files already start with specially-formatted comments
      that instruct Emacs to process them as if they were Python files.
      
      This commit adds the equivalent special comments for vim.
      
      Signed-off-by: default avatarAndrea Bolognani <abologna@redhat.com>
      Message-Id: <20200729185024.121766-1-abologna@redhat.com>
      Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      Reviewed-by: default avatarJohn Snow <jsnow@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      f7160f32
  18. Jul 27, 2020
Loading