1. 23 3月, 2016 1 次提交
    • 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
  2. 17 3月, 2016 3 次提交
    • M
      blockdev: Split monitor reference from BB creation · efaa7c4e
      Max Reitz 提交于
      Before this patch, blk_new() automatically assigned a name to the new
      BlockBackend and considered it referenced by the monitor. This patch
      removes the implicit monitor_add_blk() call from blk_new() (and
      consequently the monitor_remove_blk() call from blk_delete(), too) and
      thus blk_new() (and related functions) no longer take a BB name
      argument.
      
      In fact, there is only a single point where blk_new()/blk_new_open() is
      called and the new BB is monitor-owned, and that is in blockdev_init().
      Besides thus relieving us from having to invent names for all of the BBs
      we use in qemu-img, this fixes a bug where qemu cannot create a new
      image if there already is a monitor-owned BB named "image".
      
      If a BB and its BDS tree are created in a single operation, as of this
      patch the BDS tree will be created before the BB is given a name
      (whereas it was the other way around before). This results in minor
      change to the output of iotest 087, whose reference output is amended
      accordingly.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      efaa7c4e
    • M
      qapi: Drop QERR_UNKNOWN_BLOCK_FORMAT_FEATURE · a55448b3
      Max Reitz 提交于
      Just specifying a custom string is simpler in basically all places that
      used it, and in addition, specifying the BB or node name is something we
      generally do not do in other error messages when opening a BDS, so we
      should not do it here.
      
      This changes the output for iotest 036 (to the better, in my opinion),
      so the reference output needs to be changed accordingly.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      a55448b3
    • S
      Revert "qed: Implement .bdrv_drain" · 1f3ddfcb
      Stefan Hajnoczi 提交于
      This reverts commit df9a681d.
      
      Note that commit df9a681d included some
      unrelated hunks, possibly due to a merge failure or an overlooked
      squash.  This only reverts the qed .bdrv_drain() implementation.
      
      The qed .bdrv_drain() implementation is unsafe and can lead to a double
      request completion.
      
      Paolo Bonzini reports:
      "The problem is that bdrv_qed_drain calls qed_plug_allocating_write_reqs
      unconditionally, but this is not correct if an allocating write is
      queued.  In this case, qed_unplug_allocating_write_reqs will restart the
      allocating write and possibly cause it to complete.  The aiocb however
      is still in use for the L2/L1 table writes, and will then be completed
      again as soon as the table writes are stable."
      
      For QEMU 2.6 we can simply revert this commit.  A full solution for the
      qed need check timer may be added if the bdrv_drain() implementation is
      extended.
      Reported-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Acked-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 1457431876-8475-1-git-send-email-stefanha@redhat.com
      1f3ddfcb
  3. 14 3月, 2016 1 次提交
  4. 03 2月, 2016 2 次提交
  5. 20 1月, 2016 2 次提交
  6. 13 1月, 2016 1 次提交
    • M
      error: Use error_prepend() where it makes obvious sense · e43bfd9c
      Markus Armbruster 提交于
      Done with this Coccinelle semantic patch
      
          @@
          expression FMT, E1, E2;
          expression list ARGS;
          @@
          -    error_setg(E1, FMT, ARGS, error_get_pretty(E2));
          +    error_propagate(E1, E2);/*###*/
          +    error_prepend(E1, FMT/*@@@*/, ARGS);
      
      followed by manual cleanup, first because I can't figure out how to
      make Coccinelle transform strings, and second to get rid of now
      superfluous error_propagate().
      
      We now use or propagate the original error whole instead of just its
      message obtained with error_get_pretty().  This avoids suppressing its
      hint (see commit 50b7b000), but I can't see how the errors touched in
      this commit could come with hints.  It also improves the message
      printed with &error_abort when we screw up (see commit 1e9b65bb).
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      e43bfd9c
  7. 12 11月, 2015 1 次提交
  8. 16 10月, 2015 3 次提交
  9. 14 9月, 2015 1 次提交
  10. 23 6月, 2015 1 次提交
  11. 28 4月, 2015 2 次提交
  12. 07 2月, 2015 1 次提交
  13. 20 10月, 2014 3 次提交
  14. 22 9月, 2014 2 次提交
  15. 12 9月, 2014 1 次提交
  16. 15 8月, 2014 1 次提交
  17. 18 7月, 2014 1 次提交
  18. 14 7月, 2014 1 次提交
  19. 01 7月, 2014 1 次提交
    • C
      qemu-img create: add 'nocow' option · 4ab15590
      Chunyan Liu 提交于
      Add 'nocow' option so that users could have a chance to set NOCOW flag to
      newly created files. It's useful on btrfs file system to enhance performance.
      
      Btrfs has low performance when hosting VM images, even more when the guest
      in those VM are also using btrfs as file system. One way to mitigate this bad
      performance is to turn off COW attributes on VM files. Generally, there are
      two ways to turn off NOCOW on btrfs: a) by mounting fs with nodatacow, then
      all newly created files will be NOCOW. b) per file. Add the NOCOW file
      attribute. It could only be done to empty or new files.
      
      This patch tries the second way, according to the option, it could add NOCOW
      per file.
      
      For most block drivers, since the create file step is in raw-posix.c, so we
      can do setting NOCOW flag ioctl in raw-posix.c only.
      
      But there are some exceptions, like block/vpc.c and block/vdi.c, they are
      creating file by calling qemu_open directly. For them, do the same setting
      NOCOW flag ioctl work in them separately.
      
      [Fixed up 082.out due to the new 'nocow' creation option
      --Stefan]
      Signed-off-by: NChunyan Liu <cyliu@suse.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      4ab15590
  20. 26 6月, 2014 1 次提交
  21. 16 6月, 2014 3 次提交
  22. 04 6月, 2014 1 次提交
    • S
      qed: use BlockDriverState's AioContext · a8c868c3
      Stefan Hajnoczi 提交于
      Drop the assumption that we're using the main AioContext.  Convert
      qemu_bh_new() to aio_bh_new() and qemu_aio_wait() to aio_poll() so we're
      using the BlockDriverState's AioContext.
      
      Implement .bdrv_detach/attach_aio_context() interfaces to move the
      QED_F_NEED_CHECK timer from the old AioContext to the new one.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      a8c868c3
  23. 22 4月, 2014 1 次提交
  24. 19 3月, 2014 1 次提交
  25. 13 3月, 2014 1 次提交
    • K
      block: Update image size in bdrv_invalidate_cache() · 3456a8d1
      Kevin Wolf 提交于
      After migration has completed, we call bdrv_invalidate_cache() so that
      drivers which cache some data drop their stale copy of the data and
      reread it from the image file to get a new version of data that the
      source modified while the migration was running.
      
      Reloading metadata from the image file is useless, though, if the size
      of the image file stays stale (this is a value that is cached for all
      image formats in block.c). Reads from (meta)data after the old EOF
      return only zeroes, causing image corruption.
      
      We need to update bs->total_sectors in all layers that could potentially
      have changed their size (i.e. backing files are not a concern - if they
      are changed, we're in bigger trouble)
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      3456a8d1
  26. 22 2月, 2014 3 次提交