1. 31 8月, 2017 18 次提交
  2. 25 8月, 2017 1 次提交
  3. 24 8月, 2017 2 次提交
    • P
      Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2017-08-23' into staging · 1eed3399
      Peter Maydell 提交于
      nbd patches for 2017-08-23
      
      - Fam Zheng: 0/4 block: Fix non-shared storage migration
      - Stefan Hajnoczi: qemu-iotests: add 194 non-shared storage migration test
      - Stefan Hajnoczi: nbd-client: avoid spurious qio_channel_yield() re-entry
      
      # gpg: Signature made Wed 23 Aug 2017 17:22:53 BST
      # gpg:                using RSA key 0xA7A16B4A2527436A
      # gpg: Good signature from "Eric Blake <eblake@redhat.com>"
      # gpg:                 aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>"
      # gpg:                 aka "[jpeg image of size 6874]"
      # Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A
      
      * remotes/ericb/tags/pull-nbd-2017-08-23:
        nbd-client: avoid spurious qio_channel_yield() re-entry
        qemu-iotests: add 194 non-shared storage migration test
        block: Update open_flags after ->inactivate() callback
        mirror: Mark target BB as "force allow inactivate"
        block-backend: Allow more "can inactivate" cases
        block-backend: Refactor inactivate check
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      1eed3399
    • S
      nbd-client: avoid spurious qio_channel_yield() re-entry · 40f4a218
      Stefan Hajnoczi 提交于
      The following scenario leads to an assertion failure in
      qio_channel_yield():
      
      1. Request coroutine calls qio_channel_yield() successfully when sending
         would block on the socket.  It is now yielded.
      2. nbd_read_reply_entry() calls nbd_recv_coroutines_enter_all() because
         nbd_receive_reply() failed.
      3. Request coroutine is entered and returns from qio_channel_yield().
         Note that the socket fd handler has not fired yet so
         ioc->write_coroutine is still set.
      4. Request coroutine attempts to send the request body with nbd_rwv()
         but the socket would still block.  qio_channel_yield() is called
         again and assert(!ioc->write_coroutine) is hit.
      
      The problem is that nbd_read_reply_entry() does not distinguish between
      request coroutines that are waiting to receive a reply and those that
      are not.
      
      This patch adds a per-request bool receiving flag so
      nbd_read_reply_entry() can avoid spurious aio_wake() calls.
      Reported-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-Id: <20170822125113.5025-1-stefanha@redhat.com>
      Reviewed-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Tested-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      40f4a218
  4. 23 8月, 2017 8 次提交
  5. 22 8月, 2017 7 次提交
    • T
      hw/ppc/spapr_iommu: Fix crash when removing the "spapr-tce-table" device · 1f98e553
      Thomas Huth 提交于
      QEMU currently aborts unexpectedly when the user tries to add and
      remove a "spapr-tce-table" device:
      
      $ qemu-system-ppc64 -nographic -S -nodefaults -monitor stdio
      QEMU 2.9.92 monitor - type 'help' for more information
      (qemu) device_add spapr-tce-table,id=x
      (qemu) device_del x
      **
      ERROR:qemu/qdev-monitor.c:872:qdev_unplug: assertion failed: (hotplug_ctrl)
      Aborted (core dumped)
      
      The device should not be accessable for the users at all, it's just
      used internally, so mark it with user_creatable = false.
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      1f98e553
    • T
      hw/ppc/spapr_rtc: Mark the RTC device with user_creatable = false · 8ccccff9
      Thomas Huth 提交于
      QEMU currently aborts unexpectedly when a user tries to do something
      like this:
      
      $ qemu-system-ppc64 -nographic -S -nodefaults -monitor stdio
      QEMU 2.9.92 monitor - type 'help' for more information
      (qemu) device_add spapr-rtc,id=spapr-rtc
      (qemu) device_del spapr-rtc
      **
      ERROR:qemu/qdev-monitor.c:872:qdev_unplug: assertion failed: (hotplug_ctrl)
      Aborted (core dumped)
      
      The RTC device is not meant to be hot-pluggable - it's an internal
      device only and it even should not be possible to create it a
      second time with the "-device" parameter, so let's mark this
      with "user_creatable = false".
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      8ccccff9
    • T
      hw/ppc/spapr: Fix segfault when instantiating a 'pc-dimm' without 'memdev' · 04790978
      Thomas Huth 提交于
      QEMU currently crashes when trying to use a 'pc-dimm' on the pseries
      machine without specifying its 'memdev' property. This happens because
      pc_dimm_get_memory_region() does not check whether the 'memdev' property
      has properly been set by the user. Looking closer at this function, it's
      also obvious that it is using &error_abort to call another function - and
      this is bad in a function that is used in the hot-plugging calling chain
      since this can also cause QEMU to exit unexpectedly.
      
      So let's fix these issues in a proper way now: Add a "Error **errp"
      parameter to pc_dimm_get_memory_region() which we use in case the 'memdev'
      property has not been set by the user, and which we can use instead of
      the &error_abort, and change the callers of get_memory_region() to make
      use of this "errp" parameter for proper error checking.
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Reviewed-by: NIgor Mammedov <imammedo@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      04790978
    • B
      spapr: Allow configure-connector to be called multiple times · 188bfe1b
      Bharata B Rao 提交于
      In case of in-kernel memory hot unplug, when the guest is not able
      to remove all the LMBs that are requested for removal, it will add back
      any LMBs that have been successfully removed. The DR Connectors of
      these LMBs wouldn't have been unconfigured and hence the addition of
      these LMBs will result in configure-connector call being issued on
      LMB DR connectors that are already in configured state. Such
      configure-connector calls will fail resulting in a DIMM which is
      partially unplugged.
      
      This however worked till recently before we overhauled the DRC
      implementation in QEMU. Commit 9d4c0f4f: "spapr: Consolidate
      DRC state variables" is the first commit where this problem shows up
      as per git bisect.
      
      Ideally guest shouldn't be issuing configure-connector call on an
      already configured DR connector. However for now, work around this in
      QEMU by allowing configure-connector to be called multiple times for
      all types of DR connectors.
      Signed-off-by: NBharata B Rao <bharata@linux.vnet.ibm.com>
      [dwg: Corrected buglet that would have initialized fdt pointers ready
       for reading on a device not present at reset]
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      188bfe1b
    • G
      ppc: fix ppc_set_compat() with KVM PR · 5dfaa532
      Greg Kurz 提交于
      When running in KVM PR mode, kvmppc_set_compat() always fail because the
      current PR implementation doesn't handle KVM_REG_PPC_ARCH_COMPAT. Now that
      the machine code inconditionally calls ppc_set_compat_all() at reset time
      to restore the compat mode default value (commit 66d5c492), it is
      impossible to start a guest with PR:
      
      qemu-system-ppc64: Unable to set CPU compatibility mode in KVM:
       Invalid argument
      
      A tentative patch [1] was recently sent by Suraj to address the issue, but
      it would prevent the compat mode to be turned off on reset. And we really
      don't want to explicitely check for KVM PR. During the patch's review,
      David suggested that we should only call the KVM ioctl() if the compat
      PVR changes. This allows at least to run with KVM PR, provided no compat
      mode is requested from the command line (which should be the case when
      running PR nested). This is what this patch does.
      
      While here, we also fix the side effect where KVM would fail but we would
      change the CPU state in QEMU anyway.
      
      [1] http://patchwork.ozlabs.org/patch/782039/Signed-off-by: NGreg Kurz <groug@kaod.org>
      Reviewed-by: NSuraj Jitindar Singh <sjitindarsingh@gmail.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      5dfaa532
    • D
      target/ppc: 'PVR != host PVR' in KVM_SET_SREGS workaround · c363a37a
      Daniel Henrique Barboza 提交于
      Commit d5fc133e ("ppc: Rework CPU compatibility testing
      across migration") changed the way cpu_post_load behaves with
      the PVR setting, causing an unexpected bug in KVM-HV migrations
      between hosts that are compatible (POWER8 and POWER8E, for example).
      Even with pvr_match() returning true, the guest freezes right after
      cpu_post_load. The reason is that the guest kernel can't handle a
      different PVR value other that the running host in KVM_SET_SREGS.
      
      In [1] it was discussed the possibility of a new KVM capability
      that would indicate that the guest kernel can handle a different
      PVR in KVM_SET_SREGS. Even if such feature is implemented, there is
      still the problem with older kernels that will not have this capability
      and will fail to migrate.
      
      This patch implements a workaround for that scenario. If running
      with KVM, check if the guest kernel does not have the capability
      (named here as 'cap_ppc_pvr_compat'). If it doesn't, calls
      kvmppc_is_pr() to see if the guest is running in KVM-HV. If all this
      happens, set env->spr[SPR_PVR] to the same value as the current
      host PVR. This ensures that we allow migrations with 'close enough'
      PVRs to still work in KVM-HV but also makes the code ready for
      this new KVM capability when it is done.
      
      A new function called 'kvmppc_pvr_workaround_required' was created
      to encapsulate the conditions said above and to avoid calling too
      many kvm.c internals inside cpu_post_load.
      
      [1] https://lists.gnu.org/archive/html/qemu-ppc/2017-06/msg00503.htmlSigned-off-by: NDaniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
      [dwg: Fix for the case of using TCG on a PPC host]
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      c363a37a
    • C
      boot-serial-test: prefer tcg accelerator · b96919d7
      Cornelia Huck 提交于
      Prefer to use the tcg accelarator if it is available: This is our only
      real smoke test for tcg, and fast enough to use it for that.
      
      Fixes: 480bc11e ("boot-serial-test: fallback to kvm accelerator")
      Reported-by: NRichard Henderson <richard.henderson@linaro.org>
      Signed-off-by: NCornelia Huck <cohuck@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      b96919d7
  6. 16 8月, 2017 4 次提交