1. 24 2月, 2017 16 次提交
    • 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/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
    • G
      cirrus: add blit_is_unsafe call to cirrus_bitblt_cputovideo (CVE-2017-2620) · 92f2b88c
      Gerd Hoffmann 提交于
      CIRRUS_BLTMODE_MEMSYSSRC blits do NOT check blit destination
      and blit width, at all.  Oops.  Fix it.
      
      Security impact: high.
      
      The missing blit destination check allows to write to host memory.
      Basically same as CVE-2014-8106 for the other blit variants.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      92f2b88c
    • P
      Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-20170223-1' into staging · 5842b55f
      Peter Maydell 提交于
      usb: ohci bugfix, switch core to unrealize, xhci property cleanup
      
      # gpg: Signature made Thu 23 Feb 2017 15:37:57 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-usb-20170223-1:
        xhci: properties cleanup
        usb: ohci: fix error return code in servicing td
        usb: replace handle_destroy with unrealize
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      5842b55f
    • P
      Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.9-20170222' into staging · 55229247
      Peter Maydell 提交于
      ppc patch queue for 2017-02-22
      
      This pull request has:
         * Yet more POWER9 instruction implementations
         * Some extensions to the softfloat code which are necesssary for
           some of those instructions
         * Some preliminary patches in preparation for POWER9 softmmu
           implementation
         * Igor Mammedov's cleanups to unify hotplug cpu handling across
           architectures
         * Assorted bugfixes
      
      The softfloat and cpu hotplug changes aren't entirely ppc specific (in
      fact the hotplug stuff contains some pc specific patches).  However
      they're included here because ppc is one of the main beneficiaries,
      and the series depend on some ppc specific patches.
      
      # gpg: Signature made Wed 22 Feb 2017 06:29:47 GMT
      # gpg:                using RSA key 0x6C38CACA20D9B392
      # gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>"
      # gpg:                 aka "David Gibson (Red Hat) <dgibson@redhat.com>"
      # gpg:                 aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>"
      # gpg:                 aka "David Gibson (kernel.org) <dwg@kernel.org>"
      # Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392
      
      * remotes/dgibson/tags/ppc-for-2.9-20170222: (43 commits)
        hw/ppc/ppc405_uc.c: Avoid integer overflows
        hw/ppc/spapr: Check for valid page size when hot plugging memory
        target-ppc: fix Book-E TLB matching
        hw/net/spapr_llan: 6 byte mac address device tree entry
        machine: replace query_hotpluggable_cpus() callback with has_hotpluggable_cpus flag
        machine: unify [pc_|spapr_]query_hotpluggable_cpus() callbacks
        spapr: reuse machine->possible_cpus instead of cores[]
        change CPUArchId.cpu type to Object*
        pc: pass apic_id to pc_find_cpu_slot() directly so lookup could be done without CPU object
        pc: calculate topology only once when possible_cpus is initialised
        pc: move pcms->possible_cpus init out of pc_cpus_init()
        machine: move possible_cpus to MachineState
        hw/pci-host/prep: Do not use hw_error() in realize function
        target/ppc/POWER9: Direct all instr and data storage interrupts to the hypv
        target/ppc/POWER9: Adapt LPCR handling for POWER9
        target/ppc/POWER9: Add ISAv3.00 MMU definition
        target/ppc: Fix LPCR DPFD mask define
        target-ppc: Add xscvqpudz and xscvqpuwz instructions
        target-ppc: Implement round to odd variants of quad FP instructions
        softfloat: Add float128_to_uint32_round_to_zero()
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      55229247
    • P
      Revert "hw/mips: MIPS Boston board support" · 2d896b45
      Peter Maydell 提交于
      This reverts commit d3473e14.
      
      This commit creates a board which defaults to having 2GB of RAM.
      Unfortunately on 32-bit hosts we can't create boards with 2GB of RAM,
      and so 'make check' fails. I missed this during testing of the
      merge, unfortunately. Luckily the offending commit is the last
      one in the merge request, so we can just revert it for now.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      2d896b45
  2. 23 2月, 2017 4 次提交
    • G
      xhci: properties cleanup · 4f72b8d2
      Gerd Hoffmann 提交于
      Split xhci properties into common and nec specific.
      
      Move the backward compat flags to nec, so the new qemu-xhci
      devices doesn't carry on the compatibiity stuff.
      
      Move the msi/msix switches too and just enable msix for qemu-xhci.
      
      Also move the intrs and slots properties.  Wasn't a great idea to
      make them configurable in the first place, nobody needs this.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1487663432-10410-1-git-send-email-kraxel@redhat.com
      4f72b8d2
    • L
      usb: ohci: fix error return code in servicing td · 6ebc069d
      Li Qiang 提交于
      It should return 1 if an error occurs when reading td.
      This will avoid an infinite loop issue in ohci_service_ed_list.
      Signed-off-by: NLi Qiang <liqiang6-s@360.cn>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-id: 1487760990-115925-1-git-send-email-liqiang6-s@360.cn
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      6ebc069d
    • M
      usb: replace handle_destroy with unrealize · c4fe9700
      Marc-André Lureau 提交于
      Curiously, unrealize() is not being used, but it seems more
      appropriate than handle_destroy() together with realize(). It is more
      ubiquitous destroy name in qemu code base and may throw errors.
      
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-id: 20170221141451.28305-25-marcandre.lureau@redhat.com
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      c4fe9700
    • P
      Merge remote-tracking branch 'remotes/yongbok/tags/mips-20170222' into staging · 10f25e48
      Peter Maydell 提交于
      MIPS patches 2017-02-22
      
      Changes:
      * Add MIPS Boston board support
      
      # gpg: Signature made Wed 22 Feb 2017 00:08:00 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-20170222:
        hw/mips: MIPS Boston board support
        hw: xilinx-pcie: Add support for Xilinx AXI PCIe Controller
        loader: Support Flattened Image Trees (FIT images)
        dtc: Update requirement to v1.4.2
        target-mips: Provide function to test if a CPU supports an ISA
        hw/mips_gic: Update pin state on mask changes
        hw/mips_gictimer: provide API for retrieving frequency
        hw/mips_cmgcr: allow GCR base to be moved
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      10f25e48
  3. 22 2月, 2017 20 次提交