1. 20 2月, 2017 1 次提交
  2. 06 1月, 2017 1 次提交
  3. 28 11月, 2016 1 次提交
  4. 26 11月, 2016 1 次提交
    • J
      qemu: Enable KVM when probing capabilities · 25ba9c31
      Jiri Denemark 提交于
      CPU related capabilities may differ depending on accelerator used when
      probing. Let's use KVM if available when probing QEMU and fall back to
      TCG. The created capabilities already contain all we need to distinguish
      whether KVM or TCG was used:
      
          - KVM was used when probing capabilities:
              QEMU_CAPS_KVM is set
              QEMU_CAPS_ENABLE_KVM is not set
      
          - TCG was used and QEMU supports KVM, but it failed (e.g., missing
            kernel module or wrong /dev/kvm permissions)
              QEMU_CAPS_KVM is not set
              QEMU_CAPS_ENABLE_KVM is set
      
          - KVM was not used and QEMU does not support it
              QEMU_CAPS_KVM is not set
              QEMU_CAPS_ENABLE_KVM is not set
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      25ba9c31
  5. 22 9月, 2016 1 次提交
    • J
      qemu: Store host-model CPU in qemu capabilities · 68c70118
      Jiri Denemark 提交于
      Host capabilities provide libvirt's view of the host CPU, but for a
      useful support for host-model CPUs we really need a hypervisor's view of
      the CPU. And since the view can be differ with emulator, qemu
      capabilities is the best place to store the host CPU model.
      
      This patch just copies the CPU model from host capabilities, but this
      will change in the future.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      68c70118
  6. 05 8月, 2016 2 次提交
  7. 09 6月, 2016 2 次提交
  8. 08 6月, 2016 3 次提交
  9. 25 5月, 2016 1 次提交
  10. 16 5月, 2016 1 次提交
  11. 06 5月, 2016 5 次提交
  12. 05 5月, 2016 1 次提交
    • J
      tests: Add qemucapsprobe helper · f943a28c
      Jiri Denemark 提交于
      Adding new *.replies files for qemucapabilitiestest or updating the
      files when libvirt adds an additional QMP command into the probing
      process is quite painful. The goal of the new qemucapsprobe command is
      to make this process as easy as
      
          tests/qemucapsprobe /path/to/qemu/binary >caps.replies
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      f943a28c
  13. 24 12月, 2015 1 次提交
  14. 27 11月, 2015 1 次提交
  15. 12 11月, 2015 1 次提交
  16. 22 9月, 2015 1 次提交
    • M
      tests: Avoid use of virQEMUDriverCreateXMLConf(NULL) · 086f37e9
      Michal Privoznik 提交于
      We use the function to create a virDomainXMLOption object that is
      required for some functions. However, we don't pass the driver
      pointer to the object anywhere - rather than pass NULL. This
      causes trouble later when parsing a domain XML and calling post
      parse callbacks:
      
        Program received signal SIGSEGV, Segmentation fault.
        0x000000000043fa3e in qemuDomainDefPostParse (def=0x7d36c0, caps=0x7caf10, opaque=0x0) at qemu/qemu_domain.c:1043
        1043        qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache, def->emulator);
        (gdb) bt
        #0  0x000000000043fa3e in qemuDomainDefPostParse (def=0x7d36c0, caps=0x7caf10, opaque=0x0) at qemu/qemu_domain.c:1043
        #1  0x00007ffff2928bf9 in virDomainDefPostParse (def=0x7d36c0, caps=0x7caf10, xmlopt=0x7c82c0) at conf/domain_conf.c:4269
        #2  0x00007ffff294de04 in virDomainDefParseXML (xml=0x7da8c0, root=0x7dab80, ctxt=0x7da980, caps=0x7caf10, xmlopt=0x7c82c0, flags=0) at conf/domain_conf.c:16400
        #3  0x00007ffff294e5b5 in virDomainDefParseNode (xml=0x7da8c0, root=0x7dab80, caps=0x7caf10, xmlopt=0x7c82c0, flags=0) at conf/domain_conf.c:16582
        #4  0x00007ffff294e424 in virDomainDefParse (xmlStr=0x0, filename=0x7c7ef0 "/home/zippy/work/libvirt/libvirt.git/tests/securityselinuxlabeldata/disks.xml", caps=0x7caf10, xmlopt=0x7c82c0, flags=0) at conf/domain_conf.c:16529
        #5  0x00007ffff294e4b2 in virDomainDefParseFile (filename=0x7c7ef0 "/home/zippy/work/libvirt/libvirt.git/tests/securityselinuxlabeldata/disks.xml", caps=0x7caf10, xmlopt=0x7c82c0, flags=0) at conf/domain_conf.c:16553
        #6  0x00000000004303ca in testSELinuxLoadDef (testname=0x53c929 "disks") at securityselinuxlabeltest.c:192
        #7  0x00000000004309e8 in testSELinuxLabeling (opaque=0x53c929) at securityselinuxlabeltest.c:313
        #8  0x0000000000431207 in virtTestRun (title=0x53c92f "Labelling \"disks\"", body=0x430964 <testSELinuxLabeling>, data=0x53c929) at testutils.c:211
        #9  0x0000000000430c5d in mymain () at securityselinuxlabeltest.c:373
        #10 0x00000000004325c2 in virtTestMain (argc=1, argv=0x7fffffffd7e8, func=0x430b4a <mymain>) at testutils.c:863
        #11 0x0000000000430deb in main (argc=1, argv=0x7fffffffd7e8) at securityselinuxlabeltest.c:381
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      086f37e9
  17. 23 9月, 2014 1 次提交
  18. 19 9月, 2014 1 次提交
  19. 03 7月, 2014 1 次提交
  20. 25 3月, 2014 1 次提交
  21. 18 12月, 2013 1 次提交
    • E
      qemu: ask for -enable-fips when FIPS is required · a21cfb0f
      Eric Blake 提交于
      On a system that is enforcing FIPS, most libraries honor the
      current mode by default.  Qemu, on the other hand, refused to
      honor FIPS mode unless you add the '-enable-fips' command
      line option; worse, this option is not discoverable via QMP,
      and is only present on binaries built for Linux.  So, if we
      detect FIPS mode, then we unconditionally ask for FIPS; either
      qemu is new enough to have the option and then correctly
      cripple insecure VNC passwords, or it is so old that we are
      correctly avoiding a FIPS violation by preventing qemu from
      starting.  Meanwhile, if we don't detect FIPS mode, then
      omitting the argument is safe whether the qemu has the option
      (but it would do nothing because FIPS is disabled) or whether
      qemu lacks the option (including in the case where we are not
      running on Linux).
      
      The testsuite was a bit interesting: we don't want our test
      to depend on whether it is being run in FIPS mode, so I had
      to tweak things to set the capability bit outside of our
      normal interaction with capability parsing.
      
      This fixes https://bugzilla.redhat.com/show_bug.cgi?id=1035474
      
      * src/qemu/qemu_capabilities.h (QEMU_CAPS_ENABLE_FIPS): New bit.
      * src/qemu/qemu_capabilities.c (virQEMUCapsInitQMP): Conditionally
      set capability according to detection of FIPS mode.
      * src/qemu/qemu_command.c (qemuBuildCommandLine): Use it.
      * tests/qemucapabilitiestest.c (testQemuCaps): Conditionally set
      capability to test expected output.
      * tests/qemucapabilitiesdata/caps_1.2.2-1.caps: Update list.
      * tests/qemucapabilitiesdata/caps_1.6.0-1.caps: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      a21cfb0f
  22. 31 10月, 2013 1 次提交
    • E
      maint: avoid further typedef accidents · fb861352
      Eric Blake 提交于
      To make it easier to forbid future attempts at a confusing typedef
      name ending in Ptr that isn't actually a pointer, insist that we
      follow our preferred style of 'typedef foo *fooPtr'.
      
      * cfg.mk (sc_forbid_const_pointer_typedef): Enforce consistent
      style, to prevent issue fixed in previous storage patch.
      * src/conf/capabilities.h (virCapsPtr): Fix offender.
      * src/security/security_stack.c (virSecurityStackItemPtr):
      Likewise.
      * tests/qemucapabilitiestest.c (testQemuDataPtr): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      fb861352
  23. 15 10月, 2013 1 次提交
    • E
      maint: avoid 'const fooPtr' in tests · b8984770
      Eric Blake 提交于
      'const fooPtr' is the same as 'foo * const' (the pointer won't
      change, but it's contents can).  But in general, if an interface
      is trying to be const-correct, it should be using 'const foo *'
      (the pointer is to data that can't be changed).
      
      Fix up offenders in the testsuite.
      
      * tests/cputest.c (cpuTestCompareXML): Use intended type.
      * tests/qemucapabilitiestest.c (testQemuCaps): Likewise.
      * tests/qemumonitorjsontest.c: Drop const.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      b8984770
  24. 08 10月, 2013 1 次提交
  25. 03 10月, 2013 5 次提交
  26. 01 10月, 2013 1 次提交
    • M
      tests: Introduce qemucapabilitiestest · 63857eb4
      Michal Privoznik 提交于
      This test is there to ensure that our capabilities detection code isn't
      broken somehow.
      
      How to gather test data:
      
      Firstly, the data is split into two separate files. The former (with
      suffix .replies) contains all the qemu replies. This is very fragile as
      introducing a new device can mean yet another monitor command and hence
      edit of this file in the future. But there's no better way of doing
      this. To get this data simply turn on debug logs and copy all the
      QEMU_MONITOR_IO_PROCESS lines. But be careful to not copy incomplete
      ones (yeah, we report some incomplete lines too). Long story short, at
      the libvirtd startup, a dummy qemu is spawn to get all the capabilities.
      
      The latter (with suffix .caps) contains capabilities XML. Just start a
      domain and copy the corresponding part from its state XML file.
      Including <qemuCaps> tag.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      63857eb4