1. 12 5月, 2016 16 次提交
  2. 28 4月, 2016 1 次提交
    • M
      qom: -object error messages lost location, restore it · 51b9b478
      Markus Armbruster 提交于
      qemu_opts_foreach() runs its callback with the error location set to
      the option's location.  Any errors the callback reports use the
      option's location automatically.
      
      Commit 90998d58 moved the actual error reporting from "inside"
      qemu_opts_foreach() to after it.  Here's a typical hunk:
      
      	 if (qemu_opts_foreach(qemu_find_opts("object"),
          -                          object_create,
          -                          object_create_initial, NULL)) {
          +                          user_creatable_add_opts_foreach,
          +                          object_create_initial, &err)) {
          +        error_report_err(err);
      	     exit(1);
      	 }
      
      Before, object_create() reports from within qemu_opts_foreach(), using
      the option's location.  Afterwards, we do it after
      qemu_opts_foreach(), using whatever location happens to be current
      there.  Commonly a "none" location.
      
      This is because Error objects don't have location information.
      Problematic.
      
      Reproducer:
      
          $ qemu-system-x86_64 -nodefaults -display none -object secret,id=foo,foo=bar
          qemu-system-x86_64: Property '.foo' not found
      
      Note no location.  This commit restores it:
      
          qemu-system-x86_64: -object secret,id=foo,foo=bar: Property '.foo' not found
      
      Note that the qemu_opts_foreach() bug just fixed could mask the bug
      here: if the location it leaves dangling hasn't been clobbered, yet,
      it's the correct one.
      Reported-by: NEric Blake <eblake@redhat.com>
      Cc: Daniel P. Berrange <berrange@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1461767349-15329-4-git-send-email-armbru@redhat.com>
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      [Paragraph on Error added to commit message]
      51b9b478
  3. 22 4月, 2016 2 次提交
  4. 13 4月, 2016 3 次提交
  5. 11 4月, 2016 2 次提交
    • F
      block: Fix bdrv_drain in coroutine · a77fd4bb
      Fam Zheng 提交于
      Using the nested aio_poll() in coroutine is a bad idea. This patch
      replaces the aio_poll loop in bdrv_drain with a BH, if called in
      coroutine.
      
      For example, the bdrv_drain() in mirror.c can hang when a guest issued
      request is pending on it in qemu_co_mutex_lock().
      
      Mirror coroutine in this case has just finished a request, and the block
      job is about to complete. It calls bdrv_drain() which waits for the
      other coroutine to complete. The other coroutine is a scsi-disk request.
      The deadlock happens when the latter is in turn pending on the former to
      yield/terminate, in qemu_co_mutex_lock(). The state flow is as below
      (assuming a qcow2 image):
      
        mirror coroutine               scsi-disk coroutine
        -------------------------------------------------------------
        do last write
      
          qcow2:qemu_co_mutex_lock()
          ...
                                       scsi disk read
      
                                         tracked request begin
      
                                         qcow2:qemu_co_mutex_lock.enter
      
          qcow2:qemu_co_mutex_unlock()
      
        bdrv_drain
          while (has tracked request)
            aio_poll()
      
      In the scsi-disk coroutine, the qemu_co_mutex_lock() will never return
      because the mirror coroutine is blocked in the aio_poll(blocking=true).
      
      With this patch, the added qemu_coroutine_yield() allows the scsi-disk
      coroutine to make progress as expected:
      
        mirror coroutine               scsi-disk coroutine
        -------------------------------------------------------------
        do last write
      
          qcow2:qemu_co_mutex_lock()
          ...
                                       scsi disk read
      
                                         tracked request begin
      
                                         qcow2:qemu_co_mutex_lock.enter
      
          qcow2:qemu_co_mutex_unlock()
      
        bdrv_drain.enter
      >   schedule BH
      >   qemu_coroutine_yield()
      >                                  qcow2:qemu_co_mutex_lock.return
      >                                  ...
                                         tracked request end
          ...
          (resumed from BH callback)
        bdrv_drain.return
        ...
      Reported-by: NLaurent Vivier <lvivier@redhat.com>
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Message-id: 1459855253-5378-2-git-send-email-famz@redhat.com
      Suggested-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      a77fd4bb
    • G
      ui/virtio-gpu: add and use qemu_create_displaysurface_pixman · ca58b45f
      Gerd Hoffmann 提交于
      Add a the new qemu_create_displaysurface_pixman function, to create
      a DisplaySurface backed by an existing pixman image.  In that case
      there is no need to create a new pixman image pointing to the same
      backing storage.  We can just use the existing image directly.
      
      This does not only simplify things a bit, but most importantly it
      gets the reference counting right, so the backing storage for the
      pixman image wouldn't be released underneath us.
      
      Use new function in virtio-gpu, where using it actually fixes
      use-after-free crashes.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1459499240-742-1-git-send-email-kraxel@redhat.com
      ca58b45f
  6. 08 4月, 2016 9 次提交
  7. 05 4月, 2016 4 次提交
    • A
      include/qemu/atomic: add compile time asserts · ca47a926
      Alex Bennée 提交于
      To be safely portable no atomic access should be trying to do more than
      the natural word width of the host. The most common abuse is trying to
      atomically access 64 bit values on a 32 bit host.
      
      This patch adds some QEMU_BUILD_BUG_ON to the __atomic instrinsic paths
      to create a build failure if (sizeof(*ptr) > sizeof(void *)).
      Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
      Message-Id: <1459780549-12942-3-git-send-email-alex.bennee@linaro.org>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      ca47a926
    • P
      update Linux headers to 4.6 · b89485a5
      Paolo Bonzini 提交于
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      b89485a5
    • M
      spapr_drc: enable immediate detach for unsignalled devices · f40eb921
      Michael Roth 提交于
      Currently spapr doesn't support "aborting" hotplug of PCI
      devices by allowing device_del to immediately remove the
      device if we haven't signalled the presence of the device
      to the guest.
      
      In the past this wasn't an issue, since we always immediately
      signalled device attach and simply relied on full guest-aware
      add->remove path for device removal. However, as of 788d2599,
      we now defer signalling for PCI functions until function 0
      is attached, so now we need to deal with these "abort" operations
      for cases where a user hotplugs a non-0 function, then opts to
      remove it prior hotplugging function 0. Currently they'd have to
      reboot before the unplug completed. PCIe multifunction hotplug
      does not have this requirement however, so from a management
      implementation perspective it would be good to address this within
      the same release as 788d2599.
      
      We accomplish this by simply adding a 'signalled' flag to track
      whether a device hotplug event has been sent to the guest. If it
      hasn't, we allow immediate removal under the assumption that the
      guest will not be using the device. Devices present at boot/reset
      time are also assumed to be 'signalled'.
      
      For CPU/memory/etc, signalling will still happen immediately
      as part of device_add, so only PCI functions should be affected.
      
      Cc: bharata@linux.vnet.ibm.com
      Cc: david@gibson.dropbear.id.au
      Cc: sbhat@linux.vnet.ibm.com
      Cc: qemu-ppc@nongnu.org
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      [dwg: This fixes a regression where an incorrect hot-add of a non-zero
            function can no longer be backed out until function 0 is added]
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      f40eb921
    • C
      ppc: Rework POWER7 & POWER8 exception model · 5c94b2a5
      Cédric Le Goater 提交于
      From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      
      This patch fixes the current AIL implementation for POWER8. The
      interrupt vector address can be calculated directly from LPCR when the
      exception is handled. The excp_prefix update becomes useless and we
      can cleanup the H_SET_MODE hcall.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      [clg: Removed LPES0/1 handling for HV vs. !HV
            Fixed LPCR_ILE case for POWERPC_EXCP_POWER8 ]
      Signed-off-by: NCédric Le Goater <clg@fr.ibm.com>
      [dwg: This was written as a cleanup, but it also fixes a real bug
            where setting an alternative interrupt location would not be
            correctly migrated]
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      5c94b2a5
  8. 31 3月, 2016 2 次提交
  9. 30 3月, 2016 1 次提交