1. 15 5月, 2019 1 次提交
    • J
      qemu: Don't cache microcode version · cb6bcb03
      Jiri Denemark 提交于
      My earlier commit be46f613 was incomplete. It removed caching of
      microcode version in the CPU driver, which means the capabilities XML
      will see the correct microcode version. But it is also cached in the
      QEMU capabilities cache where it is used to detect whether we need to
      reprobe QEMU. By missing the second place, the original commit
      be46f613 made the situation even worse since libvirt would report
      correct microcode version while still using the old host CPU model
      (visible in domain capabilities XML).
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      (cherry picked from commit 673c62a3)
      
      CVE-2018-12126, CVE-2018-12127, CVE-2018-12130
      
      Conflicts:
      	src/qemu/qemu_capabilities.c
                  - virQEMUCapsCacheLookupByArch refactoring (commits
                    7948ad41 and 1a3de670) are missing
                  - commit a7424faf "Force QMP capability probing" is
                    missing downstream
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      cb6bcb03
  2. 04 1月, 2018 1 次提交
  3. 26 7月, 2017 3 次提交
    • P
      qemu: switch QEMU capabilities to use virFileCache · d03de54e
      Pavel Hrdina 提交于
      The switch contains considerable amount of changes:
      
        virQEMUCapsRememberCached() is removed because this is now handled
        by virFileCacheSave().
      
        virQEMUCapsInitCached() is removed because this is now handled by
        virFileCacheLoad().
      
        virQEMUCapsNewForBinary() is split into two functions,
        virQEMUCapsNewData() which creates new data if there is nothing
        cached and virQEMUCapsLoadFile() which loads the cached data.
        This is now handled by virFileCacheNewData().
      
        virQEMUCapsCacheValidate() is removed because this is now handled by
        virFileCacheValidate().
      
        virQEMUCapsCacheFree() is removed because it's no longer required.
      
        Add virCapsPtr into virQEMUCapsCachePriv because for each call of
        virFileCacheLookup*() we need to use current virCapsPtr.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
      d03de54e
    • P
      qemu: pass only host arch instead of the whole virCaps · f366cfed
      Pavel Hrdina 提交于
      This is a preparation for following patches where we switch to
      virFileCache for QEMU capabilities cache
      
      The host arch will always remain the same but virCaps may change.  Now
      the host arch is stored while creating new qemu capabilities cache.
      It removes the need to pass virCaps into virQEMUCapsCache*() functions.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
      f366cfed
    • P
      tests: rewrite host CPU mocking · 13554a9e
      Pavel Hrdina 提交于
      Move all the host CPU data into a separate file and rewrite qemucpumock
      to not use passed @caps.  This is preparation for following patch which
      will replace virCaps argument with virArch.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
      13554a9e
  4. 20 7月, 2017 1 次提交
  5. 13 6月, 2017 1 次提交
  6. 11 4月, 2017 4 次提交
  7. 23 3月, 2017 1 次提交
  8. 17 3月, 2017 1 次提交
  9. 08 3月, 2017 1 次提交
    • M
      qemuTestDriverInit: Don't access live data · 16efa11a
      Michal Privoznik 提交于
      Some of our tests (e.g. qemuhotplugtest) call
      virDomainSaveConfig(). Now the problem is, qemuTestDriverInit()
      creates a fake qemu driver and fills it with some fake
      configuration. At least so we hoped. The truth is, it calls
      regular virQEMUDriverConfigNew() and then fix couple of paths.
      Literally. Therefore our tests see regular stateDir and configDir
      for the user that is running the tests. Directories, where live
      domain XMLs are stored. Let's just hope our test suite hasn't
      mangled any of them.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      16efa11a
  10. 04 11月, 2016 1 次提交
  11. 22 9月, 2016 4 次提交
  12. 10 8月, 2016 1 次提交
  13. 01 8月, 2016 1 次提交
    • P
      tests: qemu: Don't leak security manager object · 71d341e7
      Peter Krempa 提交于
      ==2064442== 200 (88 direct, 112 indirect) bytes in 1 blocks are definitely lost in loss record 54 of 73
      ==2064442==    at 0x4C2E0F0: calloc (vg_replace_malloc.c:711)
      ==2064442==    by 0x18E75B80: virAllocVar (viralloc.c:560)
      ==2064442==    by 0x18EC43B0: virObjectNew (virobject.c:193)
      ==2064442==    by 0x18EC476E: virObjectLockableNew (virobject.c:219)
      ==2064442==    by 0x1906BC73: virSecurityManagerNewDriver (security_manager.c:93)
      ==2064442==    by 0x1906C076: virSecurityManagerNewStack (security_manager.c:115)
      ==2064442==    by 0x43CC39: qemuTestDriverInit (testutilsqemu.c:548)
      ==2064442==    by 0x4337ED: mymain (qemumonitorjsontest.c:2440)
      ==2064442==    by 0x43BABE: virTestMain (testutils.c:982)
      ==2064442==    by 0x43A490: main (qemumonitorjsontest.c:2558)
      71d341e7
  14. 18 5月, 2016 1 次提交
  15. 06 5月, 2016 1 次提交
  16. 13 4月, 2016 1 次提交
    • J
      drop qemuBuildCommandLineCallbacks · 0da965c5
      Ján Tomko 提交于
      Essentially revert commit 3a6204cb which added these to allow the test
      suite to pass without depending on the host system state.
      
      Since commit 4b527c1a we already mock virSCSIDeviceGetSgName, so these
      callbacks are useless.
      0da965c5
  17. 24 3月, 2016 1 次提交
  18. 22 3月, 2016 1 次提交
  19. 18 1月, 2016 1 次提交
  20. 10 1月, 2016 1 次提交
  21. 10 11月, 2015 1 次提交
  22. 22 9月, 2015 4 次提交
    • M
      qemuTestDriverInit: init the driver lock too · b1dc59b3
      Michal Privoznik 提交于
      Even though usage of the lock is limited to a very few cases,
      it's still needed. Therefore we should initialize it too.
      Otherwise we may get some random test failures:
      
      ==1204== Conditional jump or move depends on uninitialised value(s)
      ==1204==    at 0xEF7F7CF: pthread_mutex_lock (in /lib64/libpthread-2.20.so)
      ==1204==    by 0x9CA89A5: virMutexLock (virthread.c:89)
      ==1204==    by 0x450B2A: qemuDriverLock (qemu_conf.c:83)
      ==1204==    by 0x45549C: virQEMUDriverGetConfig (qemu_conf.c:869)
      ==1204==    by 0x448E29: qemuDomainDeviceDefPostParse (qemu_domain.c:1240)
      ==1204==    by 0x9CC9B13: virDomainDeviceDefPostParse (domain_conf.c:4224)
      ==1204==    by 0x9CC9B91: virDomainDefPostParseDeviceIterator (domain_conf.c:4251)
      ==1204==    by 0x9CC7843: virDomainDeviceInfoIterateInternal (domain_conf.c:3440)
      ==1204==    by 0x9CC9C25: virDomainDefPostParse (domain_conf.c:4276)
      ==1204==    by 0x9CEEE03: virDomainDefParseXML (domain_conf.c:16400)
      ==1204==    by 0x9CEF5B4: virDomainDefParseNode (domain_conf.c:16582)
      ==1204==    by 0x9CEF423: virDomainDefParse (domain_conf.c:16529)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      b1dc59b3
    • P
      tests: use mockup cache · 0636c4a8
      Pavel Fedin 提交于
      Use the new API in order to correctly add capability sets to the cache
      before parsing XML files
      Signed-off-by: NPavel Fedin <p.fedin@samsung.com>
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      0636c4a8
    • P
      Implement infrastracture for mocking up QEMU capabilities cache · f7dd3357
      Pavel Fedin 提交于
      The main purpose of this patch is to introduce test mode to
      virQEMUCapsCacheLookup(). This is done by adding a global variable, which
      effectively overrides binary name. This variable is supposed to be set by
      test suite.
      
      The second addition is qemuTestCapsCacheInsert() function which allows the
      test suite to actually populate the cache.
      Signed-off-by: NPavel Fedin <p.fedin@samsung.com>
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      f7dd3357
    • P
      tests: split out common qemu driver initialization · 5b7bf208
      Pavel Fedin 提交于
      Two utility functions are introduced for proper initialization and
      cleanup of the driver.
      Signed-off-by: NPavel Fedin <p.fedin@samsung.com>
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      5b7bf208
  23. 13 8月, 2015 1 次提交
    • M
      qemu: Keep numad hint after daemon restart · 8ce86722
      Martin Kletzander 提交于
      The numad hint stored in priv->autoNodeset is information that gets lost
      during daemon restart.  And because we would like to use that
      information in the future, we also need to save it in the status XML.
      For the sake of tests, we need to initialize nnumaCell_max to some
      value, so that the restoration doesn't fail in our test suite.  There is
      no need to fill in the actual numa cell data since the recalculating
      function virCapabilitiesGetCpusForNodemask() will not fail, it will just
      skip filling the data in the bitmap which we don't use in tests anyway.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      8ce86722
  24. 23 6月, 2015 1 次提交
  25. 08 5月, 2015 1 次提交
    • C
      caps: Fix regression defaulting to host arch · 8910e063
      Cole Robinson 提交于
      My commit 747761a7 (v1.2.15 only) dropped this bit of logic when filling
      in a default arch in the XML:
      
      -    /* First try to find one matching host arch */
      -    for (i = 0; i < caps->nguests; i++) {
      -        if (caps->guests[i]->ostype == ostype) {
      -            for (j = 0; j < caps->guests[i]->arch.ndomains; j++) {
      -                if (caps->guests[i]->arch.domains[j]->type == domain &&
      -                    caps->guests[i]->arch.id == caps->host.arch)
      -                    return caps->guests[i]->arch.id;
      -            }
      -        }
      -    }
      
      That attempt to match host.arch is important, otherwise we end up
      defaulting to i686 on x86_64 host for KVM, which is not intended.
      Duplicate it in the centralized CapsLookup function.
      
      Additionally add some testcases that would have caught this.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1219191
      8910e063
  26. 24 4月, 2015 1 次提交
  27. 21 4月, 2015 2 次提交
  28. 26 3月, 2015 1 次提交