1. 11 5月, 2017 2 次提交
  2. 09 5月, 2017 2 次提交
  3. 28 4月, 2017 2 次提交
  4. 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
  5. 01 3月, 2017 1 次提交
  6. 24 2月, 2017 1 次提交
  7. 21 2月, 2017 1 次提交
  8. 09 1月, 2017 1 次提交
  9. 07 10月, 2016 1 次提交
  10. 15 8月, 2016 1 次提交
  11. 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
  12. 05 7月, 2016 4 次提交
  13. 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
  14. 20 1月, 2016 1 次提交
  15. 18 12月, 2015 2 次提交
  16. 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
  17. 02 12月, 2015 1 次提交
  18. 16 10月, 2015 2 次提交
  19. 12 6月, 2015 1 次提交
  20. 09 6月, 2015 3 次提交
  21. 28 4月, 2015 1 次提交
  22. 10 3月, 2015 1 次提交
    • J
      blkdebug: fix "once" rule · a069e2f1
      John Snow 提交于
      Background:
        The blkdebug scripts are currently engineered so that when a debug
      event occurs, a prefilter browses a master list of parsed rules for a
      certain event and adds them to an "active list" of rules to be used for
      the forthcoming action, provided the events and state numbers match.
      
        Then, once the request is received, the last active rule is used to
      inject an error if certain parameters match.
      
        This active list is cleared every time the prefilter injects a new
      rule for the first time during a debug event.
      
        The "once" rule currently causes the error injection, if it is
      triggered, to only clear the active list. This is insufficient for
      preventing future injections of the same rule.
      
      Remedy:
        This patch /deletes/ the rule from the list that the prefilter
      browses, so it is gone for good. In V2, we remove only the rule of
      interest from the active list instead of allowing the "once" rule to
      clear the entire list of active rules.
      
      Impact:
        This affects iotests 026. Several ENOSPC tests that used "once" can
      be seen to have output that shows multiple failure messages. After
      this patch, the error messages tend to be smaller and less severe, but
      the injection can still be seen to be working. I have patched the
      expected output to expect the smaller error messages.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1423257977-25630-1-git-send-email-jsnow@redhat.com
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      a069e2f1
  23. 10 12月, 2014 1 次提交
  24. 03 11月, 2014 1 次提交
    • M
      qcow2: Optimize bdrv_make_empty() · 94054183
      Max Reitz 提交于
      bdrv_make_empty() is currently only called if the current image
      represents an external snapshot that has been committed to its base
      image; it is therefore unlikely to have internal snapshots. In this
      case, bdrv_make_empty() can be greatly sped up by emptying the L1 and
      refcount table (while having the dirty flag set, which only works for
      compat=1.1) and creating a trivial refcount structure.
      
      If there are snapshots or for compat=0.10, fall back to the simple
      implementation (discard all clusters).
      
      [Applied s/clusters/cluster/ typo fix suggested by Eric Blake
      --Stefan]
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-id: 1414159063-25977-4-git-send-email-mreitz@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      94054183
  25. 20 10月, 2014 2 次提交
  26. 25 9月, 2014 1 次提交
  27. 22 9月, 2014 1 次提交