1. 08 12月, 2009 1 次提交
  2. 13 11月, 2009 1 次提交
  3. 12 11月, 2009 2 次提交
  4. 11 11月, 2009 2 次提交
    • D
      Implmentation of new APIs to checking state/persistence of objects · cabc2cc9
      Daniel P. Berrange 提交于
      This implements the virConnectIsSecure, virConnectIsEncrypted,
      virDomainIsPersistent, virDomainIsActive, virNetworkIsActive,
      virNetworkIsPersistent, virStoragePoolIsActive,
      virStoragePoolIsPersistent, virInterfaceIsActive APIs in
      (nearly) all drivers. Exceptions are:
      
       phyp: missing domainIsActive/Persistent
       esx: missing domainIsPersistent
       opennebula: missing domainIsActive/Persistent
      
      * src/remote/remote_protocol.x: Define remote wire ABI for newly
        added APIs.
      * daemon/remote_dispatch*.h: Re-generated from remote_protocol.x
      * src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/network/bridge_driver.c,
        src/opennebula/one_driver.c, src/openvz/openvz_conf.c,
        src/openvz/openvz_driver.c, src/phyp/phyp_driver.c,
        src/remote/remote_driver.c, src/storage/storage_driver.c,
        src/test/test_driver.c, src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
        src/xen/xen_driver.c, src/xen/xen_driver.h, src/xen/xen_inotify.c,
        src/xen/xen_inotify.h: Implement all the new APIs where possible
      cabc2cc9
    • D
      New APIs for checking some object properties · c04498b3
      Daniel P. Berrange 提交于
      Introduce a number of new APIs to  expose some boolean properties
      of objects, which cannot otherwise reliably determined, nor are
      aspects of the XML configuration.
      
       * virDomainIsActive: Checking virDomainGetID is not reliable
         since it is not possible to distinguish between error condition
         and inactive domain for ID of -1.
       * virDomainIsPersistent: Check whether a persistent config exists
         for the domain
      
       * virNetworkIsActive: Check whether the network is active
       * virNetworkIsPersistent: Check whether a persistent config exists
         for the network
      
       * virStoragePoolIsActive: Check whether the storage pool is active
       * virStoragePoolIsPersistent: Check whether a persistent config exists
         for the storage pool
      
       * virInterfaceIsActive: Check whether the host interface is active
      
       * virConnectIsSecure: whether the communication channel to the
         hypervisor is secure
       * virConnectIsEncrypted: whether any network based commnunication
         channels are encrypted
      
      NB, a channel can be secure, even if not encrypted, eg if it does
      not involve the network, like a UNIX socket, or pipe.
      
       * include/libvirt/libvirt.h.in: Define public API
       * src/driver.h: Define internal driver API
       * src/libvirt.c: Implement public API entry point
       * src/libvirt_public.syms: Export API symbols
       * src/esx/esx_driver.c, src/lxc/lxc_driver.c,
         src/interface/netcf_driver.c, src/network/bridge_driver.c,
         src/opennebula/one_driver.c, src/openvz/openvz_driver.c,
         src/phyp/phyp_driver.c, src/qemu/qemu_driver.c,
         src/remote/remote_driver.c, src/test/test_driver.c,
         src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
         src/xen/xen_driver.c: Stub out driver tables
      c04498b3
  5. 10 11月, 2009 1 次提交
  6. 06 11月, 2009 1 次提交
  7. 05 11月, 2009 3 次提交
  8. 04 11月, 2009 1 次提交
    • C
      Improve error reporting for virConnectGetHostname calls · 517761fd
      Cole Robinson 提交于
      All drivers have copy + pasted inadequate error reporting which wraps
      util.c:virGetHostname. Move all error reporting to this function, and improve
      what we report.
      
      Changes from v1:
        Drop the driver wrappers around virGetHostname. This means we still need
        to keep the new conn argument to virGetHostname, but I think it's worth
        it.
      517761fd
  9. 03 11月, 2009 4 次提交
    • C
      Fix up NLS warnings. · 991be604
      Chris Lalancette 提交于
      When building with --disable-nls, I got a few messages like this:
      
      storage/storage_backend.c: In function 'virStorageBackendCreateQemuImg':
      storage/storage_backend.c:571: warning: format not a string literal and no format arguments
      
      Fix these up.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      991be604
    • D
      Fix return value in virStateInitialize impl for LXC · 979218cd
      Daniel P. Berrange 提交于
      The LXC driver was mistakenly returning -1 for lxcStartup()
      in scenarios that are not an error. This caused the libvirtd
      to quit for unprivileged users. This fixes the return code
      of LXC driver, and also adds a "name" field to the virStateDriver
      struct and logging to make it easier to find these problems
      in the future
      
      * src/driver.h: Add a 'name' field to state driver to allow
        easy identification during failures
      * src/libvirt.c: Log name of failed driver for virStateInit
        failures
      * src/lxc/lxc_driver.c: Don't return a failure code for
        lxcStartup() if LXC is not available on this host, simply
        disable the driver.
      * src/network/bridge_driver.c, src/node_device/node_device_devkit.c,
        src/node_device/node_device_hal.c, src/opennebula/one_driver.c,
        src/qemu/qemu_driver.c, src/remote/remote_driver.c,
        src/secret/secret_driver.c, src/storage/storage_driver.c,
        src/uml/uml_driver.c, src/xen/xen_driver.c: Fill in name
        field in virStateDriver struct
      979218cd
    • D
      Rename internal APis · fc8d1991
      Daniel P. Berrange 提交于
      Rename virDomainIsActive to virDomainObjIsActive, and
      virInterfaceIsActive to virInterfaceObjIsActive and finally
      virNetworkIsActive to virNetworkObjIsActive.
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h,
        src/conf/interface_conf.h, src/conf/network_conf.c,
        src/conf/network_conf.h, src/lxc/lxc_driver.c,
        src/network/bridge_driver.c, src/opennebula/one_driver.c,
        src/openvz/openvz_driver.c, src/qemu/qemu_driver.c,
        src/test/test_driver.c, src/uml/uml_driver.c: Update for
        renamed APIs.
      fc8d1991
    • D
      Allow for a driver specific private data blob in virDomainObjPtr · 3505790b
      Daniel P. Berrange 提交于
      The virDomainObjPtr object stores state about a running domain.
      This object is shared across all drivers so it is not appropriate
      to include driver specific state here. This patch adds the ability
      to request a blob of private data per domain object instance. The
      driver must provide a allocator & deallocator for this purpose
      
      THis patch abuses the virCapabilitiesPtr structure for storing the
      allocator/deallocator callbacks, since it is already being abused
      for other internal things relating to parsing. This should be moved
      out into a separate object at some point.
      
      * src/conf/capabilities.h: Add privateDataAllocFunc and
        privateDataFreeFunc fields
      * src/conf/domain_conf.c: Invoke the driver allocators / deallocators
        when creating/freeing virDomainObjPtr instances.
      * src/conf/domain_conf.h: Pass virCapsPtr into virDomainAssignDef
        to allow access to the driver specific allocator function
      * src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
        src/openvz/openvz_driver.c, src/qemu/qemu_driver.c,
        src/test/test_driver.c, src/uml/uml_driver.c: Update for
        change in virDomainAssignDef contract
      3505790b
  10. 29 10月, 2009 1 次提交
    • D
      Convert virDomainObjListPtr to use a hash of domain objects · a3adcce7
      Daniel P. Berrange 提交于
      The current virDomainObjListPtr object stores domain objects in
      an array. This means that to find a particular objects requires
      O(n) time, and more critically acquiring O(n) mutex locks.
      
      The new impl replaces the array with a virHashTable, keyed off
      UUID. Finding a object based on UUID is now O(1) time, and only
      requires a single mutex lock. Finding by name/id is unchanged
      in complexity.
      
      In changing this, all code which iterates over the array had
      to be updated to use a hash table iterator function callback.
      Several of the functions which were identically duplicating
      across all drivers were pulled into domain_conf.c
      
      * src/conf/domain_conf.h, src/conf/domain_conf.c: Change
        virDomainObjListPtr to use virHashTable. Add a initializer
        method virDomainObjListInit, and rename virDomainObjListFree
        to virDomainObjListDeinit, since its not actually freeing
        the container, only its contents. Also add some convenient
        methods virDomainObjListGetInactiveNames,
        virDomainObjListGetActiveIDs and virDomainObjListNumOfDomains
        which can be used to implement the correspondingly named
        public API entry points in drivers
      * src/libvirt_private.syms: Export new methods from domain_conf.h
      * src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
        src/openvz/openvz_conf.c, src/openvz/openvz_driver.c,
        src/qemu/qemu_driver.c, src/test/test_driver.c,
        src/uml/uml_driver.c, src/vbox/vbox_tmpl.c: Update all code
        to deal with hash tables instead of arrays for domains
      a3adcce7
  11. 21 10月, 2009 1 次提交
    • R
      LXC implement missing macaddr assignment feature · e8fc4cbb
      Ryota Ozaki 提交于
      Currently MAC address configuration of container veth is just ignored.
      This patch implements the missing feature.
      
      * src/lxc/veth.c, src/lxc/veth.h: add setMacAddr
      * src/lxc/lxc_driver.c: set macaddr of container veth if specified
      e8fc4cbb
  12. 14 10月, 2009 1 次提交
  13. 13 10月, 2009 1 次提交
  14. 08 10月, 2009 3 次提交
    • A
      LXC add driver config file lxc.conf · 2dd44664
      Amy Griffis 提交于
      * src/lxc/lxc.conf: new configuration file, there is currently one
        tunable "log_with_libvirtd" that controls whether an lxc controller will
        log only to the container log file, or whether it will honor libvirtd's
        log output configuration. This provides a way to have libvirtd and its
        children log to a single file.  The default is to log to the container
        log file.
      * src/Makefile.am libvirt.spec.in: add the new file
      * src/lxc/lxc_conf.[ch] src/lxc/lxc_driver.c: read the new log value
        from the configuration file and pass the log informations when
        starting up a container.
      2dd44664
    • A
      LXC do not truncate container log files on restart · c73a0c4a
      Amy Griffis 提交于
      * src/lxc/lxc_driver.c: use O_APPEND instead of O_TRUNC when opening
        the log file on lxcVmStart()
      c73a0c4a
    • A
      LXC initialize logging configuration · 221b457e
      Amy Griffis 提交于
      * src/lxc/lxc_driver.c src/lxc/lxc_controller.c: before launching the
        lxc controller, have the lxc driver query the log settings and setup
        envp[]. This provides the advantage of honoring the actual log
        configuration instead of only what had been set in the environment.
        The lxc controller now simply has to call virLogSetFromEnv().
      221b457e
  15. 07 10月, 2009 1 次提交
    • R
      LXC implement memory control APIs · 3a05dc09
      Ryota Ozaki 提交于
      The patch implements the missing memory control APIs for lxc, i.e.,
      domainGetMaxMemory, domainSetMaxMemory, domainSetMemory, and improves
      domainGetInfo to return proper amount of used memory via cgroup.
      
      * src/libvirt_private.syms: Export virCgroupGetMemoryUsage
        and add missing virCgroupSetMemory
      * src/lxc/lxc_driver.c: Implement missing memory functions
      * src/util/cgroup.c, src/util/cgroup.h: Add the function
        to get used memory
      3a05dc09
  16. 02 10月, 2009 1 次提交
  17. 23 9月, 2009 1 次提交
    • C
      Introduce virStrncpy. · 03d777f3
      Chris Lalancette 提交于
      Add the virStrncpy function, which takes a dst string, source string,
      the number of bytes to copy and the number of bytes available in the
      dest string.  If the source string is too large to fit into the
      destination string, including the \0 byte, then no data is copied and
      the function returns NULL.  Otherwise, this function copies n bytes
      from source into dst, including the \0, and returns a pointer to the
      dst string.  This function is intended to replace all unsafe uses
      of strncpy in the code base, since strncpy does *not* guarantee that
      the buffer terminates with a \0.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      03d777f3
  18. 22 9月, 2009 2 次提交
  19. 21 9月, 2009 1 次提交
    • D
      Move LXC driver into src/lxc/ · c93125b1
      Daniel P. Berrange 提交于
      * src/lxc_conf.c, src/lxc_conf.h, src/lxc_container.c,
        src/lxc_container.h, src/lxc_controller.c, src/lxc_driver.c,
        src/lxc_driver.h, src/veth.c, src/veth.h: Move to src/lxc/
      * src/opennebula/one_driver.c: Remove bogus veth.h include
      * src/Makefile.am: Adjust for lxc paths
      * daemon/qemud.c: Adjust include for lxc
      c93125b1
  20. 10 9月, 2009 1 次提交
    • D
      Fix misc thread locking bugs / bogus warnings · 5c8d3d3b
      Daniel P. Berrange 提交于
      Fix all thread locking bugs reported by object-locking test
      case.
      
      NB, some of the driver locking is getting too coarse. Driver
      mutexes really need to be turned into RW locks instead to
      significantly increase concurrency.
      
      * src/lxc_driver.c: Fix useof driver when unlocked in the methods
        lxcDomainGetInfo, lxcSetSchedulerParameters, and
        lxcGetSchedulerParameters
      * src/opennebula/one_driver.c: Fix missing unlock in oneDomainUndefine.
        Fix use of driver when unlocked in oneDomainGetInfo,
        oneGetOSType, oneDomainShutdown
      * src/qemu_driver.c: Fix use of driver when unlocked in
        qemudDomainSavem, qemuGetSchedulerType, qemuSetSchedulerParameters
        and qemuGetSchedulerParameters
      * src/storage_driver.c: Re-work storagePoolCreate to avoid bogus
        lock checking warning. Re-work storageVolumeCreateXMLFrom to
        remove a potential NULL de-reference & avoid bogus lock check
        warnings
      * src/test.c: Remove testDomainAssignDef since it break lock chekc
        warnings.
      * tests/object-locking.ml: Add oneDriverLock, oneDriverUnlock
        and one_driver_t methods/types to allow lock checking on the
         OpenNebula drivers
      5c8d3d3b
  21. 17 8月, 2009 1 次提交
    • D
      Fix LXC driver crash when kernel doesn't support clone · e403f8d4
      Daniel P. Berrange 提交于
      * src/domain_conf.c: Make virDomainObjListFree a no-op if list
        is NULL
      * src/domain_event.c: make virDomainEventCallbackListFree a no-op
        if event list is NULL
      * src/lxc_driver.c: Log a message if LXC driver does not startup
        due to lacking kernel support
      e403f8d4
  22. 05 8月, 2009 2 次提交
  23. 24 7月, 2009 3 次提交
    • D
      Implement schedular tunables API using cgroups · 55bc5090
      Daniel P. Berrange 提交于
      * src/qemu_driver.c:  Add driver methods qemuGetSchedulerType,
        qemuGetSchedulerParameters, qemuSetSchedulerParameters
      * src/lxc_driver.c: Fix to use unsigned long long consistently
        for schedular parameters
      * src/cgroup.h, src/cgroup.c: Fix cpu_shares to take unsigned
        long long
      * src/util.c, src/util.h, src/libvirt_private.syms: Add a
        virStrToDouble helper
      * src/virsh.c: Fix handling of --set arg to schedinfo command
        to honour the designated data type of each schedular tunable
        as declared by the driver
      55bc5090
    • D
      Refactor cgroups to allow a group per driver to be managed directly · 946c489c
      Daniel P. Berrange 提交于
      Allow the driver level cgroup to be managed explicitly by the
      hypervisor drivers, in order to detect whether to enable or
      disable cgroup support for domains. Provides better error
      reporting of failures. Also allow for creation of cgroups for
      unprivileged drivers if controller is accessible by the user.
      
      * src/cgroup.c, src/cgroup.h: Add an API to obtain a driver cgroup
      * src/lxc_conf.h, src/lxc_controller.c, src/lxc_driver.c:
        Obtain a driver cgroup at startup and use that instead of
        re-creating everytime.
      * src/util.c, src/util.h, src/libvirt_private.syms: Add a
        virGetUserName() helper
      946c489c
    • L
      Add bare format string to printf-derivatives troubles · 165ed4a0
      Laine Stump 提交于
      * src/datatypes.c src/domain_conf.c src/interface_conf.c
        src/lxc_driver.c src/qemu_driver.c src/storage_backend.c src/virsh.c:
        add bare %s format string to printf-derivatives called with no format
        string
      165ed4a0
  24. 23 7月, 2009 2 次提交
  25. 16 6月, 2009 1 次提交
  26. 12 6月, 2009 1 次提交