1. 01 3月, 2017 2 次提交
  2. 24 2月, 2017 6 次提交
  3. 23 2月, 2017 1 次提交
  4. 12 2月, 2017 2 次提交
    • V
      block: bdrv_invalidate_cache: invalidate children first · 16e977d5
      Vladimir Sementsov-Ogievskiy 提交于
      Current implementation invalidates firstly parent bds and then its
      children. This leads to the following bug:
      
      after incoming migration, in bdrv_invalidate_cache_all:
      1. invalidate parent bds - reopen it with BDRV_O_INACTIVE cleared
      2. child is not yet invalidated
      3. parent check that its BDRV_O_INACTIVE is cleared
      4. parent writes to child
      5. assert in bdrv_co_pwritev, as BDRV_O_INACTIVE is set for child
      
      This patch fixes it by just changing invalidate sequence: invalidate
      children first.
      Signed-off-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-id: 20170131112308.54189-1-vsementsov@virtuozzo.com
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      16e977d5
    • J
      block: check full backing filename when searching protocol filenames · 418661e0
      Jeff Cody 提交于
      In bdrv_find_backing_image(), if we are searching an image for a backing
      file that contains a protocol, we currently only compare unmodified
      paths.
      
      However, some management software will change the backing filename to be
      a relative filename in a path.  QEMU is able to handle this fine,
      because internally it will use path_combine to put together the full
      protocol URI.
      
      However, this can lead to an inability to match an image during a QAPI
      command that needs to use bdrv_find_backing_image() to find the image,
      when it is searched by the full URI.
      
      When searching for a protocol filename, if the straight comparison
      fails, this patch will also compare against the full backing filename to
      see if that is a match.
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Message-id: c2d025adca8a2b665189e6f4cf080f44126d0b6b.1485392617.git.jcody@redhat.com
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      418661e0
  5. 01 2月, 2017 1 次提交
  6. 25 1月, 2017 1 次提交
  7. 11 11月, 2016 2 次提交
  8. 31 10月, 2016 2 次提交
    • A
      block: Support streaming to an intermediate layer · 61b49e48
      Alberto Garcia 提交于
      This makes sure that the image we are streaming into is open in
      read-write mode during the operation.
      
      Operation blockers are also set in all intermediate nodes, since they
      will be removed from the chain afterwards.
      
      Finally, this also unblocks the stream operation in backing files.
      Signed-off-by: NAlberto Garcia <berto@igalia.com>
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      61b49e48
    • A
      block: Pause all jobs during bdrv_reopen_multiple() · 40840e41
      Alberto Garcia 提交于
      When a BlockDriverState is about to be reopened it can trigger certain
      operations that need to write to disk. During this process a different
      block job can be woken up. If that block job completes and also needs
      to call bdrv_reopen() it can happen that it needs to do it on the same
      BlockDriverState that is still in the process of being reopened.
      
      This can have fatal consequences, like in this example:
      
        1) Block job A starts and sleeps after a while.
        2) Block job B starts and tries to reopen node1 (a qcow2 file).
        3) Reopening node1 means flushing and replacing its qcow2 cache.
        4) While the qcow2 cache is being flushed, job A wakes up.
        5) Job A completes and reopens node1, replacing its cache.
        6) Job B resumes, but the cache that was being flushed no longer
           exists.
      
      This patch splits the bdrv_drain_all() call to keep all block jobs
      paused during bdrv_reopen_multiple(), so that step 4 can never happen
      and the operation is safe.
      
      Note that this scenario can only happen if both bdrv_reopen() calls
      are made by block jobs on the same backing chain. Otherwise there's no
      chance that the same BlockDriverState appears in both reopen queues.
      Signed-off-by: NAlberto Garcia <berto@igalia.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      40840e41
  9. 28 10月, 2016 2 次提交
  10. 07 10月, 2016 2 次提交
    • K
      block: Add qdev ID to DEVICE_TRAY_MOVED · 2d76e724
      Kevin Wolf 提交于
      The event currently only contains the BlockBackend name. However, with
      anonymous BlockBackends, this is always the empty string. Add the qdev
      ID (or if none was given, the QOM path) so that the user can still see
      which device caused the event.
      
      Event generation has to be moved from bdrv_eject() to the BlockBackend
      because the BDS doesn't know the attached device, but that's easy
      because blk_eject() is the only user of it.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      2d76e724
    • K
      block: Add bdrv_runtime_opts to query-command-line-options · c5f3014b
      Kevin Wolf 提交于
      Recently we moved a few options from QemuOptsLists in blockdev.c to
      bdrv_runtime_opts in block.c in order to make them accissble using
      blockdev-add. However, this has the side effect that these options are
      missing from query-command-line-options now, and libvirt consequently
      disables the corresponding feature.
      
      This problem was reported as a regression for the 'discard' option,
      introduced in commit 818584a4. However, it is more general than that.
      
      Fix it by adding bdrv_runtime_opts to the list of QemuOptsLists that are
      returned in query-command-line-options. For the future, libvirt is
      advised to use QMP schema introspection for block device options.
      Reported-by: NMichal Privoznik <mprivozn@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Tested-by: NMichal Privoznik <mprivozn@redhat.com>
      Tested-by: NGerd Hoffmann <kraxel@redhat.com>
      c5f3014b
  11. 29 9月, 2016 2 次提交
  12. 23 9月, 2016 5 次提交
  13. 21 9月, 2016 1 次提交
    • M
      blockdev: Add dynamic module loading for block drivers · 88d88798
      Marc Mari 提交于
      Extend the current module interface to allow for block drivers to be
      loaded dynamically on request. The only block drivers that can be
      converted into modules are the drivers that don't perform any init
      operation except for registering themselves.
      
      In addition, only the protocol drivers are being modularized, as they
      are the only ones which see significant performance benefits. The format
      drivers do not generally link to external libraries, so modularizing
      them is of no benefit from a performance perspective.
      
      All the necessary module information is located in a new structure found
      in module_block.h
      
      This spoils the purpose of 5505e8b7 (block/dmg: make it modular).
      
      Before this patch, if module build is enabled, block-dmg.so is linked to
      libbz2, whereas the main binary is not. In downstream, theoretically, it
      means only the qemu-block-extra package depends on libbz2, while the
      main QEMU package needn't to. With this patch, we (temporarily) change
      the case so that the main QEMU depends on libbz2 again.
      Signed-off-by: NMarc Marí <markmb@redhat.com>
      Signed-off-by: NColin Lord <clord@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 1471008424-16465-4-git-send-email-clord@redhat.com
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      [mreitz: Do a signed comparison against the length of
       block_driver_modules[], so it will not cause a compile error when
       empty]
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      88d88798
  14. 13 9月, 2016 1 次提交
  15. 06 9月, 2016 1 次提交
    • K
      nbd-server: Use a separate BlockBackend · cd7fca95
      Kevin Wolf 提交于
      The builtin NBD server uses its own BlockBackend now instead of reusing
      the monitor/guest device one.
      
      This means that it has its own writethrough setting now. The builtin
      NBD server always uses writeback caching now regardless of whether the
      guest device has WCE enabled. qemu-nbd respects the cache mode given on
      the command line.
      
      We still need to keep a reference to the monitor BB because we put an
      eject notifier on it, but we don't use it for any I/O.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      cd7fca95
  16. 20 7月, 2016 1 次提交
  17. 19 7月, 2016 1 次提交
    • E
      block: ignore flush requests when storage is clean · 3ff2f67a
      Evgeny Yakovlev 提交于
      Some guests (win2008 server for example) do a lot of unnecessary
      flushing when underlying media has not changed. This adds additional
      overhead on host when calling fsync/fdatasync.
      
      This change introduces a write generation scheme in BlockDriverState.
      Current write generation is checked against last flushed generation to
      avoid unnessesary flushes.
      
      The problem with excessive flushing was found by a performance test
      which does parallel directory tree creation (from 2 processes).
      Results improved from 0.424 loops/sec to 0.432 loops/sec.
      Each loop creates 10^3 directories with 10 files in each.
      
      This affected some blkdebug testcases that were expecting error logs from
      failure-injected flushes which are now skipped entirely
      (tests 026 071 089).
      
      This also affects the performance of block jobs and thus BLOCK_JOB_READY
      events for driver-mirror and active block-commit commands now arrives
      faster, before QMP send successfully returns to caller (tests 141 144).
      Signed-off-by: NEvgeny Yakovlev <eyakovlev@virtuozzo.com>
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 1468870792-7411-5-git-send-email-den@openvz.org
      CC: Kevin Wolf <kwolf@redhat.com>
      CC: Max Reitz <mreitz@redhat.com>
      CC: Stefan Hajnoczi <stefanha@redhat.com>
      CC: Fam Zheng <famz@redhat.com>
      CC: John Snow <jsnow@redhat.com>
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      3ff2f67a
  18. 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
  19. 05 7月, 2016 5 次提交
  20. 20 6月, 2016 1 次提交