1. 26 5月, 2015 2 次提交
    • J
      qemu: Add libvirt version check to refresh capabilities algorithm · a14eff38
      John Ferlan 提交于
      Rather than an algorithm based solely on libvirtd ctime to refresh the
      capabilities add the element of the libvirt build version into the equation.
      Since that version wouldn't be there prior to this code being run - don't
      fail on reading the capabilities if not found. In this case, the cache
      will always be rebuilt when a new libvirt version is installed.
      a14eff38
    • J
      qemu: Force capabilities cache refresh if libvirtd date is different · 0b4211f9
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1195882
      
      Original commit id 'cbde3589' indicates that the cache file would be
      discarded if either the QEMU binary or libvirtd 'ctime' changes; however,
      the code only discarded if the QEMU binary time didn't match or if the
      new libvirtd ctime was later than what created the cache file.
      
      Since many factors come into play with 'ctime' adjustments (including
      perhaps turning back the hands of time), change the logic to also force
      a refresh if the ctime of libvirt is different than what's in the cache.
      0b4211f9
  2. 21 5月, 2015 1 次提交
  3. 18 5月, 2015 1 次提交
  4. 06 5月, 2015 1 次提交
    • J
      qemu: Resolve Coverity FORWARD_NULL · 3e4ce359
      John Ferlan 提交于
      Coverity complains over the [n]values pairing in virQEMUCapsFreeStringList
      and rather than make a bunch if "if values" checks prior to calling, by
      just adding the values check inside the free function we avoid the chance
      that somehow nvalues is > 0, while values == NULL
      3e4ce359
  5. 04 5月, 2015 2 次提交
  6. 24 4月, 2015 1 次提交
  7. 21 4月, 2015 4 次提交
  8. 13 4月, 2015 1 次提交
  9. 23 3月, 2015 1 次提交
  10. 13 3月, 2015 1 次提交
    • J
      Introduce virBitmapIsBitSet · 22fd3ac3
      Ján Tomko 提交于
      A helper that never returns an error and treats bits out of bitmap range
      as false.
      
      Use it everywhere we use ignore_value on virBitmapGetBit, or loop over
      the bitmap size.
      22fd3ac3
  11. 11 3月, 2015 1 次提交
    • M
      virQEMUCapsInitQMP: Don't dispose locked @vm · 954427c3
      Michal Privoznik 提交于
      When creating qemu capabilities, a dummy virDomainObj is created just
      because our monitor code expects that. However, the object is created
      locked already. Then, under cleanup label, we simply unref the object
      which results in whole domain object to be disposed. The object lock
      is destroyed subsequently, but hey - it's still locked:
      
      ==24845== Thread #14's call to pthread_mutex_destroy failed
      ==24845==    with error code 16 (EBUSY: Device or resource busy)
      ==24845==    at 0x4C3024E: pthread_mutex_destroy (in /usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so)
      ==24845==    by 0x531F72E: virMutexDestroy (virthread.c:83)
      ==24845==    by 0x5302977: virObjectLockableDispose (virobject.c:237)
      ==24845==    by 0x5302A89: virObjectUnref (virobject.c:265)
      ==24845==    by 0x1DD37866: virQEMUCapsInitQMP (qemu_capabilities.c:3397)
      ==24845==    by 0x1DD37CC6: virQEMUCapsNewForBinary (qemu_capabilities.c:3481)
      ==24845==    by 0x1DD381E2: virQEMUCapsCacheLookup (qemu_capabilities.c:3609)
      ==24845==    by 0x1DD30F8A: virQEMUCapsInitGuest (qemu_capabilities.c:744)
      ==24845==    by 0x1DD31889: virQEMUCapsInit (qemu_capabilities.c:1020)
      ==24845==    by 0x1DD7DD36: virQEMUDriverCreateCapabilities (qemu_conf.c:888)
      ==24845==    by 0x1DDC57C0: qemuStateInitialize (qemu_driver.c:803)
      ==24845==    by 0x53DC743: virStateInitialize (libvirt.c:777)
      ==24845==
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      954427c3
  12. 21 2月, 2015 1 次提交
  13. 20 2月, 2015 2 次提交
  14. 17 2月, 2015 1 次提交
  15. 06 2月, 2015 1 次提交
  16. 05 12月, 2014 1 次提交
    • D
      Report original error when QMP probing fails with new QEMU · 25bf888a
      Daniel P. Berrange 提交于
      If probing capabilities via QMP fails, we now have a check
      that prevents us falling back to -help parsing. Unfortunately
      the error message
      
        "Failed to probe capabilities for /usr/bin/qemu-kvm:
         unsupported configuration: QEMU 2.1.2 is too new for help parsing"
      
      is proving rather unhelpful to the user. We need to be telling
      them why QMP failed (the root cause), rather than they can't
      use -help (the side effect).
      
      To do this we should capture stderr during QMP probing, and
      if -help parsing then sees a new QEMU version, we know that
      QMP should have worked, and so we can show the messages from
      stderr. The message thus becomes
      
        "Failed to probe capabilities for /usr/bin/qemu-kvm:
         internal error: QEMU / QMP failed: Could not access
         KVM kernel module: No such file or directory
         failed to initialize KVM: No such file or directory"
      25bf888a
  17. 25 11月, 2014 1 次提交
  18. 20 11月, 2014 1 次提交
  19. 15 11月, 2014 1 次提交
  20. 14 11月, 2014 1 次提交
  21. 10 11月, 2014 1 次提交
  22. 07 11月, 2014 1 次提交
  23. 03 11月, 2014 1 次提交
  24. 30 10月, 2014 1 次提交
    • E
      qemu: better error message when block job can't succeed · 00331bfb
      Eric Blake 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1140981 reports that
      the qemu-kvm shipped as part of RHEL 7.0 intentionally[1] cripples
      block jobs by removing the 'block-stream' QMP command, while still
      leaving 'block-job-cancel' as an unusable no-op.  Meanwhile, we
      already had existing code that checked whether block jobs were
      completely missing (such as qemu 0.15), old style (cancel is
      synchronous, and all commands spelled with '_'), or new style
      (cancel is asynchronous, and all commands spelled with '-'), and
      used that three-way probe to give decent error messages.  At the
      time that code was added, all existing qemu versions fell in one
      of three buckets, and the code was using the presence of
      'block-job-cancel' as the witness of which of the three buckets.
      But now that RHEL qemu has shipped with intentionally crippled
      'block-stream', we have a fourth bucket, which results in ugly
      error messages when trying 'virsh blockpull':
      
       error: Requested operation is not valid: Command 'block-stream' is not found
      
      In reality, the fourth bucket should be treated the same as the
      first bucket (no block job support); we can do that by realizing
      that no existing build of qemu has working block-stream while
      lacking block-job-cancel, so it is easiest to change our witness
      to the command that starts a job rather than ends one.  We still
      act correctly regarding command spelling and whether cancel is
      asynchronous.  And on crippled RHEL builds, we now get the desired:
      
       error: unsupported configuration: block jobs not supported with this qemu binary
      
      [1] The intentional cripple is limited to qemu-kvm of RHEL; when using
      qemu-kvm-rhev of RHEV, block job functionality is supported.  Don't ask
      me to explain the "why" behind it all - I'm just dealing with fallout
      from someone else's decision.
      
      * src/qemu/qemu_capabilities.h (QEMU_CAPS_BLOCKJOB_SYNC): Tweak comment.
      * src/qemu/qemu_capabilities.c (virQEMUCapsCommands): Look for stream
      rather than cancel when determining the flavor of block jobs supported.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      00331bfb
  25. 04 10月, 2014 1 次提交
  26. 27 9月, 2014 1 次提交
  27. 23 9月, 2014 1 次提交
  28. 19 9月, 2014 1 次提交
  29. 18 9月, 2014 1 次提交
    • R
      Fix build in qemu_capabilities · 3b3947ea
      Roman Bogorodskiy 提交于
      Commit f05b6a91 added virQEMUDriverConfigPtr argument to the
      virQEMUCapsFillDomainCaps function and it uses forward declaration
      of virQEMUDriverConfig and virQEMUDriverConfigPtr that casues clang
      build to fail:
      
      gmake[3]: Entering directory `/usr/home/novel/code/libvirt/src'
        CC       qemu/libvirt_driver_qemu_impl_la-qemu_capabilities.lo
      In file included from qemu/qemu_capabilities.c:43:
      In file included from qemu/qemu_hostdev.h:27:
      qemu/qemu_conf.h:63:37: error: redefinition of typedef 'virQEMUDriverConfig'
      is a C11 feature [-Werror,-Wtypedef-redefinition]
      typedef struct _virQEMUDriverConfig virQEMUDriverConfig;
                                          ^
      qemu/qemu_capabilities.h:328:37: note: previous definition is here
      typedef struct _virQEMUDriverConfig virQEMUDriverConfig;
                                          ^
      
      Fix that by passing loader and nloader config attributes directly
      instead of passing complete config.
      3b3947ea
  30. 17 9月, 2014 3 次提交
  31. 12 9月, 2014 1 次提交
    • J
      qemu: Resolve Coverity FORWARD_NULL · 78fbc79d
      John Ferlan 提交于
      If we end up at the cleanup lable before we've VIR_EXPAND_N the list,
      then calling virQEMUCapsFreeStringList() with a NULL proplist could
      theoretically deref proplist if nproplist was set. Coverity doesn't
      seem to acknowledge the relationship between proplist and nproplist
      assuming in virQEMUCapsFreeStringList that nproplist could be at
      least 1 and thus have a null deref.  It only seems to follow the
      NULL proplist.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      78fbc79d
  32. 11 9月, 2014 1 次提交