1. 08 12月, 2009 1 次提交
    • D
      Introduce callbacks for serializing domain object private data to XML · c5358c0e
      Daniel P. Berrange 提交于
      Now that drivers are using a private domain object state blob,
      the virDomainObjFormat/Parse methods are no longer able to
      directly serialize all neccessary state to/from XML. It is
      thus neccessary to introduce a pair of callbacks fo serializing
      private state.
      
      The code for serializing vCPU PIDs and the monitor device
      config can now move out of domain_conf.c and into the
      qemu_driver.c where they belong.
      
      * src/conf/capabilities.h: Add callbacks for serializing private
        state to/from XML
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Remove the
        monitor, monitor_chr, monitorWatch, nvcpupids and vcpupids
        fields from virDomainObjPtr. Remove code that serialized
        those fields
      * src/libvirt_private.syms: Export virXPathBoolean
      * src/qemu/qemu_driver.c: Add callbacks for serializing monitor
        and vcpupid data to/from XML
      * src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Pass monitor
        char device config into qemuMonitorOpen directly.
      c5358c0e
  2. 07 12月, 2009 1 次提交
    • D
      Introduce a simple API for handling JSON data · 9428f2ce
      Daniel P. Berrange 提交于
      This introduces simple API for handling JSON data. There is
      an internal data structure 'virJSONValuePtr' which stores a
      arbitrary nested JSON value (number, string, array, object,
      nul, etc).  There are APIs for constructing/querying objects
      and APIs for parsing/formatting string formatted JSON data.
      
      This uses the YAJL library for parsing/formatting from
      
       http://lloyd.github.com/yajl/
      
      * src/util/json.h, src/util/json.c: Data structures and APIs
        for representing JSON data, and parsing/formatting it
      * configure.in: Add check for yajl library
      * libvirt.spec.in: Add build requires for yajl
      * src/Makefile.am: Add json.c/h
      * src/libvirt_private.syms: Export JSON symbols to drivers
      9428f2ce
  3. 05 12月, 2009 1 次提交
  4. 27 11月, 2009 1 次提交
  5. 23 11月, 2009 1 次提交
    • D
      Pull schedular affinity code out into a separate module · 37f415da
      Daniel P. Berrange 提交于
      * src/Makefile.am: Add processinfo.h/processinfo.c
      * src/util/processinfo.c, src/util/processinfo.h: Module providing
        APIs for getting/setting process CPU affinity
      * src/qemu/qemu_driver.c: Switch over to new APIs for schedular
        affinity
      * src/libvirt_private.syms: Export virProcessInfoSetAffinity
        and virProcessInfoGetAffinity to internal drivers
      37f415da
  6. 13 11月, 2009 1 次提交
    • D
      Implement a node device backend using libudev · 3ad6dcf3
      David Allan 提交于
      * configure.in: add new --with-udev, disabled by default, and requiring
        libudev > 145
      * src/node_device/node_device_udev.c src/node_device/node_device_udev.h:
        the new node device backend
      * src/node_device/node_device_linux_sysfs.c: moved node_device_hal_linux.c
        to a better file name
      * src/conf/node_device_conf.c src/conf/node_device_conf.h: add a couple
        of fields in node device definitions, and an API to look them up,
        remove a couple of unused fields from previous patch.
      * src/node_device/node_device_driver.c src/node_device/node_device_driver.h:
        plug the new driver
      * po/POTFILES.in src/Makefile.am src/libvirt_private.syms: add the new
        files and symbols
      * src/util/util.h src/util/util.c: add a new convenience macro
        virBuildPath and virBuildPathInternal() function
      3ad6dcf3
  7. 10 11月, 2009 3 次提交
    • D
      Add reference counting on virDomainObjPtr objects · a340f913
      Daniel P. Berrange 提交于
      Add reference counting on the virDomainObjPtr objects. With the
      forthcoming asynchronous QEMU monitor, it will be neccessary to
      release the lock on virDomainObjPtr while waiting for a monitor
      command response. It is neccessary to ensure one thread can't
      delete a virDomainObjPtr while another is waiting. By introducing
      reference counting threads can make sure objects they are using
      are not accidentally deleted while unlocked.
      
      * src/conf/domain_conf.h, src/conf/domain_conf.c: Add
        virDomainObjRef/Unref APIs, remove virDomainObjFree
      * src/openvz/openvz_conf.c: replace call to virDomainObjFree
        with virDomainObjUnref
      a340f913
    • D
      Add a new timed condition variable wait API · e40438fa
      Daniel P. Berrange 提交于
      * src/util/threads.h, src/util/threads-pthread.c,
        src/libvirt_private.syms: Add virCondWaitUntil()
      e40438fa
    • D
      Make pciDeviceList struct opaque · dd9e9c3b
      Daniel P. Berrange 提交于
      * src/util/pci.c, src/util/pci.h: Make the pciDeviceList struct
        opaque to callers of the API. Add accessor methods for managing
        devices in the list
      * src/qemu/qemu_driver.c: Update to use APIs instead of directly
        accessing pciDeviceList fields
      dd9e9c3b
  8. 09 11月, 2009 1 次提交
    • G
      Removes the ebtablesSaveRules() function · df4c57ae
      Gerhard Stenzel 提交于
      As it was basically unimplemented and more confusing than useful
      at the moment.
      * src/libvirt_private.syms: remove from internal symbols list
      * src/qemu/qemu_bridge_filter.c src/util/ebtables.c: remove code and
        one use of the unimplemented function
      df4c57ae
  9. 06 11月, 2009 1 次提交
  10. 04 11月, 2009 1 次提交
    • G
      New ebtables module wrapper · 1fc3816d
      Gerhard Stenzel 提交于
      * configure.in: look for ebtables binary location if present
      * src/Makefile.am: add the new module
      * src/util/ebtables.[ch]: new module and internal APIs around
        the ebtables binary
      * src/libvirt_private.syms: export the symbols only internally
      1fc3816d
  11. 02 11月, 2009 1 次提交
    • M
      More network utility functions · c3cc4f8b
      Matthew Booth 提交于
      * src/util/network.[ch] Add functions for address->text and get/set
        port number
      * src/libvirt_private.syms: add new entry points
      c3cc4f8b
  12. 30 10月, 2009 1 次提交
  13. 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
  14. 28 10月, 2009 2 次提交
  15. 21 10月, 2009 2 次提交
  16. 08 10月, 2009 2 次提交
    • A
      Add accessors for logging filters and outputs · 01e0e98f
      Amy Griffis 提交于
      When configuring logging settings, keep more information about the
      output destination. Add accessors to retrieve the filter and output
      settings in the original string form; this to be used to set up
      environment for a child process that also logs.
      
      * src/util/logging.[ch]: add virLogGetFilters and virLogGetOutputs
        accessors and modify the internals (including virLogDefineOutput())
        to save the data needed for the accessors
      01e0e98f
    • A
      Add virFileAbsPath() utility · 2e812c89
      Amy Griffis 提交于
      * src/util/util.[ch]: Add virFileAbsPath() function to ensure an
        absolute path for a potentially realtive path.
      * src/libvirt_private.syms: add it in libvirt private symbols
      2e812c89
  17. 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
  18. 06 10月, 2009 1 次提交
  19. 02 10月, 2009 1 次提交
  20. 30 9月, 2009 3 次提交
    • M
      Add virStorageFileGetMetadata() helper · 295fd6e8
      Mark McLoughlin 提交于
      * src/util/storage_file.c: add virStorageFileGetMetadata() so that
        the caller does not need to open the file
      295fd6e8
    • M
      Move virStorageGetMetadataFromFD() to libvirt_util · a010fb58
      Mark McLoughlin 提交于
      Finally, we get to the point of all this.
      
      Move virStorageGetMetadataFromFD() to virStorageFileGetMetadataFromFD()
      and move to src/util/storage_file.[ch]
      
      There's no functional changes in this patch, just code movement
      
      * src/storage/storage_backend_fs.c: move code from here ...
      
      * src/util/storage_file.[ch]: ... to here
      
      * src/libvirt_private.syms: export virStorageFileGetMetadataFromFD()
      a010fb58
    • M
      Move file format enum to libvirt_util · 00fd3ff4
      Mark McLoughlin 提交于
      Rename virStorageVolFormatFileSystem to virStorageFileFormat and
      move to src/util/storage_file.[ch]
      
      * src/Makefile.am: add src/util/storage_file.[ch]
      
      * src/conf/storage_conf.[ch]: move enum from here ...
      
      * src/util/storage_file.[ch]: .. to here
      
      * src/libvirt_private.syms: update To/FromString exports
      
      * src/storage/storage_backend.c, src/storage/storage_backend_fs.c,
        src/vbox/vbox_tmpl.c: update for above changes
      00fd3ff4
  21. 29 9月, 2009 2 次提交
    • D
      Add public API definition for data stream handling · 182eba1b
      Daniel P. Berrange 提交于
      * include/libvirt/libvirt.h.in: Public API contract for
        virStreamPtr object
      * src/libvirt_public.syms: Export data stream APIs
      * src/libvirt_private.syms: Export internal helper APIs
      * src/libvirt.c: Data stream API driver dispatch
      * src/datatypes.h, src/datatypes.c: Internal helpers for virStreamPtr
        object
      * src/driver.h: Define internal driver API for streams
      * .x-sc_avoid_write: Ignore src/libvirt.c because it trips
        up on comments including write()
      * python/Makefile.am: Add libvirt-override-virStream.py
      * python/generator.py: Add rules for virStreamPtr class
      * python/typewrappers.h, python/typewrappers.c: Wrapper
        for virStreamPtr
      * docs/libvirt-api.xml, docs/libvirt-refs.xml: Regenerate
        with new APIs
      182eba1b
    • D
      Add API for issuing 'migrate' command with exec protocol · ed2a10a1
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
        qemuMonitorMigrateToCommand() API
      * src/qemu/qemu_driver.c: Switch over to using the
        qemuMonitorMigrateToCommand() API for core dumps and save
        to file APIs
      ed2a10a1
  22. 22 9月, 2009 1 次提交
    • R
      lxc: suspend/resume support · c8c9ef27
      Ryota Ozaki 提交于
      * src/conf/domain_conf.c: Don't assume all virDomainObjPtr have
        a non-NULL monitor_chr field in virDomainObjFormat.
      * src/lxc/lxc_driver.c: Implement suspend/resume driver APis
      * src/util/cgroup.c, src/util/cgroup.h: Support the 'freezer'
        cgroup controller
      * src/libvirt_private.syms: Export virCgroupSetFreezerState
        and virCgroupGetFreezerState
      c8c9ef27
  23. 21 9月, 2009 1 次提交
    • D
      Move all shared utility files to src/util/ · 1355e055
      Daniel P. Berrange 提交于
      * src/bridge.c, src/bridge.h, src/buf.c, src/buf.h, src/cgroup.c,
        src/cgroup.h, src/conf.c, src/conf.h, src/event.c, src/event.h,
        src/hash.c, src/hash.h, src/hostusb.c, src/hostusb.h,
        src/iptables.c, src/iptables.h, src/logging.c, src/logging.h,
        src/memory.c, src/memory.h, src/pci.c, src/pci.h, src/qparams.c,
        src/qparams.h, src/stats_linux.c, src/stats_linux.h,
        src/threads-pthread.c, src/threads-pthread.h, src/threads-win32.c,
        src/threads-win32.h, src/threads.c, src/threads.h, src/util.c,
        src/util.h, src/uuid.c, src/uuid.h, src/virterror.c,
        src/virterror_internal.h, src/xml.c, src/xml.h: Move all files
        into src/util/
      * daemon/Makefile.am: Add -Isrc/util/ to build flags
      * src/Makefile.am: Add -Isrc/util/ to build flags and update for
        moved files
      * src/libvirt_private.syms: Export cgroup APIs since they're now
        in util rather than linking directly to drivers
      * src/xen/xs_internal.c: Disable bogus virEventRemoveHandle call
        when built under PROXY
      * proxy/Makefile.am: Update for changed file locations. Remove
        bogus build of event.c
      * tools/Makefile.am, tests/Makefile.am: Add -Isrc/util/ to build flags
      1355e055
  24. 15 9月, 2009 1 次提交
  25. 11 9月, 2009 3 次提交
    • M
      Provide missing passphrase when creating a volume. · cd6a9334
      Miloslav Trmač 提交于
      If the <encryption format='qcow'> element does not specify a secret
      during volume creation, generate a suitable secret and add it to the
      <encryption> tag.  The caller can view the updated <encryption> tag
      using virStorageVolGetXMLDesc().
      
      Similarly, when <encryption format='default'/> is specified while
      creating a qcow or qcow2-formatted volume, change the format to "qcow"
      and generate a secret as described above.
      
      * src/storage_encryption_conf.h (VIR_STORAGE_QCOW_PASSPHRASE_SIZE,
        virStorageGenerateQcowPasphrase),
        src/storage_encryption_conf.c (virStorageGenerateQcowPasphrase),
        src/libvirt_private.syms: Add virStorageGenerateQcowPasphrase().
      * src/storage_backend.c (virStoragegenerateQcowEncryption,
        virStorageBackendCreateQemuImg): Generate a passphrase and
        <encryption> when creating a qcow-formatted encrypted volume and the
        user did not supply the information.
      cd6a9334
    • M
      Local file implementation of secret driver API · 03d33860
      Miloslav Trmač 提交于
      This implementation stores the secrets in an unencrypted text file,
      for simplicity in implementation and debugging.
      
      (Symmetric encryption, e.g. using gpgme, will not be difficult to add.
      Because the TLS private key used by libvirtd is stored unencrypted,
      encrypting the secrets file does not currently provide much additional
      security.)
      
      * include/libvirt/virterror.h, src/virterror.c (VIR_ERR_NO_SECRET): New
        error number.
      * po/POTFILES.in, src/Makefile.am: Add secret_driver.
      * bootstrap: Use gnulib's base64 module.
      * src/secret_driver.c, src.secret_driver.h, src/libvirt_private.syms:
        Add local secret driver.
      * qemud/qemud.c (qemudInitialize): Use the local secret driver.
      03d33860
    • M
      Add an internal <secret> XML handling API · b9a8bef4
      Miloslav Trmač 提交于
      Add a <secret> XML handling API, separate from the local driver, to
      avoid manually generating XML in other parts of libvirt.
      
      * src/secret_conf.c, src/secret_conf.h: New files.
      * po/POTFILES.in, src/Makefile.am: Add secret_conf.
      b9a8bef4
  26. 10 9月, 2009 3 次提交
    • D
      Fix use of dlopen modules · fcd4e269
      Daniel P. Berrange 提交于
      Remove the bogus dependancy between node_device.c & storage_backend.c
      by moving the virWaitForDevices into util.h where it can be shared
      safely
      
      * src/storage_backend_disk.c, src/storage_backend_logical.c,
        src/storage_backend_mpath.c, src/storage_backend_scsi.c: Replace
        virStorageBackendWaitForDevices with virFileWaitForDevices
      * src/storage_backend.c, src/storage_backend.h: Remove
        virStorageBackendWaitForDevices, virWaitForDevices
      * src/util.h, src/util.c: Add virFileWaitForDevices
      * configure.in: Move xmlrpc check further down after pkgconfig
        is detected
      * src/Makefile.am: Add missing XMLRPC_CFLAGS/LIBS to opennebula
      * src/libvirt_private.syms: Add many missing exports
      fcd4e269
    • D
      Add helper APIs for iterating over PCI device resource files · ec31cd76
      Daniel P. Berrange 提交于
      * src/pci.h, src/pci.c: Helper for iterating over PCI device
        resource files
      * src/libvirt_private.syms: Export pciDeviceFileIterate
      ec31cd76
    • D
      Add helper module for dealing with USB host devices · 1e060bf2
      Daniel P. Berrange 提交于
      * src/Makefile.am: Add usb.h and usb.h to libvirt_util.la
      * src/libvirt_private.syms: Export symbols
      * src/usb.c, src/usb.h: Helper APIs for USB host devices
      1e060bf2
  27. 08 9月, 2009 1 次提交
  28. 03 9月, 2009 1 次提交
    • D
      Support configuration of huge pages in guests · d823a05a
      Daniel P. Berrange 提交于
      Add option to domain XML for
      
           <memoryBacking>
              <hugepages/>
           </memoryBacking>
      
      * configure.in: Add check for mntent.h
      * qemud/libvirtd_qemu.aug, qemud/test_libvirtd_qemu.aug, src/qemu.conf
        Add 'hugetlbfs_mount' config parameter
      * src/qemu_conf.c, src/qemu_conf.h: Check for -mem-path flag in QEMU,
        and pass it when hugepages are requested.
        Load hugetlbfs_mount config parameter, search for mount if not given.
      * src/qemu_driver.c: Free hugetlbfs_mount/path parameter in driver shutdown.
        Create directory for QEMU hugepage usage, chowning if required.
      * docs/formatdomain.html.in: Document memoryBacking/hugepages elements
      * docs/schemas/domain.rng: Add memoryBacking/hugepages elements to schema
      * src/util.c, src/util.h, src/libvirt_private.syms: Add virFileFindMountPoint
        helper API
      * tests/qemuhelptest.c: Add -mem-path constants
      * tests/qemuxml2argvtest.c, tests/qemuxml2xmltest.c: Add tests for hugepage
        handling
      * tests/qemuxml2argvdata/qemuxml2argv-hugepages.xml,
        tests/qemuxml2argvdata/qemuxml2argv-hugepages.args: Data files for
        hugepage tests
      d823a05a