1. 15 11月, 2017 14 次提交
    • E
      iotests: Use new-style NBD connections · 147b44be
      Eric Blake 提交于
      Old-style NBD is deprecated upstream (it is documented, but no
      longer implemented in the reference implementation), and it is
      severely limited (it cannot support structured replies, which
      means it cannot support efficient handling of zeroes), when
      compared to new-style NBD.  We are better off having our iotests
      favor new-style everywhere (although some explicit tests,
      particularly 83, still cover old-style for back-compat reasons);
      this is as simple as supplying the empty string as the default
      export name, as it does not change the URI needed to connect a
      client to the server.  This also gives us more coverage of the
      just-added structured reply code, when not overriding $QEMU_NBD
      to intentionally point to an older server.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-id: 20171109221216.10248-1-eblake@redhat.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      147b44be
    • M
      iotests: Make 136 less flaky · 19026817
      Max Reitz 提交于
      136 executes some AIO requests without a final aio_flush; then it
      advances the virtual clock and thus expects the last access time of the
      device to be less than the current time when queried (i.e. idle_time_ns
      to be greater than 0).  However, without the aio_flush, some requests
      may be settled after the clock_step invocation.  In that case,
      idle_time_ns would be 0 and the test fails.
      
      Fix this by adding an aio_flush if any AIO request other than some other
      aio_flush has been executed.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 20171109203025.27493-6-mreitz@redhat.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      19026817
    • M
      iotests: Make 083 less flaky · ddc7093e
      Max Reitz 提交于
      083 has (at least) two issues:
      
      1. By launching the nbd-fault-injector in background, it may not be
         scheduled until the first grep on its output file is executed.
         However, until then, that file may not have been created yet -- so it
         either does not exist yet (thus making the grep emit an error), or it
         does exist but contains stale data (thus making the rest of the test
         case work connect to a wrong address).
         Fix this by explicitly overwriting the output file before executing
         nbd-fault-injector.
      
      2. The nbd-fault-injector prints things other than "Listening on...".
         It also prints a "Closing connection" message from time to time.  We
         currently invoke sed on the whole file in the hope of it only
         containing the "Listening on..." line yet.  That hope is sometimes
         shattered by the brutal reality of race conditions, so make the sed
         script more robust.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 20171109203025.27493-5-mreitz@redhat.com
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      ddc7093e
    • M
      iotests: Make 055 less flaky · bc11aee2
      Max Reitz 提交于
      First of all, test 055 does a valiant job of invoking pause_drive()
      sometimes, but that is worth nothing without blkdebug.  So the first
      thing to do is to sprinkle a couple of "blkdebug::" in there -- with the
      exception of the transaction tests, because the blkdebug break points
      make the transaction QMP command hang (which is bad).  In that case, we
      can get away with throttling the block job that it effectively is
      paused.
      
      Then, 055 usually does not pause the drive before starting a block job
      that should be cancelled.  This means that the backup job might be
      completed already before block-job-cancel is invoked; thus making the
      test either fail (currently) or moot if cancel_and_wait() ignored this
      condition.  Fix this by pausing the drive before starting the job.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 20171109203025.27493-4-mreitz@redhat.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      bc11aee2
    • M
      iotests: Add missing 'blkdebug::' in 040 · 51c493c5
      Max Reitz 提交于
      040 tries to invoke pause_drive() on a drive that does not use blkdebug.
      Good idea, but let's use blkdebug to make it actually work.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 20171109203025.27493-3-mreitz@redhat.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      51c493c5
    • M
      iotests: Make 030 less flaky · dca9b6a2
      Max Reitz 提交于
      This patch fixes two race conditions in 030:
      
      1. The first is in TestENOSPC.test_enospc().  After resuming the job,
         querying it to confirm it is no longer paused may fail because in the
         meantime it might have completed already.  The same was fixed in
         TestEIO.test_ignore() already (in commit
         2c3b44da).
      
      2. The second is in TestSetSpeed.test_set_speed_invalid(): Here, a
         stream job is started on a drive without any break points, with a
         block-job-set-speed invoked subsequently.  However, without any break
         points, the job might have completed in the meantime (on tmpfs at
         least); or it might complete before cancel_and_wait() which expects
         the job to still exist.  This can be fixed like everywhere else by
         pausing the drive (installing break points) before starting the job
         and letting cancel_and_wait() resume it.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 20171109203025.27493-2-mreitz@redhat.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      dca9b6a2
    • A
      qcow2: Assert that the crypto header does not overlap other metadata · c9b83e9c
      Alberto Garcia 提交于
      The crypto header is initialized only when QEMU is creating a new
      image, so there's no chance of this happening on a corrupted image.
      
      If QEMU is really trying to allocate the header overlapping other
      existing metadata sections then this is a serious bug in QEMU itself
      so let's add an assertion.
      Signed-off-by: NAlberto Garcia <berto@igalia.com>
      Message-id: ae3d77f312fc0c5e0ac2bbd71676c0112eebe2e5.1509718618.git.berto@igalia.com
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      c9b83e9c
    • A
      qcow2: Add iotest for an empty refcount table · ef083f61
      Alberto Garcia 提交于
      This patch adds a simple iotest in which we try to write to an image
      with an empty refcount table (i.e. with all entries set to 0).
      
      This scenario was already handled by the existing consistency checks,
      but we add an explicit test case for completeness.
      Signed-off-by: NAlberto Garcia <berto@igalia.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 7e48b0e2ae1a0a18e0ee303b3045f130feec0474.1509718618.git.berto@igalia.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      ef083f61
    • A
      qcow2: Add iotest for an image with header.refcount_table_offset == 0 · 5a45da5e
      Alberto Garcia 提交于
      This patch adds a simple iotest in which we try to write to an image
      with the refcount table offset set to 0.
      
      This scenario was already handled by the existing consistency checks,
      but we add an explicit test case for completeness.
      Signed-off-by: NAlberto Garcia <berto@igalia.com>
      Message-id: feeceada92486bb8790b90f303fc9fe82a27391a.1509718618.git.berto@igalia.com
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      5a45da5e
    • A
      qcow2: Don't open images with header.refcount_table_clusters == 0 · 951053a9
      Alberto Garcia 提交于
      qcow2_do_open() is checking that header.refcount_table_clusters is not
      too large, but it doesn't check that it's greater than zero. Apart
      from the fact that an image like that is obviously corrupted, trying
      to use it crashes QEMU since we end up with a null s->refcount_table
      after qcow2_refcount_init().
      
      These images can however be repaired, so allow opening them if the
      BDRV_O_CHECK flag is set.
      Signed-off-by: NAlberto Garcia <berto@igalia.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Message-id: f9750f50c80359babba11062e88f5075a47e8e16.1509718618.git.berto@igalia.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      951053a9
    • A
      qcow2: Prevent allocating compressed clusters at offset 0 · 8aa34834
      Alberto Garcia 提交于
      If the refcount data is corrupted then we can end up trying to
      allocate a new compressed cluster at offset 0 in the image, triggering
      an assertion in qcow2_alloc_bytes() that would crash QEMU:
      
        qcow2_alloc_bytes: Assertion `offset' failed.
      
      This patch adds an explicit check for this scenario and a new test
      case.
      Signed-off-by: NAlberto Garcia <berto@igalia.com>
      Message-id: fb53467cf48e95ff3330def1cf1003a5b862b7d9.1509718618.git.berto@igalia.com
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      8aa34834
    • A
      qcow2: Prevent allocating L2 tables at offset 0 · 98839750
      Alberto Garcia 提交于
      If the refcount data is corrupted then we can end up trying to
      allocate a new L2 table at offset 0 in the image, triggering an
      assertion in the qcow2 cache that would crash QEMU:
      
        qcow2_cache_entry_mark_dirty: Assertion `c->entries[i].offset != 0' failed
      
      This patch adds an explicit check for this scenario and a new test
      case.
      Signed-off-by: NAlberto Garcia <berto@igalia.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 92dac37191ae7844a2da22c122204eb493cc3133.1509718618.git.berto@igalia.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      98839750
    • A
      qcow2: Prevent allocating refcount blocks at offset 0 · 6bf45d59
      Alberto Garcia 提交于
      Each entry in the qcow2 cache contains an offset field indicating the
      location of the data in the qcow2 image. If the offset is 0 then it
      means that the entry contains no data and is available to be used when
      needed.
      
      Because of that it is not possible to store in the cache the first
      cluster of the qcow2 image (offset = 0). This is not a problem because
      that cluster always contains the qcow2 header and we're not using this
      cache for that.
      
      However, if the qcow2 image is corrupted it can happen that we try to
      allocate a new refcount block at offset 0, triggering this assertion
      and crashing QEMU:
      
        qcow2_cache_entry_mark_dirty: Assertion `c->entries[i].offset != 0' failed
      
      This patch adds an explicit check for this scenario and a new test
      case.
      
      This problem was originally reported here:
      
         https://bugs.launchpad.net/qemu/+bug/1728615Reported-by: NR.Nageswara Sastry <nasastry@in.ibm.com>
      Signed-off-by: NAlberto Garcia <berto@igalia.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 92a2fadd10d58b423f269c1d1a309af161cdc73f.1509718618.git.berto@igalia.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      6bf45d59
    • P
      Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging · 191b5fbf
      Peter Maydell 提交于
      Pull request
      
      The following disk I/O throttling fixes solve recent bugs.
      
      # gpg: Signature made Tue 14 Nov 2017 10:37:12 GMT
      # gpg:                using RSA key 0x9CA4ABB381AB73C8
      # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
      # gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>"
      # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8
      
      * remotes/stefanha/tags/block-pull-request:
        qemu-iotests: Test I/O limits with removable media
        block: Leave valid throttle timers when removing a BDS from a backend
        block: Check for inserted BlockDriverState in blk_io_limits_disable()
        throttle-groups: drain before detaching ThrottleState
        block: all I/O should be completed before removing throttle timers.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      191b5fbf
  2. 14 11月, 2017 7 次提交
    • P
      Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.11-20171114' into staging · 0dc8874a
      Peter Maydell 提交于
      ppc patch queue for 2017-11-14
      
      Another couple of fixes for qemu-2.11.
      
      # gpg: Signature made Tue 14 Nov 2017 04:36:20 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.11-20171114:
        xics/kvm: synchonize state before 'info pic'
        target/ppc: correct htab shift for hash on radix
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      0dc8874a
    • P
      Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging · 98956063
      Peter Maydell 提交于
      # gpg: Signature made Tue 14 Nov 2017 02:05:34 GMT
      # gpg:                using RSA key 0xEF04965B398D6211
      # gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.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: 215D 46F4 8246 689E C77F  3562 EF04 965B 398D 6211
      
      * remotes/jasowang/tags/net-pull-request:
        net/socket: fix coverity issue
        Add new PCI ID for i82559a
        Fix eepro100 simple transmission mode
        colo: Consolidate the duplicate code chunk into a routine
        colo-compare: Fix comments
        colo-compare: compare the packet in a specified Connection
        colo-compare: Insert packet into the suitable position of packet queue directly
        net: fix check for number of parameters to -netdev socket
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      98956063
    • P
      Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20171113' into staging · 55ed8d60
      Peter Maydell 提交于
      target-arm queue:
       * translate-a64.c: silence gcc5 warning
       * highbank: validate register offset before access
       * MAINTAINERS: Add entries for Smartfusion2
       * accel/tcg/translate-all: expand cpu_restore_state addr check
         (so usermode insn aborts don't crash with an assertion failure)
       * fix TCG initialization of some Arm boards by allowing them
         to specify min/default number of CPUs to create
      
      # gpg: Signature made Mon 13 Nov 2017 14:11:09 GMT
      # gpg:                using RSA key 0x3C2525ED14360CDE
      # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>"
      # gpg:                 aka "Peter Maydell <pmaydell@gmail.com>"
      # gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>"
      # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE
      
      * remotes/pmaydell/tags/pull-target-arm-20171113:
        accel/tcg/translate-all: expand cpu_restore_state addr check
        hw: add .min_cpus and .default_cpus fields to machine_class
        xlnx-zcu102: Specify the max number of CPUs for the EP108
        xlnx-zcu102: Add an info message deprecating the EP108
        xlnx-zynqmp: Properly support the smp command line option
        qom: move CPUClass.tcg_initialize to a global
        MAINTAINERS: Add entries for Smartfusion2
        highbank: validate register offset before access
        arm/translate-a64: mark path as unreachable to eliminate warning
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      55ed8d60
    • P
      Merge remote-tracking branch 'remotes/kraxel/tags/ui-20171110-pull-request' into staging · 2e550e31
      Peter Maydell 提交于
      ui: fixes for 2.11
      
      # gpg: Signature made Fri 10 Nov 2017 14:02:23 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/ui-20171110-pull-request:
        ui: use QEMU_IS_ALIGNED macro
        ui: fix dcl unregister
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      2e550e31
    • G
      xics/kvm: synchonize state before 'info pic' · dcb556fc
      Greg Kurz 提交于
      When using the emulated XICS, the 'info pic' monitor command shows:
      
      CPU 0 XIRR=ff000000 ((nil)) PP=ff MFRR=ff
      ICS 1000..13ff 0x10040060340
        1000 MSI 05 00
        1001 MSI 05 00
        1002 MSI 05 00
        1003 MSI ff 00
        1004 LSI ff 00
        1005 LSI ff 00
        1006 LSI ff 00
        1007 LSI ff 00
        1008 MSI 05 00
        1009 MSI 05 00
        100a MSI 05 00
        100b MSI 05 00
        100c MSI 05 00
      
      but when using the in-kernel XICS with the very same guest, we get:
      
      CPU 0 XIRR=00000000 ((nil)) PP=ff MFRR=ff
      ICS 1000..13ff 0x10032e00340
        1000 MSI ff 00
        1001 MSI ff 00
        1002 MSI ff 00
        1003 MSI ff 00
        1004 LSI ff 00
        1005 LSI ff 00
        1006 LSI ff 00
        1007 LSI ff 00
        1008 MSI ff 00
        1009 MSI ff 00
        100a MSI ff 00
        100b MSI ff 00
        100c MSI ff 00
      
      ie, all irqs are masked and XIRR is null, while we should get the
      same output as with the emulated XICS.
      
      If the guest is then migrated, 'info pic' shows the expected values
      on both source and destination.
      
      The problem is that QEMU doesn't synchronize with KVM before printing
      the XICS state. Migration happens to fix the output because it enforces
      synchronization with KVM.
      
      To fix the invalid output of 'info pic', this patch introduces a new
      synchronize_state operation for both ICPStateClass and ICSStateClass.
      The ICP operation relies on run_on_cpu() in order to kick the vCPU
      and avoid sleeping on KVM_GET_ONE_REG.
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      dcb556fc
    • S
      target/ppc: correct htab shift for hash on radix · e05fba50
      Sam Bobroff 提交于
      KVM HV will soon support running a guest in hash mode on a POWER9 host
      running in radix mode (see [1]), however the guest currently fails to
      boot.
      
      This is because the "htab_shift" value (the size of the MMU's hash
      table) is added to the device tree before KVM has had a chance to
      change it. If the host is in hash mode, KVM does not need to change it
      and so the problem is not seen, but when the host is in radix mode a
      change is required and we see a problem.
      
      To fix this, move the call spapr_setup_hpt_and_vrma() (where
      htab_shift could be changed) up a little so that it's called before
      spapr_h_cas_compose_response() (where htab_shift is added to the
      device tree).
      Signed-off-by: NSam Bobroff <sam.bobroff@au1.ibm.com>
      
      [1] See http://www.spinics.net/lists/kvm-ppc/msg13057.htmlSigned-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      e05fba50
    • P
      Merge remote-tracking branch 'remotes/famz/tags/docker-pull-request' into staging · 02e5844d
      Peter Maydell 提交于
      # gpg: Signature made Fri 10 Nov 2017 13:41:01 GMT
      # gpg:                using RSA key 0xCA35624C6A9171C6
      # gpg: Good signature from "Fam Zheng <famz@redhat.com>"
      # Primary key fingerprint: 5003 7CB7 9706 0F76 F021  AD56 CA35 624C 6A91 71C6
      
      * remotes/famz/tags/docker-pull-request:
        docker: correctly escape $BACKEND in the help output
        docker: Improved image checksum
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      02e5844d
  3. 13 11月, 2017 19 次提交