1. 10 10月, 2017 1 次提交
  2. 05 9月, 2017 2 次提交
  3. 04 9月, 2017 3 次提交
  4. 11 7月, 2017 2 次提交
  5. 10 7月, 2017 1 次提交
  6. 26 6月, 2017 2 次提交
  7. 20 6月, 2017 1 次提交
  8. 11 5月, 2017 5 次提交
    • E
      blkdebug: Add ability to override unmap geometries · 430b26a8
      Eric Blake 提交于
      Make it easier to simulate various unusual hardware setups (for
      example, recent commits 3482b9bc and b8d0a980 affect the Dell
      Equallogic iSCSI with its 15M preferred and maximum unmap and
      write zero sizing, or b2f95fee deals with the Linux loopback
      block device having a max_transfer of 64k), by allowing blkdebug
      to wrap any other device with further restrictions on various
      alignments.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 20170429191419.30051-9-eblake@redhat.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      430b26a8
    • E
      blkdebug: Simplify override logic · 3dc834f8
      Eric Blake 提交于
      Rather than store into a local variable, then copy to the struct
      if the value is valid, then reporting errors otherwise, it is
      simpler to just store into the struct and report errors if the
      value is invalid.  This however requires that the struct store
      a 64-bit number, rather than a narrower type.  Likewise, setting
      a sane errno value in ret prior to the sequence of parsing and
      jumping to out: on error makes it easier for the next patch to
      add a chain of similar checks.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-id: 20170429191419.30051-8-eblake@redhat.com
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      3dc834f8
    • E
      blkdebug: Add pass-through write_zero and discard support · 63188c24
      Eric Blake 提交于
      In order to test the effects of artificial geometry constraints
      on operations like write zero or discard, we first need blkdebug
      to manage these actions.  It also allows us to inject errors on
      those operations, just like we can for read/write/flush.
      
      We can also test the contract promised by the block layer; namely,
      if a device has specified limits on alignment or maximum size,
      then those limits must be obeyed (for now, the blkdebug driver
      merely inherits limits from whatever it is wrapping, but the next
      patch will further enhance it to allow specific limit overrides).
      
      This patch intentionally refuses to service requests smaller than
      the requested alignments; this is because an upcoming patch adds
      a qemu-iotest to prove that the block layer is correctly handling
      fragmentation, but the test only works if there is a way to tell
      the difference at artificial alignment boundaries when blkdebug is
      using a larger-than-default alignment.  If we let the blkdebug
      layer always defer to the underlying layer, which potentially has
      a smaller granularity, the iotest will be thwarted.
      
      Tested by setting up an NBD server with export 'foo', then invoking:
      $ ./qemu-io
      qemu-io> open -o driver=blkdebug blkdebug::nbd://localhost:10809/foo
      qemu-io> d 0 15M
      qemu-io> w -z 0 15M
      
      Pre-patch, the server never sees the discard (it was silently
      eaten by the block layer); post-patch it is passed across the
      wire.  Likewise, pre-patch the write is always passed with
      NBD_WRITE (with 15M of zeroes on the wire), while post-patch
      it can utilize NBD_WRITE_ZEROES (for less traffic).
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 20170429191419.30051-7-eblake@redhat.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      63188c24
    • E
      blkdebug: Refactor error injection · d157ed5f
      Eric Blake 提交于
      Rather than repeat the logic at each caller of checking if a Rule
      exists that warrants an error injection, fold that logic into
      inject_error(); and rename it to rule_check() for legibility.
      This will help the next patch, which adds two more callers that
      need to check rules for the potential of injecting errors.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 20170429191419.30051-6-eblake@redhat.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      d157ed5f
    • E
      blkdebug: Sanity check block layer guarantees · e0ef4395
      Eric Blake 提交于
      Commits 04ed95f4 and 1a62d0ac updated the block layer to auto-fragment
      any I/O to fit within device boundaries. Additionally, when using a
      minimum alignment of 4k, we want to ensure the block layer does proper
      read-modify-write rather than requesting I/O on a slice of a sector.
      Let's enforce that the contract is obeyed when using blkdebug.  For
      now, blkdebug only allows alignment overrides, and just inherits other
      limits from whatever device it is wrapping, but a future patch will
      further enhance things.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 20170429191419.30051-5-eblake@redhat.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      e0ef4395
  9. 09 5月, 2017 2 次提交
  10. 28 4月, 2017 2 次提交
  11. 27 4月, 2017 1 次提交
    • M
      block: Do not unref bs->file on error in BD's open · de234897
      Max Reitz 提交于
      The block layer takes care of removing the bs->file child if the block
      driver's bdrv_open()/bdrv_file_open() implementation fails. The block
      driver therefore does not need to do so, and indeed should not unless it
      sets bs->file to NULL afterwards -- because if this is not done, the
      bdrv_unref_child() in bdrv_open_inherit() will dereference the freed
      memory block at bs->file afterwards, which is not good.
      
      We can now decide whether to add a "bs->file = NULL;" after each of the
      offending bdrv_unref_child() invocations, or just drop them altogether.
      The latter is simpler, so let's do that.
      
      Cc: qemu-stable <qemu-stable@nongnu.org>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      de234897
  12. 01 3月, 2017 1 次提交
  13. 24 2月, 2017 1 次提交
  14. 21 2月, 2017 1 次提交
  15. 09 1月, 2017 1 次提交
  16. 07 10月, 2016 1 次提交
  17. 15 8月, 2016 1 次提交
  18. 13 7月, 2016 1 次提交
    • P
      coroutine: move entry argument to qemu_coroutine_create · 0b8b8753
      Paolo Bonzini 提交于
      In practice the entry argument is always known at creation time, and
      it is confusing that sometimes qemu_coroutine_enter is used with a
      non-NULL argument to re-enter a coroutine (this happens in
      block/sheepdog.c and tests/test-coroutine.c).  So pass the opaque value
      at creation time, for consistency with e.g. aio_bh_new.
      
      Mostly done with the following semantic patch:
      
      @ entry1 @
      expression entry, arg, co;
      @@
      - co = qemu_coroutine_create(entry);
      + co = qemu_coroutine_create(entry, arg);
        ...
      - qemu_coroutine_enter(co, arg);
      + qemu_coroutine_enter(co);
      
      @ entry2 @
      expression entry, arg;
      identifier co;
      @@
      - Coroutine *co = qemu_coroutine_create(entry);
      + Coroutine *co = qemu_coroutine_create(entry, arg);
        ...
      - qemu_coroutine_enter(co, arg);
      + qemu_coroutine_enter(co);
      
      @ entry3 @
      expression entry, arg;
      @@
      - qemu_coroutine_enter(qemu_coroutine_create(entry), arg);
      + qemu_coroutine_enter(qemu_coroutine_create(entry, arg));
      
      @ reentry @
      expression co;
      @@
      - qemu_coroutine_enter(co, NULL);
      + qemu_coroutine_enter(co);
      
      except for the aforementioned few places where the semantic patch
      stumbled (as expected) and for test_co_queue, which would otherwise
      produce an uninitialized variable warning.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      0b8b8753
  19. 05 7月, 2016 4 次提交
  20. 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
  21. 20 1月, 2016 1 次提交
  22. 18 12月, 2015 2 次提交
  23. 17 12月, 2015 2 次提交
    • E
      qapi: Don't let implicit enum MAX member collide · 7fb1cf16
      Eric Blake 提交于
      Now that we guarantee the user doesn't have any enum values
      beginning with a single underscore, we can use that for our
      own purposes.  Renaming ENUM_MAX to ENUM__MAX makes it obvious
      that the sentinel is generated.
      
      This patch was mostly generated by applying a temporary patch:
      
      |diff --git a/scripts/qapi.py b/scripts/qapi.py
      |index e6d014b..b862ec9 100644
      |--- a/scripts/qapi.py
      |+++ b/scripts/qapi.py
      |@@ -1570,6 +1570,7 @@ const char *const %(c_name)s_lookup[] = {
      |     max_index = c_enum_const(name, 'MAX', prefix)
      |     ret += mcgen('''
      |     [%(max_index)s] = NULL,
      |+// %(max_index)s
      | };
      | ''',
      |                max_index=max_index)
      
      then running:
      
      $ cat qapi-{types,event}.c tests/test-qapi-types.c |
          sed -n 's,^// \(.*\)MAX,s|\1MAX|\1_MAX|g,p' > list
      $ git grep -l _MAX | xargs sed -i -f list
      
      The only things not generated are the changes in scripts/qapi.py.
      
      Rejecting enum members named 'MAX' is now useless, and will be dropped
      in the next patch.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1447836791-369-23-git-send-email-eblake@redhat.com>
      Reviewed-by: NJuan Quintela <quintela@redhat.com>
      [Rebased to current master, commit message tweaked]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      7fb1cf16
    • E
      blkdebug: Merge hand-rolled and qapi BlkdebugEvent enum · a31939e6
      Eric Blake 提交于
      No need to keep two separate enums, where editing one is likely
      to forget the other.  Now that we can specify a qapi enum prefix,
      we don't even have to change the bulk of the uses.
      
      get_event_by_name() could perhaps be replaced by qapi_enum_parse(),
      but I left that for another day.
      
      CC: Kevin Wolf <kwolf@redhat.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1447836791-369-20-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      a31939e6