1. 01 3月, 2017 12 次提交
    • K
      block: Request child permissions in format drivers · 862f215f
      Kevin Wolf 提交于
      This makes use of the .bdrv_child_perm() implementation for formats that
      we just added. All format drivers expose the permissions they actually
      need nows, so that they can be set accordingly and updated when parents
      are attached or detached.
      
      The only format not included here is raw, which was already converted
      with the other filter drivers.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Acked-by: NFam Zheng <famz@redhat.com>
      862f215f
    • K
      block: Default .bdrv_child_perm() for format drivers · 6b1a044a
      Kevin Wolf 提交于
      Almost all format drivers have the same characteristics as far as
      permissions are concerned: They have one or more children for storing
      their own data and, more importantly, metadata (can be written to and
      grow even without external write requests, must be protected against
      other writers and present consistent data) and optionally a backing file
      (this is just data, so like for a filter, it only depends on what the
      parent nodes need).
      
      This provides a default implementation that can be shared by most of
      our format drivers.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Acked-by: NFam Zheng <famz@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      6b1a044a
    • K
      block: Request child permissions in filter drivers · d7010dfb
      Kevin Wolf 提交于
      All callers will have to request permissions for all of their child
      nodes. Block drivers that act as simply filters can use the default
      implementation of .bdrv_child_perm().
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Acked-by: NFam Zheng <famz@redhat.com>
      d7010dfb
    • K
      block: Default .bdrv_child_perm() for filter drivers · 6a1b9ee1
      Kevin Wolf 提交于
      Most filters need permissions related to read and write for their
      children, but only if the node has a parent that wants to use the same
      operation on the filter. The same is true for resize.
      
      This adds a default implementation that simply forwards all necessary
      permissions to all children of the node and leaves the other permissions
      unchanged.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Acked-by: NFam Zheng <famz@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      6a1b9ee1
    • K
      block: Involve block drivers in permission granting · 33a610c3
      Kevin Wolf 提交于
      In many cases, the required permissions of one node on its children
      depend on what its parents require from it. For example, the raw format
      or most filter drivers only need to request consistent reads if that's
      something that one of their parents wants.
      
      In order to achieve this, this patch introduces two new BlockDriver
      callbacks. The first one lets drivers first check (recursively) whether
      the requested permissions can be set; the second one actually sets the
      new permission bitmask.
      
      Also add helper functions that drivers can use in their implementation
      of the callbacks to update their permissions on a specific child.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Acked-by: NFam Zheng <famz@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      33a610c3
    • K
      block: Let callers request permissions when attaching a child node · d5e6f437
      Kevin Wolf 提交于
      When attaching a node as a child to a new parent, the required and
      shared permissions for this parent are checked against all other parents
      of the node now, and an error is returned if there is a conflict.
      
      This allows error returns to a function that previously always
      succeeded, and the same is true for quite a few callers and their
      callers. Converting all of them within the same patch would be too much,
      so for now everyone tells that they don't need any permissions and allow
      everyone else to do anything. This way we can use &error_abort initially
      and convert caller by caller to pass actual permission requirements and
      implement error handling.
      
      All these places are marked with FIXME comments and it will be the job
      of the next patches to clean them up again.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Acked-by: NFam Zheng <famz@redhat.com>
      d5e6f437
    • K
      block: Add Error argument to bdrv_attach_child() · 8b2ff529
      Kevin Wolf 提交于
      It will have to return an error soon, so prepare the callers for it.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Acked-by: NFam Zheng <famz@redhat.com>
      8b2ff529
    • K
      block: Add op blocker permission constants · 7006c9a7
      Kevin Wolf 提交于
      This patch defines the permission categories that will be used by the
      new op blocker system.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Acked-by: NFam Zheng <famz@redhat.com>
      7006c9a7
    • M
      option: Tweak invalid size error message and unbreak iotest 049 · 9e19ad4e
      Markus Armbruster 提交于
      Commit 75cdcd15 neglected to update tests/qemu-iotests/049.out, and
      made the error message for negative size worse.  Fix that.
      Reported-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      Tested-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      9e19ad4e
    • P
      qemu-img: make convert async · 2d9187bc
      Peter Lieven 提交于
      the convert process is currently completely implemented with sync operations.
      That means it reads one buffer and then writes it. No parallelism and each sync
      request takes as long as it takes until it is completed.
      
      This can be a big performance hit when the convert process reads and writes
      to devices which do not benefit from kernel readahead or pagecache.
      In our environment we heavily have the following two use cases when using
      qemu-img convert.
      
      a) reading from NFS and writing to iSCSI for deploying templates
      b) reading from iSCSI and writing to NFS for backups
      
      In both processes we use libiscsi and libnfs so we have no kernel cache.
      
      This patch changes the convert process to work with parallel running coroutines
      which can significantly improve performance for network storage devices:
      
      qemu-img (master)
       nfs -> iscsi 22.8 secs
       nfs -> ram   11.7 secs
       ram -> iscsi 12.3 secs
      
      qemu-img-async (8 coroutines, in-order write disabled)
       nfs -> iscsi 11.0 secs
       nfs -> ram   10.4 secs
       ram -> iscsi  9.0 secs
      
      This patches introduces 2 new cmdline parameters. The -m parameter to specify
      the number of coroutines running in parallel (defaults to 8). And the -W parameter to
      allow qemu-img to write to the target out of order rather than sequential. This improves
      performance as the writes do not have to wait for each other to complete.
      Signed-off-by: NPeter Lieven <pl@kamp.de>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      2d9187bc
    • P
      Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging · 9514f264
      Peter Maydell 提交于
      This pull request brings:
      - a fix to a minor bug reported by Coverity
      - throttling support in the local backend (command line only)
      
      # gpg: Signature made Tue 28 Feb 2017 09:32:30 GMT
      # gpg:                using DSA key 0x02FC3AEB0101DBC2
      # gpg: Good signature from "Greg Kurz <groug@kaod.org>"
      # gpg:                 aka "Greg Kurz <groug@free.fr>"
      # gpg:                 aka "Greg Kurz <gkurz@linux.vnet.ibm.com>"
      # gpg:                 aka "Gregory Kurz (Groug) <groug@free.fr>"
      # gpg:                 aka "[jpeg image of size 3330]"
      # gpg: WARNING: This key is not certified with a trusted signature!
      # gpg:          There is no indication that the signature belongs to the owner.
      # Primary key fingerprint: 2BD4 3B44 535E C0A7 9894  DBA2 02FC 3AEB 0101 DBC2
      
      * remotes/gkurz/tags/for-upstream:
        throttle: factor out duplicate code
        fsdev: add IO throttle support to fsdev devices
        9pfs: fix v9fs_lock error case
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      9514f264
    • P
      Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-fetch' into staging · 7d1730b7
      Peter Maydell 提交于
      trivial patches for 2017-02-28
      
      # gpg: Signature made Tue 28 Feb 2017 06:43:55 GMT
      # gpg:                using RSA key 0x701B4F6B1A693E59
      # gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>"
      # gpg:                 aka "Michael Tokarev <mjt@corpit.ru>"
      # gpg:                 aka "Michael Tokarev <mjt@debian.org>"
      # Primary key fingerprint: 6EE1 95D1 886E 8FFB 810D  4324 457C E0A0 8044 65C5
      #      Subkey fingerprint: 7B73 BAD6 8BE7 A2C2 8931  4B22 701B 4F6B 1A69 3E59
      
      * remotes/mjt/tags/trivial-patches-fetch:
        syscall: fixed mincore(2) not failing with ENOMEM
        hw/acpi/tco.c: fix tco timer stop
        lm32: milkymist-tmu2: fix a third integer overflow
        qemu-options.hx: add missing id=chr0 chardev argument in vhost-user example
        Update copyright year
        tests/prom-env: Enable the test for the sun4u machine, too
        cadence_gem: Remove unused parameter debug message
        register: fix incorrect read mask
        ide: remove undefined behavior in ide-test
        CODING_STYLE: Mention preferred comment form
        hw/core/register: Mark the device with cannot_instantiate_with_device_add_yet
        hw/core/or-irq: Mark the device with cannot_instantiate_with_device_add_yet
        softfloat: Use correct type in float64_to_uint64_round_to_zero()
        target/s390x: Fix typo
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      7d1730b7
  2. 28 2月, 2017 28 次提交