1. 17 7月, 2017 1 次提交
  2. 10 7月, 2017 14 次提交
  3. 20 6月, 2017 1 次提交
  4. 17 5月, 2017 1 次提交
  5. 09 5月, 2017 1 次提交
  6. 25 4月, 2017 2 次提交
    • J
      block: do not set BDS read_only if copy_on_read enabled · e2b8247a
      Jeff Cody 提交于
      A few block drivers will set the BDS read_only flag from their
      .bdrv_open() function.  This means the bs->read_only flag could
      be set after we enable copy_on_read, as the BDRV_O_COPY_ON_READ
      flag check occurs prior to the call to bdrv->bdrv_open().
      
      This adds an error return to bdrv_set_read_only(), and an error will be
      return if we try to set the BDS to read_only while copy_on_read is
      enabled.
      
      This patch also changes the behavior of vvfat.  Before, vvfat could
      override the drive 'readonly' flag with its own, internal 'rw' flag.
      
      For instance, this -drive parameter would result in a writable image:
      
      "-drive format=vvfat,dir=/tmp/vvfat,rw,if=virtio,readonly=on"
      
      This is not correct.  Now, attempting to use the above -drive parameter
      will result in an error (i.e., 'rw' is incompatible with 'readonly=on').
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 0c5b4c1cc2c651471b131f21376dfd5ea24d2196.1491597120.git.jcody@redhat.com
      e2b8247a
    • J
      block: add bdrv_set_read_only() helper function · fe5241bf
      Jeff Cody 提交于
      We have a helper wrapper for checking for the BDS read_only flag,
      add a helper wrapper to set the read_only flag as well.
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 9b18972d05f5fa2ac16c014f0af98d680553048d.1491597120.git.jcody@redhat.com
      fe5241bf
  7. 13 3月, 2017 1 次提交
    • E
      vvfat: React to bdrv_is_allocated() errors · 6f712ee0
      Eric Blake 提交于
      If bdrv_is_allocated() fails, we should react to that failure.
      For 2 of the 3 callers, reporting the error was easy.  But in
      cluster_was_modified() and its lone caller
      get_cluster_count_for_direntry(), it's rather invasive to update
      the logic to pass the error back; so there, I went with merely
      documenting the issue by changing the return type to bool (in
      all likelihood, treating the cluster as modified will then
      trigger a read which will also fail, and eventually get to an
      error - but given the appalling number of abort() calls in this
      code, I'm not making it any worse).
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      6f712ee0
  8. 01 3月, 2017 2 次提交
  9. 24 2月, 2017 1 次提交
    • K
      vvfat: Use opened node as backing file · a8a4d15c
      Kevin Wolf 提交于
      We should not try to assign a not yet opened node as the backing file,
      because as soon as the permission system is added it will fail.  The
      just added bdrv_new_open_driver() function is the right tool to open a
      file with an internal driver, use it.
      
      In case anyone wonders whether that magic fake backing file to trigger a
      special action on 'commit' actually works today: No, not for me. One
      reason is that we've been adding a raw format driver on top for several
      years now and raw doesn't support commit. Other reasons include that the
      backing file isn't writable and the driver doesn't support reopen, and
      it's also size 0 and the driver doesn't support bdrv_truncate. All of
      these are easily fixable, but then 'commit' ended up in an infinite loop
      deep in the vvfat code for me, so I thought I'd best leave it alone. I'm
      not really sure what it was supposed to do anyway.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      a8a4d15c
  10. 25 1月, 2017 2 次提交
  11. 23 9月, 2016 1 次提交
    • A
      block: Add "read-only" to the options QDict · f87a0e29
      Alberto Garcia 提交于
      This adds the "read-only" option to the QDict. One important effect of
      this change is that when a child inherits options from its parent, the
      existing "read-only" mode can be preserved if it was explicitly set
      previously.
      
      This addresses scenarios like this:
      
         [E] <- [D] <- [C] <- [B] <- [A]
      
      In this case, if we reopen [D] with read-only=off, and later reopen
      [B], then [D] will not inherit read-only=on from its parent during the
      bdrv_reopen_queue_child() stage.
      
      The BDRV_O_RDWR flag is not removed yet, but its keep in sync with the
      value of the "read-only" option.
      Signed-off-by: NAlberto Garcia <berto@igalia.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      f87a0e29
  12. 13 7月, 2016 1 次提交
  13. 05 7月, 2016 6 次提交
  14. 20 6月, 2016 1 次提交
    • E
      coccinelle: Remove unnecessary variables for function return value · 9be38598
      Eduardo Habkost 提交于
      Use Coccinelle script to replace 'ret = E; return ret' with
      'return E'. The script will do the substitution only when the
      function return type and variable type are the same.
      
      Manual fixups:
      
      * audio/audio.c: coding style of "read (...)" and "write (...)"
      * block/qcow2-cluster.c: wrap line to make it shorter
      * block/qcow2-refcount.c: change indentation of wrapped line
      * target-tricore/op_helper.c: fix coding style of
        "remainder|quotient"
      * target-mips/dsp_helper.c: reverted changes because I don't
        want to argue about checkpatch.pl
      * ui/qemu-pixman.c: fix line indentation
      * block/rbd.c: restore blank line between declarations and
        statements
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <1465855078-19435-4-git-send-email-ehabkost@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      [Unused Coccinelle rule name dropped along with a redundant comment;
      whitespace touched up in block/qcow2-cluster.c; stale commit message
      paragraph deleted]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      9be38598
  15. 07 6月, 2016 1 次提交
  16. 26 5月, 2016 1 次提交
    • M
      block: Make bdrv_open() return a BDS · 5b363937
      Max Reitz 提交于
      There are no callers to bdrv_open() or bdrv_open_inherit() left that
      pass a pointer to a non-NULL BDS pointer as the first argument of these
      functions, so we can finally drop that parameter and just make them
      return the new BDS.
      
      Generally, the following pattern is applied:
      
          bs = NULL;
          ret = bdrv_open(&bs, ..., &local_err);
          if (ret < 0) {
              error_propagate(errp, local_err);
              ...
          }
      
      by
      
          bs = bdrv_open(..., errp);
          if (!bs) {
              ret = -EINVAL;
              ...
          }
      
      Of course, there are only a few instances where the pattern is really
      pure.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      5b363937
  17. 19 5月, 2016 1 次提交
  18. 12 5月, 2016 1 次提交
  19. 29 4月, 2016 1 次提交