1. 27 2月, 2017 5 次提交
  2. 26 2月, 2017 9 次提交
    • P
      slirp: tcp_listen(): Don't try to close() an fd we never opened · bd5d2353
      Peter Maydell 提交于
      Coverity points out (CID 1005725) that an error-exit path in tcp_listen()
      will try to close(s) even if the reason it got there was that the
      qemu_socket() failed and s was never opened.  Not only that, this isn't even
      the right function to use, because we need closesocket() to do the right
      thing on Windows.  Change to using the right function and only calling it if
      needed.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Signed-off-by: NSamuel Thibault <samuel.thibault@ens-lyon.org>
      bd5d2353
    • P
      slirp: Convert mbufs to use g_malloc() and g_free() · 70f2e64e
      Peter Maydell 提交于
      The mbuf code currently doesn't check the result of doing a malloc()
      or realloc() of its data (spotted by Coverity, CID 1238946).
      Since the m_inc() API assumes that extending an mbuf must succeed,
      just convert to g_malloc() and g_free().
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Signed-off-by: NSamuel Thibault <samuel.thibault@ens-lyon.org>
      70f2e64e
    • P
      slirp: Check qemu_socket() return value in udp_listen() · 4577b09a
      Peter Maydell 提交于
      Check the return value from qemu_socket() rather than trying to
      pass it to bind() as an fd argument even if it's negative.
      This wouldn't have caused any negative consequences, because
      it won't be a valid fd number and the bind call will fail;
      but Coverity complains (CID 1005723).
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Signed-off-by: NSamuel Thibault <samuel.thibault@ens-lyon.org>
      4577b09a
    • P
      Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging · 6b4e463f
      Peter Maydell 提交于
      Block layer patches
      
      # gpg: Signature made Fri 24 Feb 2017 18:08:26 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:
        tests: Use opened block node for block job tests
        vvfat: Use opened node as backing file
        block: Add bdrv_new_open_driver()
        block: Factor out bdrv_open_driver()
        block: Use BlockBackend for image probing
        block: Factor out bdrv_open_child_bs()
        block: Attach bs->file only during .bdrv_open()
        block: Pass BdrvChild to bdrv_truncate()
        mirror: Resize active commit base in mirror_run()
        qcow2: Use BB for resizing in qcow2_amend_options()
        blockdev: Use BlockBackend to resize in qmp_block_resize()
        iotests: Fix another race in 030
        qemu-img: Improve documentation for PREALLOC_MODE_FALLOC
        qemu-img: Truncate before full preallocation
        qemu-img: Add tests for raw image preallocation
        qemu-img: Do not truncate before preallocation
        qemu-iotests: redirect nbd server stdout to /dev/null
        qemu-iotests: add ability to exclude certain protocols from tests
        qemu-iotests: Test 137 only supports 'file' protocol
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      6b4e463f
    • P
      Merge remote-tracking branch 'remotes/cody/tags/block-pull-request' into staging · 6528a4c1
      Peter Maydell 提交于
      # gpg: Signature made Fri 24 Feb 2017 17:45:53 GMT
      # gpg:                using RSA key 0xBDBE7B27C0DE3057
      # gpg: Good signature from "Jeffrey Cody <jcody@redhat.com>"
      # gpg:                 aka "Jeffrey Cody <jeff@codyprime.org>"
      # gpg:                 aka "Jeffrey Cody <codyprime@gmail.com>"
      # Primary key fingerprint: 9957 4B4D 3474 90E7 9D98  D624 BDBE 7B27 C0DE 3057
      
      * remotes/cody/tags/block-pull-request:
        RBD: Add support readv,writev for rbd
        block/nfs: try to avoid the bounce buffer in pwritev
        block/nfs: convert to preadv / pwritev
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      6528a4c1
    • P
      Merge remote-tracking branch 'remotes/yongbok/tags/mips-20170224-2' into staging · 6d3f4c6d
      Peter Maydell 提交于
      MIPS patches 2017-02-24-2
      
      CHanges:
      * Add the Boston board with fixing the make check issue on 32-bit hosts.
      
      # gpg: Signature made Fri 24 Feb 2017 11:43:45 GMT
      # gpg:                using RSA key 0x2238EB86D5F797C2
      # gpg: Good signature from "Yongbok Kim <yongbok.kim@imgtec.com>"
      # gpg: WARNING: This key is not certified with sufficiently trusted signatures!
      # gpg:          It is not certain that the signature belongs to the owner.
      # Primary key fingerprint: 8600 4CF5 3415 A5D9 4CFA  2B5C 2238 EB86 D5F7 97C2
      
      * remotes/yongbok/tags/mips-20170224-2:
        hw/mips: MIPS Boston board support
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      6d3f4c6d
    • P
      Merge remote-tracking branch 'remotes/stsquad/tags/pull-mttcg-240217-1' into staging · 28f997a8
      Peter Maydell 提交于
      This is the MTTCG pull-request as posted yesterday.
      
      # gpg: Signature made Fri 24 Feb 2017 11:17:51 GMT
      # gpg:                using RSA key 0xFBD0DB095A9E2A44
      # gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>"
      # Primary key fingerprint: 6685 AE99 E751 67BC AFC8  DF35 FBD0 DB09 5A9E 2A44
      
      * remotes/stsquad/tags/pull-mttcg-240217-1: (24 commits)
        tcg: enable MTTCG by default for ARM on x86 hosts
        hw/misc/imx6_src: defer clearing of SRC_SCR reset bits
        target-arm: ensure all cross vCPUs TLB flushes complete
        target-arm: don't generate WFE/YIELD calls for MTTCG
        target-arm/powerctl: defer cpu reset work to CPU context
        cputlb: introduce tlb_flush_*_all_cpus[_synced]
        cputlb: atomically update tlb fields used by tlb_reset_dirty
        cputlb: add tlb_flush_by_mmuidx async routines
        cputlb and arm/sparc targets: convert mmuidx flushes from varg to bitmap
        cputlb: introduce tlb_flush_* async work.
        cputlb: tweak qemu_ram_addr_from_host_nofail reporting
        cputlb: add assert_cpu_is_self checks
        tcg: handle EXCP_ATOMIC exception for system emulation
        tcg: enable thread-per-vCPU
        tcg: enable tb_lock() for SoftMMU
        tcg: remove global exit_request
        tcg: drop global lock during TCG code execution
        tcg: rename tcg_current_cpu to tcg_current_rr_cpu
        tcg: add kick timer for single-threaded vCPU emulation
        tcg: add options for enabling MTTCG
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      28f997a8
    • P
      Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20170224' into staging · 2421f381
      Peter Maydell 提交于
      A selection of s390x patches:
      - cleanups, fixes and improvements
      - program check loop detection (useful with the corresponding kernel
        patch)
      - wire up virtio-crypto for ccw
      - and finally support many virtqueues for virtio-ccw
      
      # gpg: Signature made Fri 24 Feb 2017 09:19:19 GMT
      # gpg:                using RSA key 0xDECF6B93C6F02FAF
      # gpg: Good signature from "Cornelia Huck <huckc@linux.vnet.ibm.com>"
      # gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>"
      # Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF
      
      * remotes/cohuck/tags/s390x-20170224:
        s390x/css: handle format-0 TIC CCW correctly
        s390x/arch_dump: pass cpuid into notes sections
        s390x/arch_dump: use proper note name and note size
        virtio-ccw: support VIRTIO_QUEUE_MAX virtqueues
        s390x: bump ADAPTER_ROUTES_MAX_GSI
        virtio-ccw: check flic->adapter_routes_max_batch
        s390x: add property adapter_routes_max_batch
        virtio-ccw: Check the number of vqs in CCW_CMD_SET_IND
        virtio-ccw: add virtio-crypto-ccw device
        virtio-ccw: handle virtio 1 only devices
        s390x/flic: fail migration on source already
        s390x/kvm: detect some program check loops
        s390x/s390-virtio: get rid of DPRINTF
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      2421f381
    • P
      Merge remote-tracking branch 'remotes/famz/tags/for-upstream' into staging · f62ab6bb
      Peter Maydell 提交于
      Docker testing and shippable patches
      
      Hi Peter,
      
      These are testing and build automation patches:
      
      - Shippable.com powered CI config
      - Docker cross build
      - Fixes and MAINTAINERS tweaks.
      
      # gpg: Signature made Fri 24 Feb 2017 06:31:10 GMT
      # gpg:                using RSA key 0xCA35624C6A9171C6
      # gpg: Good signature from "Fam Zheng <famz@redhat.com>"
      # 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: 5003 7CB7 9706 0F76 F021  AD56 CA35 624C 6A91 71C6
      
      * remotes/famz/tags/for-upstream:
        docker: Install python2 explicitly in docker image
        MAINTAINERS: merge Build and test automation with Docker tests
        .shippable.yml: new CI provider
        new: debian docker targets for cross-compiling
        tests/docker: add basic user mapping support
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      f62ab6bb
  3. 25 2月, 2017 5 次提交
    • P
      Merge remote-tracking branch 'remotes/armbru/tags/pull-util-2017-02-23' into staging · d7941f4e
      Peter Maydell 提交于
      option cutils: Fix and clean up number conversions
      
      # gpg: Signature made Thu 23 Feb 2017 19:41:17 GMT
      # gpg:                using RSA key 0x3870B400EB918653
      # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
      # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>"
      # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653
      
      * remotes/armbru/tags/pull-util-2017-02-23: (24 commits)
        option: Fix checking of sizes for overflow and trailing crap
        util/cutils: Change qemu_strtosz*() from int64_t to uint64_t
        util/cutils: Return qemu_strtosz*() error and value separately
        util/cutils: Let qemu_strtosz*() optionally reject trailing crap
        qemu-img: Wrap cvtnum() around qemu_strtosz()
        test-cutils: Drop suffix from test_qemu_strtosz_simple()
        test-cutils: Use qemu_strtosz() more often
        util/cutils: Drop QEMU_STRTOSZ_DEFSUFFIX_* macros
        util/cutils: New qemu_strtosz()
        util/cutils: Rename qemu_strtosz() to qemu_strtosz_MiB()
        util/cutils: New qemu_strtosz_metric()
        test-cutils: Cover qemu_strtosz() around range limits
        test-cutils: Cover qemu_strtosz() with trailing crap
        test-cutils: Cover qemu_strtosz() invalid input
        test-cutils: Add missing qemu_strtosz()... endptr checks
        option: Fix to reject invalid and overflowing numbers
        util/cutils: Clean up control flow around qemu_strtol() a bit
        util/cutils: Clean up variable names around qemu_strtol()
        util/cutils: Rename qemu_strtoll(), qemu_strtoull()
        util/cutils: Rewrite documentation of qemu_strtol() & friends
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      d7941f4e
    • T
      RBD: Add support readv,writev for rbd · 1d393bde
      tianqing 提交于
      Rbd can do readv and writev directly, so wo do not need to transform
      iov to buf or vice versa any more.
      Signed-off-by: Ntianqing <tianqing@unitedstack.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      1d393bde
    • P
      block/nfs: try to avoid the bounce buffer in pwritev · ef503a84
      Peter Lieven 提交于
      if the passed qiov contains exactly one iov we can
      pass the buffer directly.
      Signed-off-by: NPeter Lieven <pl@kamp.de>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Message-id: 1487349541-10201-3-git-send-email-pl@kamp.de
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      ef503a84
    • P
      block/nfs: convert to preadv / pwritev · 69785a22
      Peter Lieven 提交于
      Signed-off-by: NPeter Lieven <pl@kamp.de>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Message-id: 1487349541-10201-2-git-send-email-pl@kamp.de
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      69785a22
    • P
      Merge remote-tracking branch 'remotes/awilliam/tags/vfio-updates-20170223.0' into staging · 6959e452
      Peter Maydell 提交于
      VFIO updates 2017-02-23
      
       - Report qdev_unplug errors (Alex Williamson)
       - Fix ecap ID 0 handling, improve comment (Alex Williamson)
       - Disable IGD stolen memory in UPT mode too (Xiong Zhang)
      
      # gpg: Signature made Thu 23 Feb 2017 19:04:17 GMT
      # gpg:                using RSA key 0x239B9B6E3BB08B22
      # gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>"
      # gpg:                 aka "Alex Williamson <alex@shazbot.org>"
      # gpg:                 aka "Alex Williamson <alwillia@redhat.com>"
      # gpg:                 aka "Alex Williamson <alex.l.williamson@gmail.com>"
      # Primary key fingerprint: 42F6 C04E 540B D1A9 9E7B  8A90 239B 9B6E 3BB0 8B22
      
      * remotes/awilliam/tags/vfio-updates-20170223.0:
        vfio/pci-quirks.c: Disable stolen memory for igd VFIO
        vfio/pci: Improve extended capability comments, skip masked caps
        vfio/pci: Report errors from qdev_unplug() via device request
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      6959e452
  4. 24 2月, 2017 21 次提交
    • K
      tests: Use opened block node for block job tests · d185cf0e
      Kevin Wolf 提交于
      blk_insert_bs() and block job related functions will soon require an
      opened block node (permission calculations will involve the block
      driver), so let our tests be consistent with the real users in this
      respect.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      d185cf0e
    • K
      vvfat: Use opened node as backing file · a8a4d15c
      Kevin Wolf 提交于
      We should not try to assign a not yet opened node as the backing file,
      because as soon as the permission system is added it will fail.  The
      just added bdrv_new_open_driver() function is the right tool to open a
      file with an internal driver, use it.
      
      In case anyone wonders whether that magic fake backing file to trigger a
      special action on 'commit' actually works today: No, not for me. One
      reason is that we've been adding a raw format driver on top for several
      years now and raw doesn't support commit. Other reasons include that the
      backing file isn't writable and the driver doesn't support reopen, and
      it's also size 0 and the driver doesn't support bdrv_truncate. All of
      these are easily fixable, but then 'commit' ended up in an infinite loop
      deep in the vvfat code for me, so I thought I'd best leave it alone. I'm
      not really sure what it was supposed to do anyway.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      a8a4d15c
    • K
      block: Add bdrv_new_open_driver() · 680c7f96
      Kevin Wolf 提交于
      This function allows to create more or less normal BlockDriverStates
      even for BlockDrivers that aren't globally registered (e.g. helper
      filters for block jobs).
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      680c7f96
    • K
      block: Factor out bdrv_open_driver() · 01a56501
      Kevin Wolf 提交于
      This is a function that doesn't do any option parsing, but just does
      some basic BlockDriverState setup and calls the .bdrv_open() function of
      the block driver.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      01a56501
    • K
      block: Use BlockBackend for image probing · 5696c6e3
      Kevin Wolf 提交于
      This fixes the use of a parent-less BdrvChild in bdrv_open_inherit() by
      converting it into a BlockBackend. Which is exactly what it should be,
      image probing is an external, standalone user of a node. The requests
      can't be considered to originate from the format driver node because
      that one isn't even opened yet.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      5696c6e3
    • K
      block: Factor out bdrv_open_child_bs() · 2d6b86af
      Kevin Wolf 提交于
      This is the part of bdrv_open_child() that opens a BDS with option
      inheritance, but doesn't attach it as a child to the parent yet.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      2d6b86af
    • K
      block: Attach bs->file only during .bdrv_open() · 4e4bf5c4
      Kevin Wolf 提交于
      The way that attaching bs->file worked was a bit unusual in that it was
      the only child that would be attached to a node which is not opened yet.
      Because of this, the block layer couldn't know yet which permissions the
      driver would eventually need.
      
      This patch moves the point where bs->file is attached to the beginning
      of the individual .bdrv_open() implementations, so drivers already know
      what they are going to do with the child. This is also more consistent
      with how driver-specific children work.
      
      For a moment, bdrv_open() gets its own BdrvChild to perform image
      probing, but instead of directly assigning this BdrvChild to the BDS, it
      becomes a temporary one and the node name is passed as an option to the
      drivers, so that they can simply use bdrv_open_child() to create another
      reference for their own use.
      
      This duplicated child for (the not opened yet) bs is not the final
      state, a follow-up patch will change the image probing code to use a
      BlockBackend, which is completely independent of bs.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      4e4bf5c4
    • K
      block: Pass BdrvChild to bdrv_truncate() · 52cdbc58
      Kevin Wolf 提交于
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      52cdbc58
    • K
      mirror: Resize active commit base in mirror_run() · becc347e
      Kevin Wolf 提交于
      This is more consistent with the commit block job, and it moves the code
      to a place where we already have the necessary BlockBackends to resize
      the base image when bdrv_truncate() is changed to require a BdrvChild.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      becc347e
    • K
      qcow2: Use BB for resizing in qcow2_amend_options() · 70b27f36
      Kevin Wolf 提交于
      In order to able to convert bdrv_truncate() to take a BdrvChild and
      later to correctly check the resize permission here, we need to use a
      BlockBackend for resizing the image.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      70b27f36
    • K
      blockdev: Use BlockBackend to resize in qmp_block_resize() · 7dad9ee6
      Kevin Wolf 提交于
      In order to be able to do permission checking and to keep working with
      the BdrvChild based bdrv_truncate() that this involves, we need to
      create a temporary BlockBackend to resize the image.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      7dad9ee6
    • J
      iotests: Fix another race in 030 · 2c3b44da
      John Snow 提交于
      We can't rely on a non-paused job to be present and running for us.
      Assume that if the job is not present that it completed already.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      2c3b44da
    • N
      qemu-img: Improve documentation for PREALLOC_MODE_FALLOC · c6ccc2c5
      Nir Soffer 提交于
      Now that we are truncating the file in both PREALLOC_MODE_FULL and
      PREALLOC_MODE_OFF, not truncating in PREALLOC_MODE_FALLOC looks odd.
      Add a comment explaining why we do not truncate in this case.
      Signed-off-by: NNir Soffer <nirsof@gmail.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      c6ccc2c5
    • N
      qemu-img: Truncate before full preallocation · 5a1dad9d
      Nir Soffer 提交于
      In a previous commit (qemu-img: Do not truncate before preallocation) we
      moved truncate to the PREALLOC_MODE_OFF branch to avoid slowdown in
      posix_fallocate().
      
      However this change is not optimal when using PREALLOC_MODE_FULL, since
      knowing the final size from the beginning could allow the file system
      driver to do less allocations and possibly avoid fragmentation of the
      file.
      
      Now we truncate also before doing full preallocation.
      Signed-off-by: NNir Soffer <nirsof@gmail.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      5a1dad9d
    • N
      qemu-img: Add tests for raw image preallocation · 6f993f3f
      Nir Soffer 提交于
      Add tests for creating raw image with and without the preallocation
      option.
      Signed-off-by: NNir Soffer <nirsof@gmail.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      6f993f3f
    • N
      qemu-img: Do not truncate before preallocation · f6a72404
      Nir Soffer 提交于
      When using file system that does not support fallocate() (e.g. NFS <
      4.2), truncating the file only when preallocation=OFF speeds up creating
      raw file.
      
      Here is example run, tested on Fedora 24 machine, creating raw file on
      NFS version 3 server.
      
      $ time ./qemu-img-master create -f raw -o preallocation=falloc mnt/test 1g
      Formatting 'mnt/test', fmt=raw size=1073741824 preallocation=falloc
      
      real	0m21.185s
      user	0m0.022s
      sys	0m0.574s
      
      $ time ./qemu-img-fix create -f raw -o preallocation=falloc mnt/test 1g
      Formatting 'mnt/test', fmt=raw size=1073741824 preallocation=falloc
      
      real	0m11.601s
      user	0m0.016s
      sys	0m0.525s
      
      $ time dd if=/dev/zero of=mnt/test bs=1M count=1024 oflag=direct
      1024+0 records in
      1024+0 records out
      1073741824 bytes (1.1 GB, 1.0 GiB) copied, 15.6627 s, 68.6 MB/s
      
      real	0m16.104s
      user	0m0.009s
      sys	0m0.220s
      
      Running with strace we can see that without this change we do one
      pread() and one pwrite() for each block. With this change, we do only
      one pwrite() per block.
      
      $ strace ./qemu-img-master create -f raw -o preallocation=falloc mnt/test 8192
      ...
      pread64(9, "\0", 1, 4095)               = 1
      pwrite64(9, "\0", 1, 4095)              = 1
      pread64(9, "\0", 1, 8191)               = 1
      pwrite64(9, "\0", 1, 8191)              = 1
      
      $ strace ./qemu-img-fix create -f raw -o preallocation=falloc mnt/test 8192
      ...
      pwrite64(9, "\0", 1, 4095)              = 1
      pwrite64(9, "\0", 1, 8191)              = 1
      
      This happens because posix_fallocate is checking if each block is
      allocated before writing a byte to the block, and when truncating the
      file before preallocation, all blocks are unallocated.
      Signed-off-by: NNir Soffer <nirsof@gmail.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      f6a72404
    • J
      qemu-iotests: redirect nbd server stdout to /dev/null · 43421ea0
      Jeff Cody 提交于
      Some iotests (e.g. 174) try to filter the output of _make_test_image by
      piping the stdout.  Pipe the server stdout to /dev/null, so that filter
      pipe does not need to wait until process completion.
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      43421ea0
    • J
      qemu-iotests: add ability to exclude certain protocols from tests · dfac03dc
      Jeff Cody 提交于
      Add the ability for shell script tests to exclude specific
      protocols.  This is useful to allow all protocols except ones known to
      not support a feature used in the test (e.g. .bdrv_create).
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      dfac03dc
    • J
      qemu-iotests: Test 137 only supports 'file' protocol · 2b12baf0
      Jeff Cody 提交于
      Since test 137 make uses of qcow2.py, only local files are supported.
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      2b12baf0
    • P
      Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2017-02-22' into staging · fe8ee082
      Peter Maydell 提交于
      QAPI patches for 2017-02-22
      
      # gpg: Signature made Wed 22 Feb 2017 19:12:27 GMT
      # gpg:                using RSA key 0x3870B400EB918653
      # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
      # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>"
      # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653
      
      * remotes/armbru/tags/pull-qapi-2017-02-22:
        block: Don't bother asserting type of output visitor's output
        monitor: Clean up handle_hmp_command() a bit
        tests: Don't check qobject_type() before qobject_to_qbool()
        tests: Don't check qobject_type() before qobject_to_qfloat()
        tests: Don't check qobject_type() before qobject_to_qint()
        tests: Don't check qobject_type() before qobject_to_qstring()
        tests: Don't check qobject_type() before qobject_to_qlist()
        Don't check qobject_type() before qobject_to_qdict()
        test-qmp-event: Simplify and tighten event_test_emit()
        libqtest: Clean up qmp_response() a bit
        check-qjson: Simplify around compare_litqobj_to_qobj()
        check-qdict: Tighten qdict_crumple_test_recursive() some
        check-qdict: Simplify qdict_crumple_test_recursive()
        qdict: Make qdict_get_qlist() safe like qdict_get_qdict()
        net: Flatten simple union NetLegacyOptions
        numa: Flatten simple union NumaOptions
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      fe8ee082
    • P
      Merge remote-tracking branch 'remotes/kraxel/tags/pull-cve-2017-2620-20170224-1' into staging · 63f495be
      Peter Maydell 提交于
      cirrus: add blit_is_unsafe call to cirrus_bitblt_cputovideo (CVE-2017-2620)
      
      # gpg: Signature made Fri 24 Feb 2017 13:42:39 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-cve-2017-2620-20170224-1:
        cirrus: add blit_is_unsafe call to cirrus_bitblt_cputovideo (CVE-2017-2620)
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      63f495be