1. 18 1月, 2011 2 次提交
    • E
      qemu: use -incoming fd:n to avoid qemu holding fd indefinitely · 1859939a
      Eric Blake 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=620363
      
      When using -incoming stdio or -incoming exec:, qemu keeps the
      stdin fd open long after the migration is complete.  Not to
      mention that exec:cat is horribly inefficient, by doubling the
      I/O and going through a popen interface in qemu.
      
      The new -incoming fd: of qemu 0.12.0 closes the fd after using
      it, and allows us to bypass an intermediary cat process for
      less I/O.
      
      * src/qemu/qemu_command.h (qemuBuildCommandLine): Add parameter.
      * src/qemu/qemu_command.c (qemuBuildCommandLine): Support
      migration via fd: when possible.  Consolidate migration handling
      into one spot, now that it is more complex.
      * src/qemu/qemu_driver.c (qemudStartVMDaemon): Update caller.
      * tests/qemuxml2argvtest.c (mymain): Likewise.
      * tests/qemuxml2argvdata/qemuxml2argv-restore-v2-fd.args: New file.
      * tests/qemuxml2argvdata/qemuxml2argv-restore-v2-fd.xml: Likewise.
      1859939a
    • J
      tests: Add tests for per-device boot elements · e182ba87
      Jiri Denemark 提交于
      e182ba87
  2. 16 1月, 2011 1 次提交
    • M
      tests: Remove obsolete secaatest · ed25dcc2
      Matthias Bolte 提交于
      Before the security driver was refactored in d6623003 seclabeltest and
      secaatest were basically the same. seclabeltest was meant for SELinux
      and secaatest for AppArmor. Both tests exited early when the specific
      security driver backend wasn't enabled.
      
      With the new security manager trying to initialize a disabled security
      driver backend is an error that can't be distinguished from other errors
      anymore. Therefore, the updated seclabeltest just asks for the first
      available backend as this will always work even with SELinux and AppArmor
      backend being disabled due to the new Nop backend.
      
      Remove the obsolete secaatest and compile and run the seclabeltest
      unconditional.
      
      This fixes make check on systems that support AppArmor.
      ed25dcc2
  3. 15 1月, 2011 2 次提交
    • E
      qemu: move monitor device out of domain_conf common code · 30b9e608
      Eric Blake 提交于
      * src/conf/domain_conf.h (virDomainChrDeviceType): Drop monitor.
      * src/conf/domain_conf.c (virDomainChrDevice)
      (virDomainChrDefParseTargetXML, virDomainChrDefFormat): Drop
      monitor support.
      * src/qemu/qemu_command.h (qemuBuildCommandLine): Alter signature.
      * src/qemu/qemu_monitor.h (qemuMonitorOpen): Likewise.
      * src/qemu/qemu_domain.h (_qemuDomainObjPrivate): Change type of
      monConfig.
      * src/qemu/qemu_domain.c (qemuDomainObjPrivateFree)
      (qemuDomainObjPrivateXMLFormat, qemuDomainObjPrivateXMLParse):
      Adjust to type change.
      * src/qemu/qemu_command.c (qemuBuildCommandLine): Likewise.
      * src/qemu/qemu_driver.c (qemuPrepareMonitorChr)
      (qemudStartVMDaemon, qemuDomainXMLToNative, qemuConnectMonitor)
      (qemudShutdownVMDaemon): Likewise.
      * src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise.
      * src/qemu/qemu_monitor.c (qemuMonitorOpen): Likewise.
      * tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Likewise.
      30b9e608
    • E
      domain_conf: split source data out from ChrDef · 98334e7c
      Eric Blake 提交于
      This opens up the possibility of reusing the smaller ChrSourceDef
      for both qemu monitor and a passthrough smartcard device.
      
      * src/conf/domain_conf.h (_virDomainChrDef): Factor host
      details...
      (_virDomainChrSourceDef): ...into new struct.
      (virDomainChrSourceDefFree): New prototype.
      * src/conf/domain_conf.c (virDomainChrDefFree)
      (virDomainChrDefParseXML, virDomainChrDefFormat): Split...
      (virDomainChrSourceDefClear, virDomainChrSourceDefFree)
      (virDomainChrSourceDefParseXML, virDomainChrSourceDefFormat):
      ...into new functions.
      (virDomainChrDefParseTargetXML): Update clients to reflect type
      split.
      * src/vmx/vmx.c (virVMXParseSerial, virVMXParseParallel)
      (virVMXFormatSerial, virVMXFormatParallel): Likewise.
      * src/xen/xen_driver.c (xenUnifiedDomainOpenConsole): Likewise.
      * src/xen/xend_internal.c (xenDaemonParseSxprChar)
      (xenDaemonFormatSxprChr): Likewise.
      * src/vbox/vbox_tmpl.c (vboxDomainDumpXML, vboxAttachSerial)
      (vboxAttachParallel): Likewise.
      * src/security/security_dac.c (virSecurityDACSetChardevLabel)
      (virSecurityDACSetChardevCallback)
      (virSecurityDACRestoreChardevLabel)
      (virSecurityDACRestoreChardevCallback): Likewise.
      * src/security/security_selinux.c (SELinuxSetSecurityChardevLabel)
      (SELinuxSetSecurityChardevCallback)
      (SELinuxRestoreSecurityChardevLabel)
      (SELinuxSetSecurityChardevCallback): Likewise.
      * src/security/virt-aa-helper.c (get_files): Likewise.
      * src/lxc/lxc_driver.c (lxcVmStart, lxcDomainOpenConsole):
      Likewise.
      * src/uml/uml_conf.c (umlBuildCommandLineChr): Likewise.
      * src/uml/uml_driver.c (umlIdentifyOneChrPTY, umlIdentifyChrPTY)
      (umlDomainOpenConsole): Likewise.
      * src/qemu/qemu_command.c (qemuBuildChrChardevStr)
      (qemuBuildChrArgStr, qemuBuildCommandLine)
      (qemuParseCommandLineChr): Likewise.
      * src/qemu/qemu_domain.c (qemuDomainObjPrivateXMLFormat)
      (qemuDomainObjPrivateXMLParse): Likewise.
      * src/qemu/qemu_cgroup.c (qemuSetupChardevCgroup): Likewise.
      * src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise.
      * src/qemu/qemu_driver.c (qemudFindCharDevicePTYsMonitor)
      (qemudFindCharDevicePTYs, qemuPrepareChardevDevice)
      (qemuPrepareMonitorChr, qemudShutdownVMDaemon)
      (qemuDomainOpenConsole): Likewise.
      * src/qemu/qemu_command.h (qemuBuildChrChardevStr)
      (qemuBuildChrArgStr): Delete, now that they are static.
      * src/libvirt_private.syms (domain_conf.h): New exports.
      * cfg.mk (useless_free_options): Update list.
      * tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Update
      tests.
      98334e7c
  4. 14 1月, 2011 1 次提交
    • E
      qemu: improve device flag parsing · f892f5a5
      Eric Blake 提交于
      * src/qemu/qemu_capabilities.h (qemuCapsParseDeviceStr): New
      prototype.
      * src/qemu/qemu_capabilities.c (qemuCapsParsePCIDeviceStrs)
      Rename and split...
      (qemuCapsExtractDeviceStr, qemuCapsParseDeviceStr): ...to make it
      easier to add and test device-specific checks.
      (qemuCapsExtractVersionInfo): Update caller.
      * tests/qemuhelptest.c (testHelpStrParsing): Also test parsing of
      device-related flags.
      (mymain): Update expected flags.
      * tests/qemuhelpdata/qemu-0.12.1-device: New file.
      * tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel60-device: New file.
      * tests/qemuhelpdata/qemu-kvm-0.12.3-device: New file.
      * tests/qemuhelpdata/qemu-kvm-0.13.0-device: New file.
      f892f5a5
  5. 13 1月, 2011 1 次提交
    • E
      tests: virsh is no longer in builddir/src · 90c2a138
      Eric Blake 提交于
      Commit 870dba07 (Mar 2008) added builddir/src to PATH to pick
      up virsh.  Later, virsh was moved to tools; commit db68d6b1
      (Oct 2009) noticed this, but only added the new location rather
      than deleting the old location.
      
      * tests/Makefile.am (path_add): Drop now-useless directory.
      Suggested by Daniel P. Berrange.
      90c2a138
  6. 11 1月, 2011 2 次提交
    • R
      qemu: Watchdog IB700 is not a PCI device (RHBZ#667091). · feddaf1d
      Richard W.M. Jones 提交于
      Skip IB700 when assigning PCI slots.
      
      Note: the I6300ESB watchdog _is_ a PCI device.
      
      To test this: I applied this patch to libvirt-0.8.3-2.fc14 (rebasing
      it slightly: qemu_command.c didn't exist in that version) and
      installed this on my machine, then tested that I could successfully
      add an ib700 watchdog device to a guest, start the guest, and the
      ib700 was available to the guest.  I also added an i6300esb (PCI)
      watchdog to another guest, and verified that libvirt assigned a PCI
      device to it, that the guest could be started, and that i6300esb was
      present in the guest.
      
      Note that if you previously had a domain with a ib700 watchdog, it
      would have had an <address type='pci' .../> clause added to it in the
      libvirt configuration.  This patch does not attempt to remove this.
      You cannot start such a domain -- qemu gives an error if you try.
      With this patch you are able to remove the bogus address element
      without libvirt adding it back.
      Signed-off-by: NRichard W.M. Jones <rjones@redhat.com>
      feddaf1d
    • D
      Refactor the security drivers to simplify usage · d6623003
      Daniel P. Berrange 提交于
      The current security driver usage requires horrible code like
      
          if (driver->securityDriver &&
              driver->securityDriver->domainSetSecurityHostdevLabel &&
              driver->securityDriver->domainSetSecurityHostdevLabel(driver->securityDriver,
                                                                    vm, hostdev) < 0)
      
      This pair of checks for NULL clutters up the code, making the driver
      calls 2 lines longer than they really need to be. The goal of the
      patchset is to change the calling convention to simply
      
        if (virSecurityManagerSetHostdevLabel(driver->securityDriver,
                                              vm, hostdev) < 0)
      
      The first check for 'driver->securityDriver' being NULL is removed
      by introducing a 'no op' security driver that will always be present
      if no real driver is enabled. This guarentees driver->securityDriver
      != NULL.
      
      The second check for 'driver->securityDriver->domainSetSecurityHostdevLabel'
      being non-NULL is hidden in a new abstraction called virSecurityManager.
      This separates the driver callbacks, from main internal API. The addition
      of a virSecurityManager object, that is separate from the virSecurityDriver
      struct also allows for security drivers to carry state / configuration
      information directly. Thus the DAC/Stack drivers from src/qemu which
      used to pull config from 'struct qemud_driver' can now be moved into
      the 'src/security' directory and store their config directly.
      
      * src/qemu/qemu_conf.h, src/qemu/qemu_driver.c: Update to
        use new virSecurityManager APIs
      * src/qemu/qemu_security_dac.c,  src/qemu/qemu_security_dac.h
        src/qemu/qemu_security_stacked.c, src/qemu/qemu_security_stacked.h:
        Move into src/security directory
      * src/security/security_stack.c, src/security/security_stack.h,
        src/security/security_dac.c, src/security/security_dac.h: Generic
        versions of previous QEMU specific drivers
      * src/security/security_apparmor.c, src/security/security_apparmor.h,
        src/security/security_driver.c, src/security/security_driver.h,
        src/security/security_selinux.c, src/security/security_selinux.h:
        Update to take virSecurityManagerPtr object as the first param
        in all callbacks
      * src/security/security_nop.c, src/security/security_nop.h: Stub
        implementation of all security driver APIs.
      * src/security/security_manager.h, src/security/security_manager.c:
        New internal API for invoking security drivers
      * src/libvirt.c: Add missing debug for security APIs
      d6623003
  7. 07 1月, 2011 2 次提交
  8. 24 12月, 2010 3 次提交
    • E
      qemu: add -incoming fd:n capability checking · abff0290
      Eric Blake 提交于
      * src/qemu/qemu_capabilities.h (QEMUD_CMD_FLAG_MIGRATE_QEMU_FD):
      New enum value.
      * src/qemu/qemu_capabilities.c (qemuCapsComputeCmdFlags): Populate
      flags according to qemu version.
      * tests/qemuhelptest.c (mymain): Adjust test.
      abff0290
    • L
      Change virtual network XML parsing/formatting to support IPv6 · a950dd2a
      Laine Stump 提交于
      This commit adds support for IPv6 parsing and formatting to the
      virtual network XML parser, including moving around data definitions
      to allow for multiple <ip> elements on a single network, but only
      changes the consumers of this API to accommodate for the changes in
      API/structure, not to add any actual IPv6 functionality. That will
      come in a later patch - this patch attempts to maintain the same final
      functionality in both drivers that use the network XML parser - vbox
      and "bridge" (the Linux bridge-based driver used by the qemu
      hypervisor driver).
      
      * src/libvirt_private.syms: Add new private API functions.
      * src/conf/network_conf.[ch]: Change C data structure and
        parsing/formatting.
      * src/network/bridge_driver.c: Update to use new parser/formatter.
      * src/vbox/vbox_tmpl.c: update to use new parser/formatter
      * docs/schemas/network.rng: changes to the schema -
        * there can now be more than one <ip> element.
        * ip address is now an ip-addr (ipv4 or ipv6) rather than ipv4-addr
        * new optional "prefix" attribute that can be used in place of "netmask"
        * new optional "family" attribute - "ipv4" or "ipv6"
          (will default to ipv4)
        * define data types for the above
      * tests/networkxml2xml(in|out)/nat-network.xml: add multiple <ip> elements
        (including IPv6) to a single network definition to verify they are being
        correctly parsed and formatted.
      a950dd2a
    • L
      make the <dhcp> element optional in network.rng · 008abeee
      Laine Stump 提交于
      In practice this has always been optional, but the RNG has shown it as
      mandatory, and since all the examples for make check had it, it was
      never noticed. One of the existing test cases has been changed to
      check for this.
      
      I also noticed that the dhcp/host/ip was still defined as <text/>,
      but should really be <ref name='ipv4-addr'/>
      008abeee
  9. 22 12月, 2010 2 次提交
    • M
      esx: Move VMX handling code out of the driver directory · 42b2f35d
      Matthias Bolte 提交于
      Now the VMware driver doesn't depend on the ESX driver anymore.
      
      Add a WITH_VMX option that depends on WITH_ESX and WITH_VMWARE.
      Also add a libvirt_vmx.syms file.
      
      Move some escaping functions from esx_util.c to vmx.c.
      
      Adapt the test suite, ESX and VMware driver to the new code layout.
      42b2f35d
    • E
      command: avoid hanging on daemon processes · c7f28dec
      Eric Blake 提交于
      * src/util/command.c (virCommandRun): Don't capture output on
      daemons.
      * tests/commandtest.c (test18): Expose the bug.
      Reported by Laine Stump.
      c7f28dec
  10. 21 12月, 2010 3 次提交
    • E
      tests: avoid spurious failure of nodeinfotest · bb11c553
      Eric Blake 提交于
      When running 'make check' under a multi-cpu Dom0 xen machine,
      nodeinfotest had a spurious failure it was reading from
      /sys/devices/system/cpu, but xen has no notion of topology.  The test
      was intended to be isolated from reading any real system files; the
      regression was introduced in Mar 2010 with commit aa2f6f96.
      
      Fix things by allowing an early exit for the testsuite.
      
      * src/nodeinfo.c (linuxNodeInfoCPUPopulate): Add parameter.
      (nodeGetInfo): Adjust caller.
      * tests/nodeinfotest.c (linuxTestCompareFiles): Likewise.
      bb11c553
    • E
      tests: avoid data race · 630fe36f
      Eric Blake 提交于
      I got some spurious failures when commandhelper won the race and
      ran to the point of parent detection prior to the intermediate
      daemonizing process getting a chance to exit.  This fixes it.
      
      * tests/commandhelper.c (main): Checking for re-parenting to
      init(1) is racy; instead check that we belong to a new session.
      630fe36f
    • E
      build: improve testsuite results with older automake · f0b834e7
      Eric Blake 提交于
      * tests/Makefile.am (TESTS_ENVIRONMENT, commandtest_CFLAGS)
      (commandhelper_CFLAGS): Avoid $(builddir) and $(abs_builddir) in
      automake 1.9.6; fixes spurious failures of commandtest.
      f0b834e7
  11. 18 12月, 2010 2 次提交
    • E
      maint: improve tests distribution · 65532f45
      Eric Blake 提交于
      * tests/Makefile.am (EXTRA_DIST): Sort, and add directories.
      (SUBDIRS): Drop automake recursion into subdirs.
      * tests/commanddata/Makefile.am: Delete.
      * tests/confdata/Makefile.am: Likewise.
      * tests/sexpr2xmldata/Makefile.am: Likewise.
      * tests/xencapsdata/Makefile.am: Likewise.
      * tests/xmconfigdata/Makefile.am: Likewise.
      * tests/xml2sexprdata/Makefile.am: Likewise.
      65532f45
    • D
      Update QEMU test cases for new file locations & API renames · 1d16f056
      Daniel P. Berrange 提交于
      * qemuargv2xmltest.c, qemuhelptest.c,
        qemuxml2argvtest.c, testutilsqemu.c: Update includes and
        cope with API renames
      1d16f056
  12. 14 12月, 2010 3 次提交
  13. 11 12月, 2010 1 次提交
    • E
      tests: plug memory leaks · 7d5e79ff
      Eric Blake 提交于
      * tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Don't
      allocate, since we don't use virDomainChrDefFree.
      7d5e79ff
  14. 10 12月, 2010 3 次提交
  15. 08 12月, 2010 6 次提交
  16. 07 12月, 2010 3 次提交
    • E
      smbios: allow () in smbios strings · a7666b9e
      Eric Blake 提交于
      * docs/schemas/domain.rng (sysinf-value): Expand pattern.
      * tests/qemuxml2argvdata/qemuxml2argv-smbios.xml: Prefer '' over
      "" for attribute values.  Copy real hardware values.
      * tests/qemuxml2argvdata/qemuxml2argv-smbios.args: Likewise.
      a7666b9e
    • E
      smbios: support system family · 8cad5603
      Eric Blake 提交于
      * docs/schemas/domain.rng (sysinfo-system-name): Also allow
      family.
      * src/util/sysinfo.h (struct _virSysinfoDef): Add system_family.
      * src/conf/domain_conf.c (virSysinfoParseXML)
      (virDomainSysinfoDefFormat): Support it.
      * src/util/sysinfo.c (virSysinfoDefFree, virSysinfoRead): Likewise.
      * src/qemu/qemu_conf.c (qemuBuildSmbiosSystemStr): Likewise.
      * tests/qemuxml2argvdata/qemuxml2argv-smbios.xml: Adjust test.
      * tests/qemuxml2argvdata/qemuxml2argv-smbios.args: Likewise.
      8cad5603
    • E
      qemu: avoid adding "" in smbios arguments · 575914cf
      Eric Blake 提交于
      The log lists things like -smbios type=1,vendor="Red Hat", which
      is great for shell parsing, but not so great when you realize that
      execve() then passes those literal "" on as part of the command
      line argument, such that qemu sets SMBIOS with extra literal quotes.
      
      The eventual addition of virCommand is needed before we have the API
      to shell-quote a string representation of a command line, so that the
      log can still be pasted into a shell, but without inserting extra
      bytes into the execve() arguments.
      
      * src/qemu/qemu_conf.c (qemuBuildSmbiosBiosStr)
      (qemuBuildSmbiosSystemStr): Qemu doesn't like quotes around uuid
      arguments, and the remaining quotes are passed literally to
      smbios, making <smbios mode='host'/> inaccurate.  Removing the
      quotes makes the log harder to parse, but that can be fixed later
      with virCommand improvements.
      * tests/qemuxml2argvdata/qemuxml2argv-smbios.args: 'Fix' test; it
      will need fixing again once virCommand learns how to shell-quote a
      potential command line.
      575914cf
  17. 06 12月, 2010 1 次提交
  18. 03 12月, 2010 2 次提交
    • E
      qemu: convert to virCommand · 6a7e7c4f
      Eric Blake 提交于
      * src/qemu/qemu_conf.c (qemudExtractVersionInfo): Check for file
      before executing it here, rather than in callers.
      (qemudBuildCommandLine): Rewrite with virCommand.
      * src/qemu/qemu_conf.h (qemudBuildCommandLine): Update signature.
      * src/qemu/qemu_driver.c (qemuAssignPCIAddresses)
      (qemudStartVMDaemon, qemuDomainXMLToNative): Adjust callers.
      6a7e7c4f
    • D
      Introduce new APIs for spawning processes · f16ad06f
      Daniel P. Berrange 提交于
      This introduces a new set of APIs in src/util/command.h
      to use for invoking commands. This is intended to replace
      all current usage of virRun and virExec variants, with a
      more flexible and less error prone API.
      
      * src/util/command.c: New file.
      * src/util/command.h: New header.
      * src/Makefile.am (UTIL_SOURCES): Build it.
      * src/libvirt_private.syms: Export symbols internally.
      * tests/commandtest.c: New test.
      * tests/Makefile.am (check_PROGRAMS): Run it.
      * tests/commandhelper.c: Auxiliary program.
      * tests/commanddata/test2.log - test15.log: New expected outputs.
      * cfg.mk (useless_free_options): Add virCommandFree.
      (msg_gen_function): Add virCommandError.
      * po/POTFILES.in: New translation.
      * .x-sc_avoid_write: Add exemption.
      * tests/.gitignore: Ignore new built file.
      f16ad06f