1. 26 4月, 2017 3 次提交
  2. 25 4月, 2017 3 次提交
  3. 24 4月, 2017 2 次提交
  4. 21 4月, 2017 3 次提交
  5. 11 4月, 2017 2 次提交
    • F
      block: Use bdrv_coroutine_enter to start I/O coroutines · e92f0e19
      Fam Zheng 提交于
      BDRV_POLL_WHILE waits for the started I/O by releasing bs's ctx then polling
      the main context, which relies on the yielded coroutine continuing on bs->ctx
      before notifying qemu_aio_context with bdrv_wakeup().
      
      Thus, using qemu_coroutine_enter to start I/O is wrong because if the coroutine
      is entered from main loop, co->ctx will be qemu_aio_context, as a result of the
      "release, poll, acquire" loop of BDRV_POLL_WHILE, race conditions happen when
      both main thread and the iothread access the same BDS:
      
        main loop                                iothread
      -----------------------------------------------------------------------
        blockdev_snapshot
          aio_context_acquire(bs->ctx)
                                                 virtio_scsi_data_plane_handle_cmd
          bdrv_drained_begin(bs->ctx)
          bdrv_flush(bs)
            bdrv_co_flush(bs)                      aio_context_acquire(bs->ctx).enter
              ...
              qemu_coroutine_yield(co)
            BDRV_POLL_WHILE()
              aio_context_release(bs->ctx)
                                                   aio_context_acquire(bs->ctx).return
                                                     ...
                                                       aio_co_wake(co)
              aio_poll(qemu_aio_context)               ...
                co_schedule_bh_cb()                    ...
                  qemu_coroutine_enter(co)             ...
      
                    /* (A) bdrv_co_flush(bs)           /* (B) I/O on bs */
                            continues... */
                                                   aio_context_release(bs->ctx)
              aio_context_acquire(bs->ctx)
      
      Note that in above case, bdrv_drained_begin() doesn't do the "release,
      poll, acquire" in BDRV_POLL_WHILE, because bs->in_flight == 0.
      
      Fix this by using bdrv_coroutine_enter and enter coroutine in the right
      context.
      
      iotests 109 output is updated because the coroutine reenter flow during
      mirror job complete is different (now through co_queue_wakeup, instead
      of the unconditional qemu_coroutine_switch before), making the end job
      len different.
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Acked-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      e92f0e19
    • F
      tests/block-job-txn: Don't start block job before adding to txn · d90fce94
      Fam Zheng 提交于
      Previously, before test_block_job_start returns, the job can already
      complete, as a result, the transactional state of other jobs added to
      the same txn later cannot be handled correctly.
      
      Move the block_job_start() calls to callers after
      block_job_txn_add_job() calls.
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Acked-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      d90fce94
  6. 07 4月, 2017 1 次提交
  7. 04 4月, 2017 2 次提交
  8. 03 4月, 2017 3 次提交
    • E
      iotests: Improve image-clear tests on non-aligned image · f82c5b17
      Eric Blake 提交于
      Tweak 097 and 176 to operate on an image that is not cluster-aligned,
      to give further coverage of clearing out an entire image, including
      the recent fix to eliminate the difference between fast path (97) and
      slow (176) for qcow2.  Also tested on qcow (97 only, since qcow lacks
      snapshots).
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-id: 20170331185356.2479-4-eblake@redhat.com
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      f82c5b17
    • D
      iotests: fix 097 when run with qcow · 07ff948b
      Daniel P. Berrange 提交于
      The previous commit:
      
        commit a3e1505d
        Author: Eric Blake <eblake@redhat.com>
        Date:   Mon Dec 5 09:49:34 2016 -0600
      
          qcow2: Don't strand clusters near 2G intervals during commit
      
      extended the 097 test case so that it did two passes, once
      with an internal snapshot, once without.
      
      qcow (v1) does not support internal snapshots, so this change
      broke test 097 when run against qcow.
      
      This splits 097 in two, creating a new 176 that tests the
      internal snapshot codepath, effectively putting 097 back
      to its content before the above commit.
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <20170221115512.21918-8-berrange@redhat.com>
      [eblake: test collisions: s/173/176/g]
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-id: 20170331185356.2479-2-eblake@redhat.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      07ff948b
    • M
      nbd: Tidy up blockdev-add interface · 9445673e
      Markus Armbruster 提交于
      SocketAddress is a simple union, and simple unions are awkward: they
      have their variant members wrapped in a "data" object on the wire, and
      require additional indirections in C.  I intend to limit its use to
      existing external interfaces, and convert all internal interfaces to
      SocketAddressFlat.
      
      BlockdevOptionsNbd is an external interface using SocketAddress.  We
      already use SocketAddressFlat elsewhere in blockdev-add.  Replace it
      by SocketAddressFlat while we can (it's new in 2.9) for simplicity and
      consistency.  For example,
      
          { "execute": "blockdev-add",
            "arguments": { "node-name": "foo", "driver": "nbd",
                           "server": { "type": "inet",
      		                 "data": { "host": "localhost",
      				           "port": "12345" } } } }
      
      becomes
      
          { "execute": "blockdev-add",
            "arguments": { "node-name": "foo", "driver": "nbd",
                           "server": { "type": "inet",
      		                 "host": "localhost", "port": "12345" } } }
      
      Since the internal interfaces still take SocketAddress, this requires
      conversion function socket_address_crumple().  It'll go away when I
      update the interfaces.
      
      Unfortunately, SocketAddress is also visible in -drive since 2.8:
      
          -drive if=none,driver=nbd,server.type=inet,server.data.host=127.0.0.1,server.data.port=12345
      
      Nobody should be using it, as it's fairly new and has never been
      documented, so adding still more compatibility gunk to keep it working
      isn't worth the trouble.  You now have to use
      
          -drive if=none,driver=nbd,server.type=inet,server.host=127.0.0.1,server.port=12345
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-id: 1490895797-29094-9-git-send-email-armbru@redhat.com
      
      [mreitz: Change iotest 147 accordingly]
      
      Because of this interface change, iotest 147 has to be adapted.
      Unfortunately, we cannot just flatten all of the addresses because
      nbd-server-start still takes a plain SocketAddress. Therefore, we need
      both and this is most easily achieved by writing the SocketAddress into
      the code and flattening it where necessary.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 20170330221243.17333-1-mreitz@redhat.com
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      9445673e
  9. 31 3月, 2017 1 次提交
  10. 28 3月, 2017 2 次提交
  11. 24 3月, 2017 1 次提交
  12. 23 3月, 2017 1 次提交
  13. 22 3月, 2017 2 次提交
  14. 21 3月, 2017 6 次提交
  15. 16 3月, 2017 8 次提交