1. 18 3月, 2017 1 次提交
  2. 17 3月, 2017 11 次提交
    • P
      Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging · 31d89228
      Peter Maydell 提交于
      Block layer fixes for 2.9.0-rc1
      
      # gpg: Signature made Fri 17 Mar 2017 12:06:04 GMT
      # gpg:                using RSA key 0x7F09B272C88F2FD6
      # 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:
        block: quiesce AioContext when detaching from it
        thread-pool: add missing qemu_bh_cancel in completion function
        block: Propagate error in bdrv_open_backing_file
        blockdev: fix bitmap clear undo
        block: Always call bdrv_child_check_perm first
        file-posix: Don't leak fd in hdev_get_max_segments
        replication: clarify permissions
        file-posix: clean up max_segments buffer termination
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      31d89228
    • K
      Merge remote-tracking branch 'mreitz/tags/pull-block-2017-03-17' into queue-block · 11f0f5e5
      Kevin Wolf 提交于
      Block patches for 2.9-rc1
      
      # gpg: Signature made Fri Mar 17 12:59:20 2017 CET
      # gpg:                using RSA key 0xF407DB0061D5CF40
      # 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-2017-03-17:
        block: quiesce AioContext when detaching from it
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      11f0f5e5
    • P
      block: quiesce AioContext when detaching from it · c2b6428d
      Paolo Bonzini 提交于
      While it is true that bdrv_set_aio_context only works on a single
      BlockDriverState subtree (see commit message for 53ec73e2, "block: Use
      bdrv_drain to replace uncessary bdrv_drain_all", 2015-07-07), it works
      at the AioContext level rather than the BlockDriverState level.
      
      Therefore, it is also necessary to trigger pending bottom halves too,
      even if no requests are pending.
      
      For NBD this ensures that the aio_co_schedule of a previous call to
      nbd_attach_aio_context is completed before detaching from the old
      AioContext; it fixes qemu-iotest 094.  Another similar bug happens
      when the VM is stopped and the virtio-blk dataplane irqfd is torn down.
      In this case it's possible that guest I/O gets stuck if notify_guest_bh
      was scheduled but doesn't run.
      
      Calling aio_poll from another AioContext is safe if non-blocking; races
      such as the one mentioned in the commit message for c9d1a561 ("block:
      only call aio_poll on the current thread's AioContext", 2016-10-28)
      are a concern for blocking calls.
      
      I considered other options, including:
      
      - moving the bs->wakeup mechanism to AioContext, and letting the caller
      check.  This might work for virtio which has a clear place to wakeup
      (notify_place_bh) and check the condition (virtio_blk_data_plane_stop).
      For aio_co_schedule I couldn't find a clear place to check the condition.
      
      - adding a dummy oneshot bottom half and waiting for it to trigger.
      This has the complication that bottom half list is LIFO for historical
      reasons.  There were performance issues caused by bottom half ordering
      in the past, so I decided against it for 2.9.
      
      Fixes: 99723548Reported-by: NMax Reitz <mreitz@redhat.com>
      Reported-by: NHalil Pasic <pasic@linux.vnet.ibm.com>
      Tested-by: NHalil Pasic <pasic@linux.vnet.ibm.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 20170314111157.14464-2-pbonzini@redhat.com
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      c2b6428d
    • P
      thread-pool: add missing qemu_bh_cancel in completion function · b7a745dc
      Peter Lieven 提交于
      commit 3c80ca15 fixed a deadlock scenarion with nested aio_poll invocations.
      
      However, the rescheduling of the completion BH introcuded unnecessary spinning
      in the main-loop. On very fast file backends this can even lead to the
      "WARNING: I/O thread spun for 1000 iterations" message popping up.
      
      Callgrind reports about 3-4% less instructions with this patch running
      qemu-img bench on a ramdisk based VMDK file.
      
      Fixes: 3c80ca15
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NPeter Lieven <pl@kamp.de>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      b7a745dc
    • F
      block: Propagate error in bdrv_open_backing_file · 8cd1a3e4
      Fam Zheng 提交于
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Reviewed-by: NAlberto Garcia <berto@igalia.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      8cd1a3e4
    • J
      blockdev: fix bitmap clear undo · 184dd9c4
      John Snow 提交于
      Only undo the action if we actually prepared the action.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      184dd9c4
    • F
      block: Always call bdrv_child_check_perm first · c1cef672
      Fam Zheng 提交于
      bdrv_child_set_perm alone is not very usable because the caller must
      call bdrv_child_check_perm first. This is already encapsulated
      conveniently in bdrv_child_try_set_perm, so remove the other prototypes
      from the header and fix the one wrong caller, block/mirror.c.
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      c1cef672
    • F
      file-posix: Don't leak fd in hdev_get_max_segments · fed414df
      Fam Zheng 提交于
      This fixes a leaked fd introduced in commit 9103f1ce.
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      fed414df
    • C
      replication: clarify permissions · 37a9051c
      Changlong Xie 提交于
      Even if hidden_disk, secondary_disk are backing files, they all need
      write permissions in replication scenario. Otherwise we will encouter
      below exceptions on secondary side during adding nbd server:
      
      {'execute': 'nbd-server-add', 'arguments': {'device': 'colo-disk', 'writable': true } }
      {"error": {"class": "GenericError", "desc": "Conflicts with use by hidden-qcow2-driver as 'backing', which does not allow 'write' on sec-qcow2-driver-for-nbd"}}
      
      CC: Zhang Hailiang <zhang.zhanghailiang@huawei.com>
      CC: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
      CC: Wen Congyang <wencongyang2@huawei.com>
      Signed-off-by: NChanglong Xie <xiecl.fnst@cn.fujitsu.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      37a9051c
    • S
      file-posix: clean up max_segments buffer termination · 69583490
      Stefan Hajnoczi 提交于
      The following pattern is unsafe:
      
        char buf[32];
        ret = read(fd, buf, sizeof(buf));
        ...
        buf[ret] = 0;
      
      If read(2) returns 32 then a byte beyond the end of the buffer is
      zeroed.
      
      In practice this buffer overflow does not occur because the sysfs
      max_segments file only contains an unsigned short + '\n'.  The string is
      always shorter than 32 bytes.
      
      Regardless, avoid this pattern because static analysis tools might
      complain and it could lead to real buffer overflows if copy-pasted
      elsewhere in the codebase.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      69583490
    • P
      Merge remote-tracking branch 'remotes/kraxel/tags/pull-cirrus-20170316-1' into staging · 272d7dee
      Peter Maydell 提交于
      cirrus: blitter fixes.
      
      # gpg: Signature made Thu 16 Mar 2017 09:05:22 GMT
      # gpg:                using RSA key 0x4CB6D8EED3E87138
      # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
      # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
      # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
      # Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138
      
      * remotes/kraxel/tags/pull-cirrus-20170316-1:
        cirrus: stop passing around src pointers in the blitter
        cirrus: stop passing around dst pointers in the blitter
        cirrus: fix cirrus_invalidate_region
        cirrus: add option to disable blitter
        cirrus: switch to 4 MB video memory by default
        cirrus/vnc: zap bitblit support from console code.
        fix :cirrus_vga fix OOB read case qemu Segmentation fault
      
      # Conflicts:
      #	include/hw/compat.h
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      272d7dee
  3. 16 3月, 2017 28 次提交