1. 28 5月, 2014 11 次提交
    • F
      block: Introduce op_blockers to BlockDriverState · fbe40ff7
      Fam Zheng 提交于
      BlockDriverState.op_blockers is an array of lists with BLOCK_OP_TYPE_MAX
      elements. Each list is a list of blockers of an operation type
      (BlockOpType), that marks this BDS as currently blocked for a certain
      type of operation with reason errors stored in the list. The rule of
      usage is:
      
       * BDS user who wants to take an operation should check if there's any
         blocker of the type with bdrv_op_is_blocked().
      
       * BDS user who wants to block certain types of operation, should call
         bdrv_op_block (or bdrv_op_block_all to block all types of operations,
         which is similar to the existing bdrv_set_in_use()).
      
       * A blocker is only referenced by op_blockers, so the lifecycle is
         managed by caller, and shouldn't be lost until unblock, so typically
         a caller does these:
      
         - Allocate a blocker with error_setg or similar, call bdrv_op_block()
           to block some operations.
         - Hold the blocker, do his job.
         - Unblock operations that it blocked, with the same reason pointer
           passed to bdrv_op_unblock().
         - Release the blocker with error_free().
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Reviewed-by: NBenoit Canet <benoit@irqsave.net>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      fbe40ff7
    • F
      block: Add BlockOpType enum · 8574575f
      Fam Zheng 提交于
      This adds the enum of all the operations that can be taken on a block
      device.
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Reviewed-by: NBenoit Canet <benoit@irqsave.net>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      8574575f
    • M
      iotests: Use _img_info in test 089 · 0bf7488a
      Max Reitz 提交于
      Currently, test 089 uses $QEMU_IMG info manually in order to obtain the
      according output. However, the iotests should generally use _img_info as
      this filters out more irrelevant information such as the host image size
      or format specific information. Therefore, test 089 should use _img_info
      as well.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reported-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      0bf7488a
    • F
      aio: Fix use-after-free in cancellation path · 271c0f68
      Fam Zheng 提交于
      The current flow of canceling a thread from THREAD_ACTIVE state is:
      
        1) Caller wants to cancel a request, so it calls thread_pool_cancel.
      
        2) thread_pool_cancel waits on the conditional variable
           elem->check_cancel.
      
        3) The worker thread changes state to THREAD_DONE once the task is
           done, and notifies elem->check_cancel to allow thread_pool_cancel
           to continue execution, and signals the notifier (pool->notifier) to
           allow callback function to be called later. But because of the
           global mutex, the notifier won't get processed until step 4) and 5)
           are done.
      
        4) thread_pool_cancel continues, leaving the notifier signaled, it
           just returns to caller.
      
        5) Caller thinks the request is already canceled successfully, so it
           releases any related data, such as freeing elem->common.opaque.
      
        6) In the next main loop iteration, the notifier handler,
           event_notifier_ready, is called. It finds the canceled thread in
           THREAD_DONE state, so calls elem->common.cb, with an (likely)
           dangling opaque pointer. This is a use-after-free.
      
      Fix it by calling event_notifier_ready before leaving
      thread_pool_cancel.
      
      Test case update: This change will let cancel complete earlier than
      test-thread-pool.c expects, so update the code to check this case: if
      it's already done, done_cb sets .aiocb to NULL, skip calling
      bdrv_aio_cancel on them.
      Reported-by: NUlrich Obergfell <uobergfe@redhat.com>
      Suggested-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      271c0f68
    • K
      qcow2: Fix memory leak in COW error path · bd604369
      Kevin Wolf 提交于
      This triggers if bs->drv becomes NULL in a concurrent request. This is
      currently only the case when corruption prevention kicks in (i.e. at
      most once per image, and after that it produces I/O errors).
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      bd604369
    • L
      QemuOpt: add unit tests · 4ba6fabf
      Leandro Dorileo 提交于
      Cover basic aspects and API usage for QemuOpt. The current implementation
      covers the API's planned to be changed by Chunyan Liu in his QEMUOptionParameter
      replacement/cleanup job.
      
      Other APIs should be covered in future improvements.
      
      [Squashing in a small fix "QemuOpt: use qemu_find_opts_err() to avoid
      output on stderr in tests".
      
      qemu_find_opts() calls error_report() instead of propagating the Error
      object.  It is undesirable to clutter test case output with error
      messages from a passing test.
      
      Use qemu_find_opts_err() to avoid the output on stderr.
      --Stefan]
      Signed-off-by: NLeandro Dorileo <l@dorileo.org>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      4ba6fabf
    • F
      qemu-iotests: Handle cache mode option in 091 · 7cf6376a
      Fam Zheng 提交于
      We should allow testing this on tmpfs. Any cache setting in iotests
      should try to obey $CACHEMODE.
      
      The cache mode is still "none" by default but overridable
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      7cf6376a
    • P
      Merge remote-tracking branch 'remotes/kraxel/tags/pull-input-9' into staging · 4aa23452
      Peter Maydell 提交于
      input: add event routing and multiseat support.
      input: misc bugfixes and minor improvements.
      
      # gpg: Signature made Mon 26 May 2014 07:44:29 BST using RSA key ID D3E87138
      # gpg: Can't check signature: public key not found
      
      * remotes/kraxel/tags/pull-input-9:
        docs: add multiseat.txt
        usb: add input routing support for tablet and keyboard
        sdl: pass key event source to input layer
        input: bind devices and input routing
        input: switch hid mouse and tablet to the new input layer api.
        input: switch hid keyboard to new input layer api.
        input: keymap: add meta keys
        input: add name to input_event_key_number
        input: add qemu_input_key_number_to_qcode
        input (curses): mask keycodes to remove modifier bits
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      4aa23452
    • P
      Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-2014-05-26' into staging · 9474ab14
      Peter Maydell 提交于
      trivial patches for 2014-05-26
      
      # gpg: Signature made Mon 26 May 2014 08:17:08 BST using RSA key ID A4C3D7DB
      # gpg: Can't check signature: public key not found
      
      * remotes/mjt/tags/trivial-patches-2014-05-26: (23 commits)
        libcacard: remove useless initializers
        net: cadence_gem: Fix top comment
        bsd-user: replace fprintf(stderr, ...) with error_report()
        audio: replace fprintf(stderr, ...) with error_report() in audio
        libcacard: fix wrong array expansion logic
        libcacard/vcard_emul_nss: Drop a redundant conditional
        libcacard: Convert two leftover realloc() to GLib
        libcacard/vreader: Tighten assertion to clarify intent
        libcacard/vreader: Drop broken recovery from failed assertion
        libcacard: Plug memory leaks around vreader_get_reader_list()
        libcacard/vscclient: Bury some dead code
        vl: fix 'name' option to work with -readconfig
        configure: Put tempfiles in a subdir of the build directory
        dma-helpers: avoid calling dma_bdrv_unmap() twice
        arch_init: replace fprintf(stderr, ...) with error_report()
        pci: move dereferencing of root only after verifying valid root pointer
        jazz_led: Add missing break in switch case
        bswap.h: Rename ldl_p, stl_p, etc to ldl_he_p, stl_he_p, etc
        configure: Automatically select GTK+ 3.0 if GTK+ 2.0 is unavailable
        nbd: Miscellaneous typo fixes.
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      9474ab14
    • P
      Merge remote-tracking branch 'remotes/mwalle/tags/lm32-semihosting/20140524' into staging · 2f21ff25
      Peter Maydell 提交于
      * remotes/mwalle/tags/lm32-semihosting/20140524:
        lm32: remove lm32_sys
        test: lm32: use semihosting for testing
        target-lm32: add semihosting support
        test: lm32: make test cases independent
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      2f21ff25
    • P
      Merge remote-tracking branch 'remotes/rth/tcg-mips' into staging · 27aa9485
      Peter Maydell 提交于
      * remotes/rth/tcg-mips: (24 commits)
        tcg-mips: Enable direct chaining of TBs
        tcg-mips: Simplify movcond
        tcg-mips: Simplify brcond2
        tcg-mips: Improve setcond eq/ne vs zeros
        tcg-mips: Simplify setcond2
        tcg-mips: Simplify brcond
        tcg-mips: Simplify setcond
        tcg-mips: Commonize opcode implementations
        tcg-mips: Improve add2/sub2
        tcg-mips: Hoist args loads
        tcg-mips: Fix subtract immediate range
        tcg-mips: Name the opcode enumeration
        tcg-mips: Use EXT for AND on mips32r2
        tcg-mips: Use T9 for TCG_TMP1
        tcg-mips: Introduce TCG_TMP0, TCG_TMP1
        tcg-mips: Rearrange register allocation
        tcg-mips: Convert to new_ldst
        tcg-mips: Convert to new qemu_l/st helpers
        tcg-mips: Move softmmu slow path out of line
        tcg-mips: Split large ldst offsets
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      27aa9485
  2. 27 5月, 2014 2 次提交
  3. 26 5月, 2014 15 次提交
  4. 25 5月, 2014 4 次提交
  5. 24 5月, 2014 8 次提交