1. 17 8月, 2009 1 次提交
    • C
      Compressed save image format for Qemu. · 2d6a5819
      Chris Lalancette 提交于
      Implement a compressed save image format for qemu.  While ideally
      we would have the choice between compressed/non-compressed
      available to the libvirt API, unfortunately there is no "flags"
      parameter to the virDomainSave() API.  Therefore, implement this
      as a qemu.conf option.  gzip, bzip2, and lzma are implemented, and
      it should be very easy to implement additional compression
      methods.
      
      One open question is if/how we should detect the compression
      binaries.  One way to do it is to do compile-time setting of the
      paths (via configure.in), but that doesn't seem like a great thing
      to do.  My preferred solution is not to detect at all;
      when we go to run the commands that need them, if they
      aren't available, or aren't available in one of the standard paths,
      then we'll fail.  That's also the solution implemented in this patch.
      
      In the future, we'll have a more robust (managed) save/restore API,
      at which time we can expose this functionality properly in the API.
      
      V2: get rid of redundant dd command and just use >> to append data.
      V3: Add back the missing pieces for the enum and bumping the save version.
      V4: Make the compressed field in the save_header an int.
          Implement LZMA compression.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      2d6a5819
  2. 14 8月, 2009 9 次提交
    • D
      Remove 'the the' typo in docs · 444647d1
      Daniel P. Berrange 提交于
      444647d1
    • M
      Check active domain hostdevs before allowing PCI reset · c106c8a1
      Mark McLoughlin 提交于
      If a PCI device reset causes other devices to be reset, allow it so long
      as those other devices are note assigned to another active domain.
      
      Note, we need to take the driver lock qemudNodeDeviceReset() because the
      check function will iterate over the domain list.
      
      * src/qemu_conf.c: add qemuCheckPciHostDevice() to iterate over active
        domains checking whether the affected device is assigned
      
      * src/pci.[ch]: add pciDeviceEquals() helper
      c106c8a1
    • M
      Allow pciResetDevice() to reset multiple devices · 63188082
      Mark McLoughlin 提交于
      When using a Secondary Bus Reset, all devices on the bus are reset.
      
      Extend the pciResetDevice() API so that a 'check' callback can be
      supplied which will verify that it is safe to reset the other devices
      on the bus.
      
      The virDomainObjPtr parameter is needed so that when the check function
      iterates over the domain list, it can avoid double locking.
      
      * src/pci.[ch]: add a 'check' callback to pciResetDevice(), re-work
        pciIterDevices() to pass the check function to the iter functions,
        use the check function in the bus iterator, return the first unsafe
        device from pciBusCheckOtherDevices() and include its details in
        the bus reset error message.
      
      * src/qemu_driver.c, src/xen_uninified.c: just pass NULL as the
        check function for now
      63188082
    • M
      Improve PCI host device reset error message · ebea3418
      Mark McLoughlin 提交于
      Currently, if we are unable to reset a PCI device we return a fairly
      generic 'No PCI reset capability available' error message.
      
      Fix that by returning an error from the individual reset messages and
      using that error to construct the higher level error mesage.
      
      * src/pci.c: set errors in pciTryPowerManagementReset() and
        pciTrySecondaryBusReset() on failure; use those error messages
        in pciResetDevice(), or explain that no reset support is available
      ebea3418
    • M
      Reset and re-attach PCI host devices on guest shutdown · 4035152a
      Mark McLoughlin 提交于
      When the guest shuts down, we should attempt to restore all PCI host
      devices to a sane state.
      
      In the case of managed hostdevs, we should reset and re-attach the
      devices. In the case of unmanaged hostdevs, we should just reset them.
      
      Note, KVM will already reset assigned devices when the guest shuts
      down using whatever means it can, so we are only doing it to cover the
      cases the kernel can't handle.
      
      * src/qemu_driver.c: add qemuDomainReAttachHostDevices() and call
        it from qemudShutdownVMDaemon()
      4035152a
    • M
      Allow PM reset on multi-function PCI devices · 64a6682b
      Mark McLoughlin 提交于
      It turns out that a PCI Power Management reset only affects individual
      functions, and not the whole device.
      
      The PCI Power Management spec talks about resetting the 'device' rather
      than the 'function', but Intel's Dexuan Cui informs me that it is
      actually a per-function reset.
      
      Also, Yu Zhao has added pci_pm_reset() to the kernel, and it doesn't
      reject multi-function devices, so it must be true! :-)
      
      (A side issue is that we could defer the PM reset to the kernel if we
      could detect that the kernel has PM reset support, but barring version
      number checks we don't have a way to detect that support)
      
      * src/pci.c: remove the pciDeviceContainsOtherFunctions() check from
        pciTryPowerManagementReset() and prefer PM reset over bus reset
        where both are available
      
      Cc: Cui, Dexuan <dexuan.cui@intel.com>
      Cc: Yu Zhao <yu.zhao@intel.com>
      64a6682b
    • M
      Detect KVM's PCI device assignment support · d4528d9a
      Mark McLoughlin 提交于
      PCI device assignment is only supported in KVM's fork of qemu, so we
      should really detect its availability and give a nice error if its
      not supported.
      
      * src/qemu_conf.[ch]: introduce QEMUD_CMD_FLAG_PCIDEVICE indicating
        that the -pcidevice command line option is available
      
      * tests/*: update the tests
      d4528d9a
    • M
      Add host PCI device hotplug support · 0c5b7b93
      Mark McLoughlin 提交于
      Attaching a host PCI device to a qemu guest is done with a
      straightforward 'pci_add auto host host=XX:XX.X' command.
      
      Like with NIC and disk hotplug, we need to retain the guest PCI address
      assigned by qemu so that we can use it for hot-unplug.
      
      Identifying a device for detach is done using the host PCI address.
      
      Managed mode is handled by detaching/resetting the device before
      attaching it to the guest and re-attaching it after detaching it from
      the guest.
      
      * src/qemu_driver.c: add qemudDomainAttachHostPciDevice() and
        qemudDomainDetachHostPciDevice()
      
      * src/domain_conf.h: add somewhere to store the guest PCI address
      
      * src/domain_conf.c: handle formatting and parsing the guest PCI
        address
      0c5b7b93
    • M
      Re-factor hostdev hotplug · 7636ef46
      Mark McLoughlin 提交于
      Re-factor the hostdev hotplug code so that we can easily add PCI
      hostdev hotplug to qemudDomainAttachHostDevice().
      
      * src/qemu_driver.c: rename qemudDomainAttachHostDevice() to
        qemudDomainAttachHostUsbDevice(); make qemudDomainAttachHostDevice()
        handle all hostdev types
      
      * src/libvirt_private.syms: export a couple of hostdev related
        ToString() functions
      7636ef46
  3. 13 8月, 2009 1 次提交
    • D
      Make LXC / UML drivers robust against NUMA topology brokenness · 19bac57b
      Daniel P. Berrange 提交于
      Some kernel versions expose broken NUMA topology for some machines.
      This causes the LXC/UML drivers to fail to start. QEMU driver was
      already fixed for this problem
      
      * src/lxc_conf.c: Log and ignore failure to populate NUMA info
      * src/uml_conf.c: Log and ignore failure to populate NUMA info
      * src/capabilities.c: Reset nnumaCell to 0 after freeing
      19bac57b
  4. 11 8月, 2009 11 次提交
  5. 10 8月, 2009 3 次提交
    • M
      Handle kernels with no ipv6 support · f5a8f969
      Mark McLoughlin 提交于
      If the ipv6 kernel module is not loaded, then we get this when starting
      a virtual network:
      
        libvir: Network Config error :
        cannot enable /proc/sys/net/ipv6/conf/virbr0/disable_ipv6:
        No such file or directory
      
      If disable_ipv6 is not present, we should just merrily continue on our
      way.
      
      * src/network_driver.c: make networkDisableIPV6() not fail if the kernel
        has no ipv6 support
      f5a8f969
    • M
      Set perms on /var/lib/libvirt/boot to 0711 · f9bfa107
      Mark McLoughlin 提交于
      Allow qemu user to open kernel/initrds in this dir, but still prevent
      others from listing it.
      
      * libvirt.spec.in: set /var/lib/libvirt/boot perms to 0711
      f9bfa107
    • M
      chown kernel/initrd before spawning qemu · c42b3978
      Mark McLoughlin 提交于
      If we're running qemu unprivileged, we need to chown any supplied kernel
      or initrd before spawning it.
      
      * src/qemu_driver.c: rename qemuDomainSetDiskOwnership() to
        qemuDomainSetFileOwnership(), pass it a path string instead of a disk
        definition and use it for chowning the kernel/initrd in
        qemuDomainSetAllDeviceOwnership()
      c42b3978
  6. 07 8月, 2009 2 次提交
  7. 06 8月, 2009 8 次提交
    • A
      Update logging documentation · 7534be6f
      Amy Griffis 提交于
      * docs/logging.html[.in] try to include a little more description about
        the corner cases, things someone might get hung up on on.
      7534be6f
    • A
      Consolidate code for parsing the logging env · 63fbcc69
      Amy Griffis 提交于
      * src/logging.c src/logging.h src/libvirt_private.syms:
        define new functions virLogSetFromEnv and virLogParseDefaultPriority
      * qemud/qemud.c src/libvirt.c tests/eventtest.c: cleanup to use the
        unified functions
      63fbcc69
    • A
      Cleanup VIR_LOG_DEBUG parsing in eventtest · e542d52a
      Amy Griffis 提交于
      * tests/eventtest.c: don't covert high priority levels to debug level.
        Consider an invalid priority level setting a setup failure.
      e542d52a
    • A
      Several fixes to libvirtd's log setup · 9147bf2a
      Amy Griffis 提交于
      * qemud/qemud.c src/logging.[ch]: Similar as for general libvirt, don't
        convert high priority levels to debug level. Ignore LIBVIRT_LOG_FILTERS
        and LIBVIRT_LOG_OUTPUTS when they're set to the empty string, otherwise
        they can override a valid setting from the config file. Send all
        settings through the parser functions for validation, so that the
        existence of a bad setting doesn't nullify a good setting that should
        have applied -- particularly the default output. Keep the order of
        precedence consistent for all variables between the environment and
        the config file.  Warn when an invalid log level, filter, or output
        is ignored.
      * src/libvirt_private.syms: export internally a few convenience functions
      9147bf2a
    • A
      Tighten libvirt's parsing of logging env · 22a1ec68
      Amy Griffis 提交于
      * src/libvirt.c src/logging.c: Don't convert high priority levels to the
        debug level. Don't parse LIBVIRT_LOG_FILTERS and LIBVIRT_LOG_OUTPUTS
        when they're set to the empty string. Warn when the user specifies an
        invalid value (empty string remains a noop).
      * po/POTFILES.in: src/logging.c now include translatable strings
      22a1ec68
    • M
      Cleanup structure name naming · a9e96b1e
      Matthias Bolte 提交于
      * src/esx/esx_driver.c src/esx/esx_util.[ch] src/esx/esx_vi.[ch]:
        just a name change
      a9e96b1e
    • M
      Fix memleak if esxOpen fails · 5f48643e
      Matthias Bolte 提交于
      * src/esx/esx_driver.c: if esxOpen failed, priv->transport wasn't freed
      5f48643e
    • M
      Add proper OOM reporting for esxDomainGetOSType · a7c76142
      Matthias Bolte 提交于
      * src/esx/esx_driver.c: catch an unchecked strdup in
        esxDomainGetOSType()
      a7c76142
  8. 05 8月, 2009 5 次提交