1. 21 2月, 2017 1 次提交
  2. 01 11月, 2016 1 次提交
  3. 23 10月, 2016 1 次提交
  4. 07 10月, 2016 1 次提交
  5. 20 7月, 2016 2 次提交
  6. 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
  7. 16 6月, 2016 1 次提交
  8. 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
  9. 01 3月, 2016 1 次提交
    • D
      rbd: add support for getting password from QCryptoSecret object · 60390a21
      Daniel P. Berrange 提交于
      Currently RBD passwords must be provided on the command line
      via
      
        $QEMU -drive file=rbd:pool/image:id=myname:\
                     key=QVFDVm41aE82SHpGQWhBQXEwTkN2OGp0SmNJY0UrSE9CbE1RMUE=:\
                     auth_supported=cephx
      
      This is insecure because the key is visible in the OS process
      listing.
      
      This adds support for an 'password-secret' parameter in the RBD
      parameters that can be used with the QCryptoSecret object to
      provide the password via a file:
      
        echo "QVFDVm41aE82SHpGQWhBQXEwTkN2OGp0SmNJY0UrSE9CbE1RMUE=" > poolkey.b64
        $QEMU -object secret,id=secret0,file=poolkey.b64,format=base64 \
              -drive driver=rbd,filename=rbd:pool/image:id=myname:\
                     auth_supported=cephx,password-secret=secret0
      Reviewed-by: NJosh Durgin <jdurgin@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-id: 1453385961-10718-2-git-send-email-berrange@redhat.com
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      60390a21
  10. 20 1月, 2016 1 次提交
  11. 14 7月, 2015 3 次提交
  12. 28 4月, 2015 1 次提交
    • S
      Convert (ffs(val) - 1) to ctz32(val) · 786a4ea8
      Stefan Hajnoczi 提交于
      This commit was generated mechanically by coccinelle from the following
      semantic patch:
      
      @@
      expression val;
      @@
      - (ffs(val) - 1)
      + ctz32(val)
      
      The call sites have been audited to ensure the ffs(0) - 1 == -1 case
      never occurs (due to input validation, asserts, etc).  Therefore we
      don't need to worry about the fact that ctz32(0) == 32.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 1427124571-28598-5-git-send-email-stefanha@redhat.com
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      786a4ea8
  13. 12 12月, 2014 1 次提交
  14. 03 11月, 2014 1 次提交
  15. 20 10月, 2014 2 次提交
  16. 22 9月, 2014 2 次提交
  17. 12 9月, 2014 1 次提交
  18. 20 8月, 2014 2 次提交
    • M
      block: Use g_new() & friends to avoid multiplying sizes · 02c4f26b
      Markus Armbruster 提交于
      g_new(T, n) is safer than g_malloc(sizeof(*v) * n) for two reasons.
      One, it catches multiplication overflowing size_t.  Two, it returns
      T * rather than void *, which lets the compiler catch more type
      errors.
      
      Perhaps a conversion to g_malloc_n() would be neater in places, but
      that's merely four years old, and we can't use such newfangled stuff.
      
      This commit only touches allocations with size arguments of the form
      sizeof(T), plus two that use 4 instead of sizeof(uint32_t).  We can
      make the others safe by converting to g_malloc_n() when it becomes
      available to us in a couple of years.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      02c4f26b
    • M
      block: Use g_new() & friends where that makes obvious sense · 5839e53b
      Markus Armbruster 提交于
      g_new(T, n) is neater than g_malloc(sizeof(T) * n).  It's also safer,
      for two reasons.  One, it catches multiplication overflowing size_t.
      Two, it returns T * rather than void *, which lets the compiler catch
      more type errors.
      
      Patch created with Coccinelle, with two manual changes on top:
      
      * Add const to bdrv_iterate_format() to keep the types straight
      
      * Convert the allocation in bdrv_drop_intermediate(), which Coccinelle
        inexplicably misses
      
      Coccinelle semantic patch:
      
          @@
          type T;
          @@
          -g_malloc(sizeof(T))
          +g_new(T, 1)
          @@
          type T;
          @@
          -g_try_malloc(sizeof(T))
          +g_try_new(T, 1)
          @@
          type T;
          @@
          -g_malloc0(sizeof(T))
          +g_new0(T, 1)
          @@
          type T;
          @@
          -g_try_malloc0(sizeof(T))
          +g_try_new0(T, 1)
          @@
          type T;
          expression n;
          @@
          -g_malloc(sizeof(T) * (n))
          +g_new(T, n)
          @@
          type T;
          expression n;
          @@
          -g_try_malloc(sizeof(T) * (n))
          +g_try_new(T, n)
          @@
          type T;
          expression n;
          @@
          -g_malloc0(sizeof(T) * (n))
          +g_new0(T, n)
          @@
          type T;
          expression n;
          @@
          -g_try_malloc0(sizeof(T) * (n))
          +g_try_new0(T, n)
          @@
          type T;
          expression p, n;
          @@
          -g_realloc(p, sizeof(T) * (n))
          +g_renew(T, p, n)
          @@
          type T;
          expression p, n;
          @@
          -g_try_realloc(p, sizeof(T) * (n))
          +g_try_renew(T, p, n)
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      5839e53b
  19. 15 8月, 2014 1 次提交
  20. 16 6月, 2014 2 次提交
  21. 06 6月, 2014 1 次提交
  22. 04 6月, 2014 1 次提交
  23. 28 5月, 2014 1 次提交
  24. 18 2月, 2014 1 次提交
  25. 22 1月, 2014 1 次提交
    • S
      rbd: switch from pipe to QEMUBH completion notification · e04fb07f
      Stefan Hajnoczi 提交于
      rbd callbacks are called from non-QEMU threads.  Up until now a pipe was
      used to signal completion back to the QEMU iothread.
      
      The pipe writer code handles EAGAIN using select(2).  The select(2) API
      is not scalable since fd_set size is static.  FD_SET() can write beyond
      the end of fd_set if the file descriptor number is too high.  (QEMU's
      main loop uses poll(2) to avoid this issue with select(2).)
      
      Since the pipe itself is quite clumsy to use and QEMUBH is now
      thread-safe, just schedule a BH from the rbd callback function.  This
      way we can simplify I/O completion in addition to eliminating the
      potential FD_SET() crash when file descriptor numbers become too high.
      
      Crash scenario: QEMU already has 1024 file descriptors open.  Hotplug an
      rbd drive and get the pipe writer to take the select(2) code path.
      Reviewed-by: NJosh Durgin <josh.durgin@inktank.com>
      Tested-by: NJosh Durgin <josh.durgin@inktank.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      e04fb07f
  26. 07 1月, 2014 1 次提交
  27. 25 9月, 2013 2 次提交
  28. 12 9月, 2013 3 次提交
    • M
      bdrv: Use "Error" for creating images · d5124c00
      Max Reitz 提交于
      Add an Error ** parameter to BlockDriver.bdrv_create to allow more
      specific error messages.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      d5124c00
    • M
      bdrv: Use "Error" for opening images · 015a1036
      Max Reitz 提交于
      Add an Error ** parameter to BlockDriver.bdrv_open and
      BlockDriver.bdrv_file_open to allow more specific error messages.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      015a1036
    • W
      snapshot: distinguish id and name in snapshot delete · a89d89d3
      Wenchao Xia 提交于
      Snapshot creation actually already distinguish id and name since it take
      a structured parameter *sn, but delete can't. Later an accurate delete
      is needed in qmp_transaction abort and blockdev-snapshot-delete-sync,
      so change its prototype. Also *errp is added to tip error, but return
      value is kepted to let caller check what kind of error happens. Existing
      caller for it are savevm, delvm and qemu-img, they are not impacted by
      introducing a new function bdrv_snapshot_delete_by_id_or_name(), which
      check the return value and do the operation again.
      
      Before this patch:
        For qcow2, it search id first then name to find the one to delete.
        For rbd, it search name.
        For sheepdog, it does nothing.
      
      After this patch:
        For qcow2, logic is the same by call it twice in caller.
        For rbd, it always fails in delete with id, but still search for name
      in second try, no change to user.
      
      Some code for *errp is based on Pavel's patch.
      Signed-off-by: NWenchao Xia <xiawenc@linux.vnet.ibm.com>
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      a89d89d3
  29. 19 8月, 2013 1 次提交