Skip to content
Snippets Groups Projects
  1. Feb 02, 2021
  2. Jan 28, 2021
  3. Jan 27, 2021
    • Kevin Wolf's avatar
      block: Separate blk_is_writable() and blk_supports_write_perm() · 86b1cf32
      Kevin Wolf authored
      Currently, blk_is_read_only() tells whether a given BlockBackend can
      only be used in read-only mode because its root node is read-only. Some
      callers actually try to answer a slightly different question: Is the
      BlockBackend configured to be writable, by taking write permissions on
      the root node?
      
      This can differ, for example, for CD-ROM devices which don't take write
      permissions, but may be backed by a writable image file. scsi-cd allows
      write requests to the drive if blk_is_read_only() returns false.
      However, the write request will immediately run into an assertion
      failure because the write permission is missing.
      
      This patch introduces separate functions for both questions.
      blk_supports_write_perm() answers the question whether the block
      node/image file can support writable devices, whereas blk_is_writable()
      tells whether the BlockBackend is currently configured to be writable.
      
      All calls of blk_is_read_only() are converted to one of the two new
      functions.
      
      Fixes: https://bugs.launchpad.net/bugs/1906693
      
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Message-Id: <20210118123448.307825-2-kwolf@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      86b1cf32
  4. Jan 26, 2021
  5. Jan 13, 2021
  6. Jan 12, 2021
  7. Jan 08, 2021
  8. Jan 02, 2021
  9. 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
  10. Dec 18, 2020
Loading