1. 23 9月, 2016 1 次提交
    • F
      util: Add UUID API · cea25275
      Fam Zheng 提交于
      A number of different places across the code base use CONFIG_UUID. Some
      of them are soft dependency, some are not built if libuuid is not
      available, some come with dummy fallback, some throws runtime error.
      
      It is hard to maintain, and hard to reason for users.
      
      Since UUID is a simple standard with only a small number of operations,
      it is cleaner to have a central support in libqemuutil. This patch adds
      qemu_uuid_* functions that all uuid users in the code base can
      rely on. Except for qemu_uuid_generate which is new code, all other
      functions are just copy from existing fallbacks from other files.
      
      Note that qemu_uuid_parse is moved without updating the function
      signature to use QemuUUID, to keep this patch simple.
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Message-Id: <1474432046-325-2-git-send-email-famz@redhat.com>
      cea25275
  2. 15 9月, 2016 1 次提交
  3. 14 9月, 2016 2 次提交
  4. 13 9月, 2016 1 次提交
    • F
      iothread: Stop threads before main() quits · dce8921b
      Fam Zheng 提交于
      Right after main_loop ends, we release various things but keep iothread
      alive. The latter is not prepared to the sudden change of resources.
      
      Specifically, after bdrv_close_all(), virtio-scsi dataplane get a
      surprise at the empty BlockBackend:
      
      (gdb) bt
          at /usr/src/debug/qemu-2.6.0/hw/scsi/virtio-scsi.c:543
          at /usr/src/debug/qemu-2.6.0/hw/scsi/virtio-scsi.c:577
      
      It is because the d->conf.blk->root is set to NULL, then
      blk_get_aio_context() returns qemu_aio_context, whereas s->ctx is still
      pointing to the iothread:
      
          hw/scsi/virtio-scsi.c:543:
      
          if (s->dataplane_started) {
              assert(blk_get_aio_context(d->conf.blk) == s->ctx);
          }
      
      To fix this, let's stop iothreads before doing bdrv_close_all().
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 1473326931-9699-1-git-send-email-famz@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      dce8921b
  5. 06 9月, 2016 5 次提交
  6. 29 7月, 2016 1 次提交
  7. 22 7月, 2016 3 次提交
  8. 20 7月, 2016 1 次提交
  9. 13 7月, 2016 2 次提交
    • X
      hostmem: detect host backend memory is being used properly · 2aece63c
      Xiao Guangrong 提交于
      Currently, we use memory_region_is_mapped() to detect if the host
      backend memory is being used. This works if the memory is directly
      mapped into guest's address space, however, it is not true for
      nvdimm as it uses aliased memory region to map the memory. This is
      why this bug can happen:
         https://bugzilla.redhat.com/show_bug.cgi?id=1352769
      
      Fix it by introduce a new filed, is_mapped, to HostMemoryBackend,
      we set/clear this filed accordingly when the device link/unlink to
      host backend memory
      Signed-off-by: NXiao Guangrong <guangrong.xiao@linux.intel.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      2aece63c
    • M
      char: do not use atexit cleanup handler · aa5cb7f5
      Marc-André Lureau 提交于
      It turns out qemu is calling exit() in various places from various
      threads without taking much care of resources state. The atexit()
      cleanup handlers cannot easily destroy resources that are in use (by
      the same thread or other).
      
      Since c1111a24, TCG arm guests run into the following abort() when
      running tests, the chardev mutex is locked during the write, so
      qemu_mutex_destroy() returns an error:
      
       #0  0x00007fffdbb806f5 in raise () at /lib64/libc.so.6
       #1  0x00007fffdbb822fa in abort () at /lib64/libc.so.6
       #2  0x00005555557616fe in error_exit (err=<optimized out>, msg=msg@entry=0x555555c38c30 <__func__.14622> "qemu_mutex_destroy")
           at /home/drjones/code/qemu/util/qemu-thread-posix.c:39
       #3  0x0000555555b0be20 in qemu_mutex_destroy (mutex=mutex@entry=0x5555566aa0e0) at /home/drjones/code/qemu/util/qemu-thread-posix.c:57
       #4  0x00005555558aab00 in qemu_chr_free_common (chr=0x5555566aa0e0) at /home/drjones/code/qemu/qemu-char.c:4029
       #5  0x00005555558b05f9 in qemu_chr_delete (chr=<optimized out>) at /home/drjones/code/qemu/qemu-char.c:4038
       #6  0x00005555558b05f9 in qemu_chr_delete (chr=<optimized out>) at /home/drjones/code/qemu/qemu-char.c:4044
       #7  0x00005555558b062c in qemu_chr_cleanup () at /home/drjones/code/qemu/qemu-char.c:4557
       #8  0x00007fffdbb851e8 in __run_exit_handlers () at /lib64/libc.so.6
       #9  0x00007fffdbb85235 in  () at /lib64/libc.so.6
       #10 0x00005555558d1b39 in testdev_write (testdev=0x5555566aa0a0) at /home/drjones/code/qemu/backends/testdev.c:71
       #11 0x00005555558d1b39 in testdev_write (chr=<optimized out>, buf=0x7fffc343fd9a "", len=0) at /home/drjones/code/qemu/backends/testdev.c:95
       #12 0x00005555558adced in qemu_chr_fe_write (s=0x5555566aa0e0, buf=buf@entry=0x7fffc343fd98 "0q", len=len@entry=2) at /home/drjones/code/qemu/qemu-char.c:282
      
      Instead of using a atexit() handler, only run the chardev cleanup as
      initially proposed at the end of main(), where there are less chances
      (hic) of conflicts or other races.
      Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Reported-by: NAndrew Jones <drjones@redhat.com>
      Message-Id: <20160704153823.16879-1-marcandre.lureau@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      aa5cb7f5
  10. 12 7月, 2016 3 次提交
  11. 05 7月, 2016 2 次提交
  12. 04 7月, 2016 1 次提交
  13. 29 6月, 2016 1 次提交
  14. 17 6月, 2016 2 次提交
  15. 13 6月, 2016 1 次提交
  16. 07 6月, 2016 2 次提交
  17. 06 6月, 2016 1 次提交
  18. 30 5月, 2016 1 次提交
  19. 27 5月, 2016 1 次提交
    • G
      PPC/KVM: early validation of vcpu id · 41264b38
      Greg Kurz 提交于
      The KVM API restricts vcpu ids to be < KVM_CAP_MAX_VCPUS. On PowerPC
      targets, depending on the number of threads per core in the host and
      in the guest, some topologies do generate higher vcpu ids actually.
      When this happens, QEMU bails out with the following error:
      
      kvm_init_vcpu failed: Invalid argument
      
      The KVM_CREATE_VCPU ioctl has several EINVAL return paths, so it is
      not possible to fully disambiguate.
      
      This patch adds a check in the code that computes vcpu ids, so that
      we can detect the error earlier, and print a friendlier message instead
      of calling KVM_CREATE_VCPU with an obviously bogus vcpu id.
      Signed-off-by: NGreg Kurz <gkurz@linux.vnet.ibm.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      41264b38
  20. 26 5月, 2016 7 次提交
  21. 24 5月, 2016 1 次提交