1. 17 7月, 2014 1 次提交
    • M
      support for QEMU vhost-user · a14abd46
      Michele Paolino 提交于
      This patch adds support for the QEMU vhost-user feature to libvirt.
      vhost-user enables the communication between a QEMU virtual machine
      and other userspace process using the Virtio transport protocol.
      It uses a char dev (e.g. Unix socket) for the control plane,
      while the data plane based on shared memory.
      
      The XML looks like:
      
      <interface type='vhostuser'>
          <mac address='52:54:00:3b:83:1a'/>
          <source type='unix' path='/tmp/vhost.sock' mode='server'/>
          <model type='virtio'/>
      </interface>
      Signed-off-by: NMichele Paolino <m.paolino@virtualopensystems.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      a14abd46
  2. 16 7月, 2014 3 次提交
    • C
      add nocow test case · 0b0c641b
      Chunyan Liu 提交于
      Add file in storagevolxml2xmlin and storagevolxml2xmlout, let
      storagevolxml2xmltest and storagevolschematest cover 'nocow'.
      Add test case to storagevolxml2argvtest to cover 'nocow'.
      Signed-off-by: NChunyan Liu <cyliu@suse.com>
      0b0c641b
    • J
      Fix assignment of comparison against zero · 3103a977
      Ján Tomko 提交于
      Assign the value we're comparing:
      (val = func()) < 0
      instead of assigning the comparison value:
      (val = func() < 0)
      
      Both were introduced along with the code,
      the TLS tests by commit bd789dff in 0.9.4
      net events by commit de87691f in 1.2.2.
      
      Note that the event id type fix is a no-op:
      vshNetworkEventIdTypeFromString can only return
      -1 (failure) and the event is never used or
      0 (the only possible event) and the value of 0 < 0 is still 0.
      3103a977
    • R
      util: virstatslinux: make more generic · 5559a8b8
      Roman Bogorodskiy 提交于
      Rename linuxDomainInterfaceStats to virNetInterfaceStats in order
      to allow adding platform specific implementations without
      making consumer worrying about specific implementation to be used.
      
      Also, rename util/virstatslinux.c to util/virstats.c so placing
      other platform specific implementations into this file don't
      look unexpected from the file name.
      5559a8b8
  3. 14 7月, 2014 2 次提交
    • E
      capabilities: use bool instead of int · 58156f39
      Eric Blake 提交于
      While preparing to add a capability for active commit, I noticed
      that the existing code was abusing int for boolean values.
      
      * src/conf/capabilities.h (_virCapsGuestFeature, _virCapsHost)
      (virCapabilitiesNew, virCapabilitiesAddGuestFeature): Improve
      types.
      * src/conf/capabilities.c (virCapabilitiesNew)
      (virCapabilitiesAddGuestFeature): Adjust signature.
      * src/bhyve/bhyve_capabilities.c (virBhyveCapsBuild): Update
      clients.
      * src/esx/esx_driver.c (esxCapsInit): Likewise.
      * src/libxl/libxl_conf.c (libxlMakeCapabilities): Likewise.
      * src/lxc/lxc_conf.c (virLXCDriverCapsInit): Likewise.
      * src/openvz/openvz_conf.c (openvzCapsInit): Likewise.
      * src/parallels/parallels_driver.c (parallelsBuildCapabilities):
      Likewise.
      * src/phyp/phyp_driver.c (phypCapsInit): Likewise.
      * src/qemu/qemu_capabilities.c (virQEMUCapsInit)
      (virQEMUCapsInitGuestFromBinary): Likewise.
      * src/security/virt-aa-helper.c (get_definition): Likewise.
      * src/test/test_driver.c (testBuildCapabilities): Likewise.
      * src/uml/uml_conf.c (umlCapsInit): Likewise.
      * src/vbox/vbox_tmpl.c (vboxCapsInit): Likewise.
      * src/vmware/vmware_conf.c (vmwareCapsInit): Likewise.
      * src/xen/xen_hypervisor.c (xenHypervisorBuildCapabilities):
      Likewise.
      * src/xenapi/xenapi_driver.c (getCapsObject): Likewise.
      * tests/qemucaps2xmltest.c (testGetCaps): Likewise.
      * tests/testutils.c (virTestGenericCapsInit): Likewise.
      * tests/testutilslxc.c (testLXCCapsInit): Likewise.
      * tests/testutilsqemu.c (testQemuCapsInit): Likewise.
      * tests/testutilsxen.c (testXenCapsInit): Likewise.
      * tests/vircaps2xmltest.c (buildVirCapabilities): Likewise.
      * tests/vircapstest.c (buildNUMATopology): Likewise.
      * tests/vmx2xmltest.c (testCapsInit): Likewise.
      * tests/xml2vmxtest.c (testCapsInit): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      58156f39
    • M
      conf: Always format seclabel's model · 99c8d2e8
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1113860
      
      We've always done that. Well, until 990e46c4. Point is, if we don't
      format model, we may lose a domain on libvirtd restart. If the
      seclabel is implicit however, we should skip it's formatting.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      99c8d2e8
  4. 11 7月, 2014 1 次提交
  5. 09 7月, 2014 1 次提交
  6. 04 7月, 2014 5 次提交
    • P
      qemu: monitor: Add argument for specifying backing name for block commit · c29b6529
      Peter Krempa 提交于
      To allow changing the name that is recorded in the overlay of the TOP
      image used in a block commit operation, we need to specify the backing
      name to qemu. This is done via the "backing-file" attribute to the
      block-commit command.
      c29b6529
    • J
      Utilize virDomainDiskAuth for domain disk · 6887af39
      John Ferlan 提交于
      Replace the inline "auth" struct in virStorageSource with a pointer
      to a virStorageAuthDefPtr and utilize between the domain_conf, qemu_conf,
      and qemu_command sources for finding the auth data for a domain disk
      6887af39
    • J
      qemuargv2xmltest: Resurrect RBD and iSCSI auth · 7712fc7c
      John Ferlan 提交于
      Ressurect the disk-drive-network-iscsi-auth and disk-drive-network-rbd-auth
      tests.  Make adjustments to the args and xml file to be compatible with
      other changes made to the non "-auth" so that the only difference is the
      authentication information.
      
      Adjust the qemuargv2xmltest.c to filter out "<secret" and "</auth>" since
      the args -> xml has no concept of usage it doesn't get printed. This results
      in the </auth> being printed on the same line as "<secret" and the secret
      XML is not closed - a bit of an issue, but soon to be fixed.
      7712fc7c
    • E
      blockjob: turn on qemu capability bit for active commit · 40ad7160
      Eric Blake 提交于
      Use the probing functionality added in the last patch to turn on
      a capability bit when active commit is present, and gate active
      commit on that capability.
      
      For my own reference: the difference between BLOCKJOB_SYNC and
      BLOCKJOB_ASYNC is whether qemu generated an event at the
      conclusion of blockpull; basically, RHEL 6.2 was the only release
      of qemu that has the sync semantics and lacks the event.  RHEL
      6.3 added blockcopy, but also picked up on the upstream style
      of qemu generating events.  As no one is likely to backport
      active commit to RHEL 6.2, it's safe for blockcommit to always
      require async blockjob support.
      
      Modifying qemucapabilitiestest is painful; the .replies files would
      be so much easier if they had comments correlating which command
      generated the given reply.  Maybe I'll fix that up later...
      
      * src/qemu/qemu_capabilities.h (QEMU_CAPS_ACTIVE_COMMIT): New
      capability.
      * src/qemu/qemu_driver.c (qemuDomainBlockCommit): Use the new bit
      * src/qemu/qemu_capabilities.c (virQEMUCaps): Name the new bit.
      (virQEMUCapsProbeQMPCommands): Set it.
      * tests/qemucapabilitiesdata/caps_1.3.1-1.replies: Update.
      * tests/qemucapabilitiesdata/caps_1.4.2-1.replies: Likewise.
      * tests/qemucapabilitiesdata/caps_1.5.3-1.replies: Likewise.
      * tests/qemucapabilitiesdata/caps_1.6.0-1.replies: Likewise.
      * tests/qemucapabilitiesdata/caps_1.6.50-1.replies: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      40ad7160
    • E
      blockjob: allow omitted arguments to QMP block-commit · 47549d5a
      Eric Blake 提交于
      We are about to turn on support for active block commit.  Although
      qemu 2.0 was the first version to mostly support it, that version
      mis-handles 0-length files, and doesn't have anything available for
      easy probing.  But qemu 2.1 fixed bugs, and made life simpler by
      letting the 'top' argument be optional.  Unless someone begs for
      active commit with qemu 2.0, for now we are just going to enable
      it only by probing for qemu 2.1 behavior (anyone backporting active
      commit can also backport the optional argument behavior).  This
      requires qemu.git commit 7676e2c597000eff3a7233b40cca768b358f9bc9.
      
      Although all our actual uses of block-commit supply arguments for
      both base and top, we can omit both arguments and use a bogus
      device string to trigger an interesting behavior in qemu.  All QMP
      commands first do argument validation, failing with GenericError
      if a mandatory argument is missing.  Once that passes, the code
      in the specific command gets to do further checking, and the qemu
      developers made sure that if device is the only supplied argument,
      then the block-commit code will look up the device first, with a
      failure of DeviceNotFound, before attempting any further argument
      validation (most other validations fail with GenericError).  Thus,
      the category of error class can reliably be used to decipher
      whether the top argument was optional, which in turn implies a
      working active commit.  Since we expect our bogus device string to
      trigger an error either way, the code is written to return a
      distinct return value without spamming the logs.
      
      * src/qemu/qemu_monitor.h (qemuMonitorSupportsActiveCommit): New
      prototype.
      * src/qemu/qemu_monitor.c (qemuMonitorSupportsActiveCommit):
      Implement it.
      * src/qemu/qemu_monitor_json.h (qemuMonitorJSONBlockCommit):
      Allow NULL for top and base, for probing purposes.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONBlockCommit):
      Likewise, implementing the probe.
      * tests/qemumonitorjsontest.c (mymain): Enable...
      (testQemuMonitorJSONqemuMonitorSupportsActiveCommit): ...a new test.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      47549d5a
  7. 03 7月, 2014 6 次提交
    • M
      tests: Avoid double linking some libraries · fb8bc6be
      Michal Privoznik 提交于
      The problem is, since 614581f3 domaincapstest is linked with
      $(LDADDS) by default. Then, since 94e3f23e the test may be
      conditionally linked with $(qemu_LDADDS) which already contains
      $(LDADDS). And some linkers doesn't cope with this nicely:
      
        CCLD     domaincapstest
      ../src/libvirt_probes.o:(.probes+0x0): multiple definition of `libvirt_event_poll_add_handle_semaphore'
      ../src/libvirt_probes.o:(.probes+0x0): first defined here
      ../src/libvirt_probes.o:(.probes+0x2): multiple definition of `libvirt_event_poll_update_handle_semaphore'
      ../src/libvirt_probes.o:(.probes+0x2): first defined here
      ../src/libvirt_probes.o:(.probes+0x4): multiple definition of `libvirt_event_poll_remove_handle_semaphore'
      ../src/libvirt_probes.o:(.probes+0x4): first defined here
      ../src/libvirt_probes.o:(.probes+0x6): multiple definition of `libvirt_event_poll_dispatch_handle_semaphore'
      ../src/libvirt_probes.o:(.probes+0x6): first defined here
      
      And so on.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      fb8bc6be
    • M
      qemu: Implement virConnectGetDomainCapabilities · 94e3f23e
      Michal Privoznik 提交于
      So far only information on disks and host devices are exposed in the
      capabilities XML. Well, at least something. Even a new test is
      introduced. The qemu capabilities are stolen from already existing
      qemucapabilities test. There's one tricky point though. Functions that
      checks host's KVM and VFIO capabilities, are impossible to mock
      currently. So in the test, we are setting the capabilities by hand.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      94e3f23e
    • M
      tests: Move qemu caps XML parsing into shared unit · 3ecb9e76
      Michal Privoznik 提交于
      Later on, we the qemu capabilities XML parsing code may come handy so
      instead of duplicating the code make the already existing one shared.
      By the same time, make the function accept file name instead of XML
      document stored already in memory.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      3ecb9e76
    • M
      Introduce domain_capabilities · 614581f3
      Michal Privoznik 提交于
      This new module holds and formats capabilities for emulator. If you
      are about to create a new domain, you may want to know what is the
      host or hypervisor capable of. To make sure we don't regress on the
      XML, the formatting is not something left for each driver to
      implement, rather there's general format function.
      
      The domain capabilities is a lockable object (even though the locking
      is not necessary yet) which uses reference counter.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      614581f3
    • J
      Use virBufferCheckError everywhere we report OOM error · 92a8e72f
      Ján Tomko 提交于
      Replace:
      if (virBufferError(&buf)) {
          virBufferFreeAndReset(&buf);
          virReportOOMError();
          ...
      }
      
      with:
      if (virBufferCheckError(&buf) < 0)
          ...
      
      This should not be a functional change (unless some callers
      misused the virBuffer APIs - a different error would be reported
      then)
      92a8e72f
    • J
      Report errors in virCapabilitiesFormatXML · 28b9be24
      Ján Tomko 提交于
      So far, we only report an error if formatting the siblings bitmap
      in NUMA topology fails.
      
      Be consistent and always report error in virCapabilitiesFormatXML.
      28b9be24
  8. 02 7月, 2014 1 次提交
  9. 01 7月, 2014 2 次提交
    • M
      vboxsnapshotxmltest: Don't write to a file in abs_srcdir · 7315189e
      Michal Privoznik 提交于
      In the test, the snapshot XML is written into a file that's located
      under:
      
        abs_srcdir/vboxsnapshotxmldata/testResult.vbox
      
      However, the abs_srcdir doesn't have to be necessarily writable. It
      should have been abs_builddir instead. Moreover, the label in the func
      creating the file is called 'fail' while it fulfils the duty of
      'cleanup' label.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      7315189e
    • M
      securityselinuxlabeltest: Don't create dummy file in the srcdir · e5f5805f
      Michal Privoznik 提交于
      At the very beginning of the test we check if the underlying
      filesystem supports extended attributes as they are used to store fake
      SELinux labels. In order to check that, a dummy file is created and
      semi-random attribute is set. However, the file is created under:
      
        abs_srcdir "/securityselinuxlabeldata/testxattr"
      
      which has two problems: abs_srcdir is not required to be writable, so
      it should have been abs_builddir. The second one is - there's no
      "securityselinuxlabeldata" folder under abs_builddir. The problem was
      introduced in caf164f1.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      e5f5805f
  10. 27 6月, 2014 2 次提交
  11. 26 6月, 2014 3 次提交
  12. 25 6月, 2014 9 次提交
  13. 24 6月, 2014 3 次提交
  14. 23 6月, 2014 1 次提交
    • L
      qemu: parse -device virtio-balloon · ef016226
      Laine Stump 提交于
      There are no options to parse here other than the name of the device,
      and all three possible device names have the same prefix
      ("virtio-balloon" with "-ccw", "-pci", or "-device" appended), so the
      code is fairly simple. It has been implemented such that it will be
      easier to add handling for other -device entries that aren't otherwise
      recognized - just add another "else if (STRPREFIX(opts, ....)" clause.
      
      qemuParseCommandLineString() previously would always add a <memballoon
      model='virtio'/> to every result (the comments erroneously say that it
      is adding a <memballoon model='none'/>) This has been changed to add
      model='none', and 84 test case xml's updated accordingly (so that
      qemuxml2argvtest won't fail).
      
      Now that the memballoon device is properly parsed, we can safely add a
      test for properly ignoring -nodefconfig and -nodefaults. Rather than
      adding an entire new test case for this (and memballoon), we just
      randomly pick the clock-utc test and modify it slightly to fulfill the
      purpose.
      ef016226