1. 25 4月, 2017 1 次提交
  2. 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
  3. 01 3月, 2017 2 次提交
  4. 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
  5. 25 1月, 2017 2 次提交
  6. 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
  7. 13 7月, 2016 1 次提交
  8. 05 7月, 2016 6 次提交
  9. 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
  10. 07 6月, 2016 1 次提交
  11. 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
  12. 19 5月, 2016 1 次提交
  13. 12 5月, 2016 1 次提交
  14. 29 4月, 2016 2 次提交
  15. 30 3月, 2016 1 次提交
    • K
      block: Remove BDRV_O_CACHE_WB · 61de4c68
      Kevin Wolf 提交于
      The previous patches have successively made blk->enable_write_cache the
      true source for the information whether a writethrough mode must be
      implemented. The corresponding BDRV_O_CACHE_WB is only useless baggage
      we're carrying around, so now's the time to remove it.
      
      At the same time, we remove the 'cache.writeback' option parsing on the
      BDS level as the only effect was setting the BDRV_O_CACHE_WB flag.
      
      This change requires test cases that explicitly enabled the option to
      drop it. Other than that and the change of the error message when
      writethrough is enabled on the BDS level (from "Can't set writethrough
      mode" to "doesn't support the option"), there should be no change in
      behaviour.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      61de4c68
  16. 23 3月, 2016 2 次提交
    • V
      util: move declarations out of qemu-common.h · f348b6d1
      Veronia Bahaa 提交于
      Move declarations out of qemu-common.h for functions declared in
      utils/ files: e.g. include/qemu/path.h for utils/path.c.
      Move inline functions out of qemu-common.h and into new files (e.g.
      include/qemu/bcd.h)
      Signed-off-by: NVeronia Bahaa <veroniabahaa@gmail.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      f348b6d1
    • M
      include/qemu/osdep.h: Don't include qapi/error.h · da34e65c
      Markus Armbruster 提交于
      Commit 57cb38b3 included qapi/error.h into qemu/osdep.h to get the
      Error typedef.  Since then, we've moved to include qemu/osdep.h
      everywhere.  Its file comment explains: "To avoid getting into
      possible circular include dependencies, this file should not include
      any other QEMU headers, with the exceptions of config-host.h,
      compiler.h, os-posix.h and os-win32.h, all of which are doing a
      similar job to this file and are under similar constraints."
      qapi/error.h doesn't do a similar job, and it doesn't adhere to
      similar constraints: it includes qapi-types.h.  That's in excess of
      100KiB of crap most .c files don't actually need.
      
      Add the typedef to qemu/typedefs.h, and include that instead of
      qapi/error.h.  Include qapi/error.h in .c files that need it and don't
      get it now.  Include qapi-types.h in qom/object.h for uint16List.
      
      Update scripts/clean-includes accordingly.  Update it further to match
      reality: replace config.h by config-target.h, add sysemu/os-posix.h,
      sysemu/os-win32.h.  Update the list of includes in the qemu/osdep.h
      comment quoted above similarly.
      
      This reduces the number of objects depending on qapi/error.h from "all
      of them" to less than a third.  Unfortunately, the number depending on
      qapi-types.h shrinks only a little.  More work is needed for that one.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      [Fix compilation without the spice devel packages. - Paolo]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      da34e65c
  17. 03 2月, 2016 1 次提交
    • F
      block: Add "file" output parameter to block status query functions · 67a0fd2a
      Fam Zheng 提交于
      The added parameter can be used to return the BDS pointer which the
      valid offset is referring to. Its value should be ignored unless
      BDRV_BLOCK_OFFSET_VALID in ret is set.
      
      Until block drivers fill in the right value, let's clear it explicitly
      right before calling .bdrv_get_block_status.
      
      The "bs->file" condition in bdrv_co_get_block_status is kept now to keep iotest
      case 102 passing, and will be fixed once all drivers return the right file
      pointer.
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Message-id: 1453780743-16806-2-git-send-email-famz@redhat.com
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      67a0fd2a
  18. 20 1月, 2016 1 次提交
  19. 16 10月, 2015 3 次提交
  20. 14 9月, 2015 2 次提交
  21. 23 6月, 2015 2 次提交
  22. 22 6月, 2015 1 次提交
  23. 28 4月, 2015 1 次提交
  24. 26 2月, 2015 2 次提交
  25. 24 1月, 2015 1 次提交
    • J
      block: update string sizes for filename,backing_file,exact_filename · 9a29e18f
      Jeff Cody 提交于
      The string field entries 'filename', 'backing_file', and
      'exact_filename' in the BlockDriverState struct are defined as 1024
      bytes.
      
      However, many places that use these values accept a maximum of PATH_MAX
      bytes, so we have a mixture of 1024 byte and PATH_MAX byte allocations.
      This patch makes the BlockDriverStruct field string sizes match usage.
      
      This patch also does a few fixes related to the size that needs to
      happen now:
      
          * the block qapi driver is updated to use PATH_MAX bytes
          * the qcow and qcow2 drivers have an additional safety check
          * the block vvfat driver is updated to use PATH_MAX bytes
            for the size of backing_file, for systems where PATH_MAX is < 1024
            bytes.
          * qemu-img uses PATH_MAX rather than 1024.  These instances were not
            changed to be dynamically allocated, however, as the extra
            temporary 3K in stack usage for qemu-img does not seem worrisome.
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      9a29e18f
  26. 10 12月, 2014 1 次提交