1. 02 7月, 2018 4 次提交
  2. 01 7月, 2018 8 次提交
  3. 30 6月, 2018 8 次提交
    • P
      docs: mention shared state protect for OOB · 4bfa7974
      Peter Xu 提交于
      Out-Of-Band handlers need to protect shared state if there is any.
      Mention it in the document.  Meanwhile, touch up some other places too,
      either with better English, or reordering of bullets.
      Suggested-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NPeter Xu <peterx@redhat.com>
      Message-Id: <20180620073223.31964-6-peterx@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      4bfa7974
    • P
      tests: iotests: drop some stderr line · cbc4ae2d
      Peter Xu 提交于
      In my Out-Of-Band test, "check -qcow2 060" fail with this:
      
        --- /home/peterx/git/qemu/tests/qemu-iotests/060.out
        +++ /home/peterx/git/qemu/bin/tests/qemu-iotests/060.out.bad
        @@ -427,8 +427,8 @@
        QMP_VERSION
        {"return": {}}
        qcow2: Image is corrupt: L2 table offset 0x2a2a2a00 unaligned (L1
        index: 0); further non-fatal corruption events will be suppressed
        -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_IMAGE_CORRUPTED", "data": {"device": "", "msg": "L2 table offset 0x2a2a2a0
        0 unaligned (L1 index: 0)", "node-name": "drive", "fatal": false}}
        read failed: Input/output error
        +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_IMAGE_CORRUPTED", "data": {"device": "", "msg": "L2 table offset 0x2a2a2a0
        0 unaligned (L1 index: 0)", "node-name": "drive", "fatal": false}}
        {"return": ""}
        {"return": {}}
        {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP},
        "event": "SHUTDOWN", "data": {"guest": false}}
      
      The order of the event and the in/out error line is swapped.  I didn't
      dig up the reason, but AFAIU what we want to verify is the event rather
      than stderr.  Let's drop the stderr line directly for this test.
      Signed-off-by: NPeter Xu <peterx@redhat.com>
      Message-Id: <20180620073223.31964-5-peterx@redhat.com>
      [Commit message touched up]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      cbc4ae2d
    • P
      monitor: flush qmp responses when CLOSED · c73a843b
      Peter Xu 提交于
      Previously we clean up the queues when we got CLOSED event.  It was used
      to make sure we won't send leftover replies/events of a old client to a
      new client which makes perfect sense. However this will also drop the
      replies/events even if the output port of the previous chardev backend
      is still open, which can lead to missing of the last replies/events.
      Now this patch does an extra operation to flush the response queue
      before cleaning up.
      
      In most cases, a QMP session will be based on a bidirectional channel (a
      TCP port, for example, we read/write to the same socket handle), so in
      port and out port of the backend chardev are fundamentally the same
      port. In these cases, it does not really matter much on whether we'll
      flush the response queue since flushing will fail anyway.  However there
      can be cases where in & out ports of the QMP monitor's backend chardev
      are separated.  Here is an example:
      
        cat $QMP_COMMANDS | qemu -qmp stdio ... | filter_commands
      
      In this case, the backend is fd-typed, and it is connected to stdio
      where in port is stdin and out port is stdout.  Now if we drop all the
      events on the response queue then filter_command process might miss some
      events that it might expect.  The thing is that, when stdin closes,
      stdout might still be there alive!
      
      In practice, I encountered SHUTDOWN event missing when running test with
      iotest 087 with Out-Of-Band enabled.  Here is one of the ways that this
      can happen (after "quit" command is executed and QEMU quits the main
      loop):
      
      1. [main thread] QEMU queues a SHUTDOWN event into response queue.
      
      2. "cat" terminates (to distinguish it from the animal, I quote it).
      
      3. [monitor iothread] QEMU's monitor iothread reads EOF from stdin.
      
      4. [monitor iothread] QEMU's monitor iothread calls the CLOSED event
         hook for the monitor, which will destroy the response queue of the
         monitor, then the SHUTDOWN event is dropped.
      
      5. [main thread] QEMU's main thread cleans up the monitors in
         monitor_cleanup().  When trying to flush pending responses, it sees
         nothing.  SHUTDOWN is lost forever.
      
      Note that before the monitor iothread was introduced, step [4]/[5] could
      never happen since the main loop was the only place to detect the EOF
      event of stdin and run the CLOSED event hooks.  Now things can happen in
      parallel in the iothread.
      
      Without this patch, iotest 087 will have ~10% chance to miss the
      SHUTDOWN event and fail when with Out-Of-Band enabled:
      
        --- /home/peterx/git/qemu/tests/qemu-iotests/087.out
        +++ /home/peterx/git/qemu/bin/tests/qemu-iotests/087.out.bad
        @@ -8,7 +8,6 @@
        {"return": {}}
        {"error": {"class": "GenericError", "desc": "'node-name' must be
        specified for the root node"}}
        {"return": {}}
        -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}}
      
        === Duplicate ID ===
        @@ -53,7 +52,6 @@
        {"return": {}}
        {"return": {}}
        {"return": {}}
      
        -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}}
      
      This patch fixes the problem.
      
      Fixes: 6d2d563f ("qmp: cleanup qmp queues properly", 2018-03-27)
      Suggested-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NPeter Xu <peterx@redhat.com>
      Message-Id: <20180620073223.31964-4-peterx@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      [Commit message and a comment touched up]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      c73a843b
    • P
      monitor: rename *_pop_one to *_pop_any · 40687eb7
      Peter Xu 提交于
      The old names are confusing since both of the old functions are popping
      an item from multiple queues rather than a single queue.  In that
      sense, *_pop_any() suites better than *_pop_one().
      
      Since at it, touch up the function monitor_qmp_response_pop_any() a bit
      to let the callers pass in a QMPResponse struct instead of returning a
      struct.  Change the return value to boolean to mark whether we have
      popped a valid response instead.
      Suggested-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NPeter Xu <peterx@redhat.com>
      Message-Id: <20180620073223.31964-3-peterx@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      40687eb7
    • P
      chardev: comment details for CLOSED event · d8861011
      Peter Xu 提交于
      It was unclear before on what does the CLOSED event mean.  Meanwhile we
      add a TODO to fix up the CLOSED event in the future when the in/out
      ports are different for a chardev.
      
      CC: Paolo Bonzini <pbonzini@redhat.com>
      CC: "Marc-André Lureau" <marcandre.lureau@redhat.com>
      CC: Stefan Hajnoczi <stefanha@redhat.com>
      CC: Markus Armbruster <armbru@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NPeter Xu <peterx@redhat.com>
      Message-Id: <20180620073223.31964-2-peterx@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      d8861011
    • P
      Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging · 6f4fa099
      Peter Maydell 提交于
      Pull request
      
       * Python 3 support in simpletrace.py
       * Convert DPRINTF() to trace events
      
      # gpg: Signature made Fri 29 Jun 2018 18:53:05 BST
      # gpg:                using RSA key 9CA4ABB381AB73C8
      # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
      # gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>"
      # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8
      
      * remotes/stefanha/tags/tracing-pull-request:
        hw/block/pflash_cfi: Convert from DPRINTF() macro to trace events
        hw/block/fdc: Convert from FLOPPY_DPRINTF() macro to trace events
        hw/net/etraxfs_eth: Convert printf() calls to trace events
        hw/net/ne2000: Convert printf() calls to trace events
        hw/net/ne2000: Add trace events
        hw/input/tsc2005: Convert a fprintf() call to trace events
        hw/char/parallel: Convert from pdebug() macro to trace events
        hw/char/serial: Convert from DPRINTF macro to trace events
        sdcard: Reduce sdcard_set_blocklen() trace digits
        trace: Fix format string for the struct timeval members casted to size_t
        simpletrace: Convert name from mapping record to str
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      6f4fa099
    • P
      Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20180629' into staging · 275845ae
      Peter Maydell 提交于
      target-arm queue:
       * last of the SVE patches; SVE is now enabled for aarch64 linux-user
       * sd: Don't trace SDRequest crc field (coverity bugfix)
       * target/arm: Mark PMINTENSET accesses as possibly doing IO
       * clean up v7VE feature bit handling
       * i.mx7d: minor cleanups
       * target/arm: support reading of CNT[VCT|FRQ]_EL0 from user-space
       * target/arm: Implement ARMv8.2-DotProd
       * virt: add addresses to dt node names (which stops dtc from
         complaining that they're not correctly named)
       * cleanups: replace error_setg(&error_fatal) by error_report() + exit()
      
      # gpg: Signature made Fri 29 Jun 2018 15:52:21 BST
      # gpg:                using RSA key 3C2525ED14360CDE
      # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>"
      # gpg:                 aka "Peter Maydell <pmaydell@gmail.com>"
      # gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>"
      # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE
      
      * remotes/pmaydell/tags/pull-target-arm-20180629: (55 commits)
        target/arm: Add ID_ISAR6
        target/arm: Prune a15 features from max
        target/arm: Prune a57 features from max
        target/arm: Fix SVE system register access checks
        target/arm: Fix SVE signed division vs x86 overflow exception
        sdcard: Use the ldst API
        sd: Don't trace SDRequest crc field
        target/arm: Mark PMINTENSET accesses as possibly doing IO
        target/arm: Remove redundant DIV detection for KVM
        target/arm: Add ARM_FEATURE_V7VE for v7 Virtualization Extensions
        i.mx7d: Change IRQ number type from hwaddr to int
        i.mx7d: Change SRC unimplemented device name from sdma to src
        i.mx7d: Remove unused header files
        target/arm: support reading of CNT[VCT|FRQ]_EL0 from user-space
        target/arm: Implement ARMv8.2-DotProd
        target/arm: Enable SVE for aarch64-linux-user
        target/arm: Implement SVE dot product (indexed)
        target/arm: Implement SVE dot product (vectors)
        target/arm: Implement SVE fp complex multiply add (indexed)
        target/arm: Pass index to AdvSIMD FCMLA (indexed)
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      275845ae
    • P
      Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging · ce59ecc4
      Peter Maydell 提交于
      Block layer patches:
      
      - Make truncate operations asynchronous (so that preallocation in
        blockdev-create doesn't block the main loop any more)
      - usb-storage: Add rerror/werror properties
      - nvme: Add num_queues property
      - qemu-img convert: Copy offloading fixes (including data corruption fix)
      - qcow2: Fix cluster leak on temporary write error
      - Use byte-based functions instead of bdrv_co_readv/writev()
      - Various small fixes and cleanups
      
      # gpg: Signature made Fri 29 Jun 2018 15:08:34 BST
      # gpg:                using RSA key 7F09B272C88F2FD6
      # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>"
      # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6
      
      * remotes/kevin/tags/for-upstream: (29 commits)
        block: Remove unused sector-based vectored I/O
        vhdx: Switch to byte-based calls
        replication: Switch to byte-based calls
        qcow: Switch to a byte-based driver
        qcow: Switch qcow_co_writev to byte-based calls
        qcow: Switch qcow_co_readv to byte-based calls
        qcow: Switch get_cluster_offset to be byte-based
        parallels: Switch to byte-based calls
        file-posix: Fix EINTR handling
        iscsi: Don't blindly use designator length in response for memcpy
        qcow2: Fix src_offset in copy offloading
        file-posix: Implement co versions of discard/flush
        qemu-iotests: Test qcow2 not leaking clusters on write error
        qcow2: Free allocated clusters on write error
        qemu-iotests: Update 026.out.nocache reference output
        block/crypto: Simplify block_crypto_{open,create}_opts_init()
        block: Move request tracking to children in copy offloading
        qcow2: Remove dead check on !ret
        file-posix: Make .bdrv_co_truncate asynchronous
        block: Use tracked request for truncate
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      ce59ecc4
  4. 29 6月, 2018 20 次提交