1. 16 5月, 2018 32 次提交
  2. 15 5月, 2018 8 次提交
    • K
      Merge remote-tracking branch 'mreitz/tags/pull-block-2018-05-15' into queue-block · 1fce860e
      Kevin Wolf 提交于
      - Copy-on-read block driver
      - The qcow2 default refcount cache size has been decreased
      - Various bug fixes
      
      # gpg: Signature made Tue May 15 16:18:25 2018 CEST
      # gpg:                using RSA key F407DB0061D5CF40
      # gpg: Good signature from "Max Reitz <mreitz@redhat.com>"
      # Primary key fingerprint: 91BE B60A 30DB 3E88 57D1  1829 F407 DB00 61D5 CF40
      
      * mreitz/tags/pull-block-2018-05-15: (21 commits)
        iotests: Add test for -U/force-share conflicts
        qemu-img: Use only string options in img_open_opts
        qemu-io: Use purely string blockdev options
        block: Document BDRV_REQ_WRITE_UNCHANGED support
        qemu-img: Check post-truncation size
        iotests: Add test for COR across nodes
        iotests: Copy 197 for COR filter driver
        iotests: Clean up wrap image in 197
        block: Support BDRV_REQ_WRITE_UNCHANGED in filters
        block/quorum: Support BDRV_REQ_WRITE_UNCHANGED
        block: Set BDRV_REQ_WRITE_UNCHANGED for COR writes
        block: Add BDRV_REQ_WRITE_UNCHANGED flag
        block: BLK_PERM_WRITE includes ..._UNCHANGED
        block: Add COR filter driver
        iotests: Skip 181 and 201 without userfaultfd
        iotests: Add failure matching to common.qemu
        docs: Document the new default sizes of the qcow2 caches
        qcow2: Give the refcount cache the minimum possible size by default
        specs/qcow2: Clarify that compressed clusters have the COPIED bit reset
        Fix error message about compressed clusters with OFLAG_COPIED
        ...
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      1fce860e
    • M
      iotests: Add test for -U/force-share conflicts · 4e7d73c5
      Max Reitz 提交于
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 20180502202051.15493-4-mreitz@redhat.com
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      4e7d73c5
    • M
      qemu-img: Use only string options in img_open_opts · 4615f878
      Max Reitz 提交于
      img_open_opts() takes a QemuOpts and converts them to a QDict, so all
      values therein are strings.  Then it may try to call qdict_get_bool(),
      however, which will fail with a segmentation fault every time:
      
      $ ./qemu-img info -U --image-opts \
          driver=file,filename=/dev/null,force-share=off
      [1]    27869 segmentation fault (core dumped)  ./qemu-img info -U
      --image-opts driver=file,filename=/dev/null,force-share=off
      
      Fix this by using qdict_get_str() and comparing the value as a string.
      Also, when adding a force-share value to the QDict, add it as a string
      so it fits the rest of the dict.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 20180502202051.15493-3-mreitz@redhat.com
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      4615f878
    • M
      qemu-io: Use purely string blockdev options · 2a01c01f
      Max Reitz 提交于
      Currently, qemu-io only uses string-valued blockdev options (as all are
      converted directly from QemuOpts) -- with one exception: -U adds the
      force-share option as a boolean.  This in itself is already a bit
      questionable, but a real issue is that it also assumes the value already
      existing in the options QDict would be a boolean, which is wrong.
      
      That has the following effect:
      
      $ ./qemu-io -r -U --image-opts \
          driver=file,filename=/dev/null,force-share=off
      [1]    15200 segmentation fault (core dumped)  ./qemu-io -r -U
      --image-opts driver=file,filename=/dev/null,force-share=off
      
      Since @opts is converted from QemuOpts, the value must be a string, and
      we have to compare it as such.  Consequently, it makes sense to also set
      it as a string instead of a boolean.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 20180502202051.15493-2-mreitz@redhat.com
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      2a01c01f
    • M
      block: Document BDRV_REQ_WRITE_UNCHANGED support · c1e3489d
      Max Reitz 提交于
      Add BDRV_REQ_WRITE_UNCHANGED to the list of flags honored during pwrite
      and pwrite_zeroes, and also add a note on when you absolutely need to
      support it.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 20180502140359.18222-1-mreitz@redhat.com
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      c1e3489d
    • M
      qemu-img: Check post-truncation size · 5279b303
      Max Reitz 提交于
      Some block drivers (iscsi and file-posix when dealing with device files)
      do not actually support truncation, even though they provide a
      .bdrv_truncate() method and will happily return success when providing a
      new size that does not exceed the current size.  This is because these
      drivers expect the user to resize the image outside of qemu and then
      provide qemu with that information through the block_resize command
      (compare cb1b83e7).
      
      Of course, anyone using qemu-img resize will find that behavior useless.
      So we should check the actual size of the image after the supposedly
      successful truncation took place, emit an error if nothing changed and
      emit a warning if the target size was not met.
      
      Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1523065Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 20180421163957.29872-1-mreitz@redhat.com
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      5279b303
    • M
      iotests: Add test for COR across nodes · 3e7a95fe
      Max Reitz 提交于
      COR across nodes (that is, you have some filter node between the
      actually COR target and the node that performs the COR) cannot reliably
      work together with the permission system when there is no explicit COR
      node that can request the WRITE_UNCHANGED permission for its child.
      This is because COR (currently) sneaks its requests by the usual
      permission checks, so it can work without a WRITE* permission; but if
      there is a filter node in between, that will re-issue the request, which
      then passes through the usual check -- and if nobody has requested a
      WRITE_UNCHANGED permission, that check will fail.
      
      There is no real direct fix apart from hoping that there is someone who
      has requested that permission; in case of just the qemu-io HMP command
      (and no guest device), however, that is not the case.  The real real fix
      is to implement the copy-on-read flag through an implicitly added COR
      node.  Such a node can request the necessary permissions as shown in
      this test.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 20180421132929.21610-10-mreitz@redhat.com
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      3e7a95fe
    • M
      iotests: Copy 197 for COR filter driver · a62cbac4
      Max Reitz 提交于
      iotest 197 tests copy-on-read using the (now old) copy-on-read flag.
      Copy it to 215 and modify it to use the COR filter driver instead.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 20180421132929.21610-9-mreitz@redhat.com
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      a62cbac4