1. 18 7月, 2013 1 次提交
    • D
      Introduce new domain create APIs to pass pre-opened FDs to LXC · d76227be
      Daniel P. Berrange 提交于
      With container based virt, it is useful to be able to pass
      pre-opened file descriptors to the container init process.
      This allows for containers to be auto-activated from incoming
      socket connections, passing the active socket into the container.
      
      To do this, introduce a pair of new APIs, virDomainCreateXMLWithFiles
      and virDomainCreateWithFiles, which accept an array of file
      descriptors. For the LXC driver, UNIX file descriptor passing
      will be used to send them to libvirtd, which will them pass
      them down to libvirt_lxc, which will then pass them to the container
      init process.
      
      This will only be implemented for LXC right now, but the design
      is generic enough it could work with other hypervisors, hence
      I suggest adding this to libvirt.so, rather than libvirt-lxc.so
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      d76227be
  2. 16 7月, 2013 1 次提交
  3. 25 6月, 2013 1 次提交
  4. 05 6月, 2013 1 次提交
    • E
      maint: don't use config.h in .h files · 1add9c78
      Eric Blake 提交于
      Enforce the rule that .h files don't need to (redundantly)
      include <config.h>.
      
      * cfg.mk (sc_prohibit_config_h_in_headers): New rule.
      (_virsh_includes): Delete; instead, inline a smaller number of
      exclusions...
      (exclude_file_name_regexp--sc_require_config_h)
      (exclude_file_name_regexp--sc_require_config_h_first): ...here.
      * daemon/libvirtd.h (includes): Fix offenders.
      * src/driver.h (includes): Likewise.
      * src/gnutls_1_0_compat.h (includes): Likewise.
      * src/libxl/libxl_conf.h (includes): Likewise.
      * src/libxl/libxl_driver.h (includes): Likewise.
      * src/lxc/lxc_conf.h (includes): Likewise.
      * src/lxc/lxc_driver.h (includes): Likewise.
      * src/lxc/lxc_fuse.h (includes): Likewise.
      * src/network/bridge_driver.h (includes): Likewise.
      * src/phyp/phyp_driver.h (includes): Likewise.
      * src/qemu/qemu_conf.h (includes): Likewise.
      * src/util/virnetlink.h (includes): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      1add9c78
  5. 21 5月, 2013 1 次提交
    • E
      maint: use LGPL correctly · d7f53c7b
      Eric Blake 提交于
      Several files called out COPYING or COPYING.LIB instead of using
      the normal boilerplate.  It's especially important that we don't
      call out COPYING from an LGPL file, since COPYING is traditionally
      used for the GPL.  A few files were lacking copyright altogether.
      
      * src/rpc/gendispatch.pl: Add missing copyright.
      * Makefile.nonreentrant: Likewise.
      * src/check-symfile.pl: Likewise.
      * src/check-symsorting.pl: Likewise.
      * src/driver.h: Likewise.
      * src/internal.h: Likewise.
      * tools/libvirt-guests.sh.in: Likewise.
      * tools/virt-pki-validate.in: Mention copyright in comment, not just code.
      * tools/virt-sanlock-cleanup.in: Likewise.
      * src/rpc/genprotocol.pl: Spell out license terms.
      * src/xen/xend_internal.h: Likewise.
      * src/xen/xend_internal.c: Likewise.
      * Makefile.am: Likewise.
      * daemon/Makefile.am: Likewise.
      * docs/Makefile.am: Likewise.
      * docs/schemas/Makefile.am: Likewise.
      * examples/apparmor/Makefile.am: Likewise.
      * examples/domain-events/events-c/Makefile.am: Likewise.
      * examples/dominfo/Makefile.am: Likewise.
      * examples/domsuspend/Makefile.am: Likewise.
      * examples/hellolibvirt/Makefile.am: Likewise.
      * examples/openauth/Makefile.am: Likewise.
      * examples/python/Makefile.am: Likewise.
      * examples/systemtap/Makefile.am: Likewise.
      * examples/xml/nwfilter/Makefile.am: Likewise.
      * gnulib/lib/Makefile.am: Likewise.
      * gnulib/tests/Makefile.am: Likewise.
      * include/Makefile.am: Likewise.
      * include/libvirt/Makefile.am: Likewise.
      * python/Makefile.am: Likewise.
      * python/tests/Makefile.am: Likewise.
      * src/Makefile.am: Likewise.
      * tests/Makefile.am: Likewise.
      * tools/Makefile.am: Likewise.
      * configure.ac: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      d7f53c7b
  6. 26 4月, 2013 1 次提交
    • L
      hypervisor api: new virNodeDeviceDetachFlags · 35394196
      Laine Stump 提交于
      The existing virNodeDeviceDettach() assumes that there is only a
      single PCI device assignment backend driver appropriate for any
      hypervisor. This is no longer true, as the qemu driver is getting
      support for PCI device assignment via VFIO. The new API
      virNodeDeviceDetachFlags adds a driverName arg that should be set to
      the exact same string set in a domain <hostdev>'s <driver name='x'/>
      element (i.e. "vfio", "kvm", or NULL for default). It also adds a
      flags arg for good measure (and because it's possible we may need it
      when we start dealing with VFIO's "device groups").
      35394196
  7. 24 4月, 2013 5 次提交
  8. 08 3月, 2013 1 次提交
  9. 23 2月, 2013 2 次提交
  10. 12 2月, 2013 1 次提交
    • O
      Introduce API virNodeDeviceLookupSCSIHostByWWN · efed366e
      Osier Yang 提交于
      Since the name (like scsi_host10) is not stable for vHBA, (it can
      be changed either after recreating or system rebooting), current
      API virNodeDeviceLookupByName is not nice to use for management app
      in this case. (E.g. one wants to destroy the vHBA whose name has
      been changed after system rebooting, he has to find out current
      name first).
      
      Later patches will support the persistent vHBA via storage pool,
      with which one can identify the vHBA stably by the wwnn && wwpn
      pair.
      
      So this new API comes.
      efed366e
  11. 14 1月, 2013 1 次提交
    • D
      Introduce an LXC specific public API & library · 3d1596b0
      Daniel P. Berrange 提交于
      This patch introduces support for LXC specific public APIs. In
      common with what was done for QEMU, this creates a libvirt_lxc.so
      library and libvirt/libvirt-lxc.h header file.
      
      The actual APIs are
      
        int virDomainLxcOpenNamespace(virDomainPtr domain,
                                      int **fdlist,
                                      unsigned int flags);
      
        int virDomainLxcEnterNamespace(virDomainPtr domain,
                                       unsigned int nfdlist,
                                       int *fdlist,
                                       unsigned int *noldfdlist,
                                       int **oldfdlist,
                                       unsigned int flags);
      
      which provide a way to use the setns() system call to move the
      calling process into the container's namespace. It is not
      practical to write in a generically applicable manner. The
      nearest that we could get to such an API would be an API which
      allows to pass a command + argv to be executed inside a
      container. Even if we had such a generic API, this LXC specific
      API is still useful, because it allows the caller to maintain
      the current process context, in particular any I/O streams they
      have open.
      
      NB the virDomainLxcEnterNamespace() API is special in that it
      runs client side, so does not involve the internal driver API.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      3d1596b0
  12. 05 1月, 2013 1 次提交
    • J
      api: Add API to tunnel a guest channel via stream · d52add46
      John Eckersberg 提交于
      This patch adds a new API, virDomainOpenChannel, that uses streams to
      connect to a virtio channel on a guest.  This creates a secure
      communication channel between a guest and a libvirt client.
      
      This behaves the same as virDomainOpenConsole, except on channels
      instead of console/serial/parallel devices.
      d52add46
  13. 04 12月, 2012 1 次提交
  14. 30 11月, 2012 2 次提交
  15. 29 11月, 2012 1 次提交
    • D
      Add virDomainSendProcessSignal API · 46c329bc
      Daniel P. Berrange 提交于
      Add an API for sending signals to arbitrary processes in the
      guest OS. This is primarily useful for container based virt,
      but can be used for machine virt too, if there is a suitable
      guest agent,
      
      * include/libvirt/libvirt.h.in: Add virDomainSendProcessSignal
        and virDomainProcessSignal enum
      * src/driver.h: Driver entry point
      * src/libvirt.c, src/libvirt_public.syms: Impl for new API
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      46c329bc
  16. 28 11月, 2012 1 次提交
    • M
      Introduce virDomainFSTrim() public API · 0fbf3704
      Michal Privoznik 提交于
      This will call FITRIM within guest. The API has 4 arguments,
      however, only 2 will be used for now (@dom and @minumum).
      The rest two are there if in future qemu guest agent learns them.
      0fbf3704
  17. 24 10月, 2012 1 次提交
    • V
      virNodeGetCPUMap: Define public API. · 7ecc1d81
      Viktor Mihajlovski 提交于
      Adding a new API to obtain information about the
      host node's present, online and offline CPUs.
      
      int virNodeGetCPUMap(virConnectPtr conn,
                           unsigned char **cpumap,
                           unsigned int *online,
                           unsigned int flags);
      
      The function will return the number of CPUs present on the host
      or -1 on failure;
      If cpumap is non-NULL virNodeGetCPUMap will allocate an array
      containing a bit map representation of the online CPUs. It's
      the callers responsibility to deallocate cpumap using free().
      If online is non-NULL, the variable pointed to will contain
      the number of online host node CPUs.
      The variable flags has been added to support future extensions
      and must be set to 0.
      
      Extend the driver structure by nodeGetCPUMap entry in support of the
      new API virNodeGetCPUMap.
      Added implementation of virNodeGetCPUMap to libvirt.c
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      7ecc1d81
  18. 18 9月, 2012 2 次提交
    • L
      network: define new API virNetworkUpdate · 574b9bc6
      Laine Stump 提交于
      This patch adds a new public API virNetworkUpdate that will permit
      updating an existing network configuration without requiring that the
      network be destroyed/restarted for the changes to take effect.
      574b9bc6
    • E
      blockjob: add virDomainBlockCommit · ef1e024d
      Eric Blake 提交于
      A block commit moves data in the opposite direction of block pull.
      Block pull reduces the chain length by dropping backing files after
      data has been pulled into the top overlay, and is always safe; block
      commit reduces the chain length by dropping overlays after data has
      been committed into the backing file, and any files that depended
      on base but not on top are invalidated at any point where they have
      unallocated data that is now pointing to changed contents in base.
      Both directions are useful, however: a qcow2 layer that is more than
      50% allocated will typically be faster with a pull operation, while
      a qcow2 layer with less than 50% allocation will be faster as a
      commit operation.  Committing across multiple layers can be more
      efficient than repeatedly committing one layer at a time, but
      requires extra support from the hypervisor.
      
      This API matches Jeff Cody's proposed qemu command 'block-commit':
      https://lists.gnu.org/archive/html/qemu-devel/2012-09/msg02226.html
      
      Jeff's command is still in the works for qemu 1.3, and may gain
      further enhancements, such as the ability to control on-error
      handling (it will be comparable to the error handling Paolo is
      adding to 'drive-mirror', so a similar solution will be needed
      when I finally propose virDomainBlockCopy with more functionality
      than the basics supported by virDomainBlockRebase).  However, even
      without qemu support, this API will be useful for _offline_ block
      commits, by wrapping qemu-img calls and turning them into a block
      job, so this API is worth committing now.
      
      For some examples of how this will be implemented, all starting
      with the chain: base <- snap1 <- snap2 <- active
      
      + These are equivalent:
       virDomainBlockCommit(dom, disk, NULL, NULL, 0, 0)
       virDomainBlockCommit(dom, disk, NULL, "active", 0, 0)
       virDomainBlockCommit(dom, disk, "base", NULL, 0, 0)
       virDomainBlockCommit(dom, disk, "base", "active", 0, 0)
      but cannot be implemented for online qemu with round 1 of
      Jeff's patches; and for offline images, it would require
      three back-to-back qemu-img invocations unless qemu-img
      is patched to allow more efficient multi-layer commits;
      the end result would be 'base' as the active disk with
      contents from all three other files, where 'snap1' and
      'snap2' are invalid right away, and 'active' is invalid
      once any further changes to 'base' are made.
      
      + These are equivalent:
       virDomainBlockCommit(dom, disk, "snap2", NULL, 0, 0)
       virDomainBlockCommit(dom, disk, NULL, NULL, 0, _SHALLOW)
      they cannot be implemented for online qemu, but for offline,
      it is a matter of 'qemu-img commit active', so that 'snap2'
      is now the active disk with contents formerly in 'active'.
      
      + Similarly:
       virDomainBlockCommit(dom, disk, "snap2", NULL, 0, _DELETE)
      for an offline domain will merge 'active' into 'snap2', then
      delete 'active' to avoid leaving a potentially invalid file
      around.
      
      + This version:
       virDomainBlockCommit(dom, disk, NULL, "snap2", 0, _SHALLOW)
      can be implemented online with 'block-commit' passing a base of
      snap1 and a top of snap2; and can be implemented offline by
      'qemu-img commit snap2' followed by 'qemu-img rebase -u
      -b snap1 active'
      
      * include/libvirt/libvirt.h.in (virDomainBlockCommit): New API.
      * src/libvirt.c (virDomainBlockCommit): Implement it.
      * src/libvirt_public.syms (LIBVIRT_0.10.2): Export it.
      * src/driver.h (virDrvDomainBlockCommit): New driver callback.
      * docs/apibuild.py (CParser.parseSignature): Add exception.
      ef1e024d
  19. 17 9月, 2012 4 次提交
    • O
      node_memory: Define the APIs to get/set memory parameters · 12ad7435
      Osier Yang 提交于
      * include/libvirt/libvirt.h.in: (Add macros for the param fields,
        declare the APIs).
      * src/driver.h: (New methods for the driver struct)
      * src/libvirt.c: (Implement the public APIs)
      * src/libvirt_public.syms: (Export the public symbols)
      12ad7435
    • O
      list: Define new API virConnectListAllSecrets · 7a236982
      Osier Yang 提交于
      This is to list the secret objects. Supports to filter the secrets
      by its storage location, and whether it's private or not.
      
      include/libvirt/libvirt.h.in: Declare enum virConnectListAllSecretFlags
                                    and virConnectListAllSecrets.
      python/generator.py: Skip auto-generating
      src/driver.h: (virDrvConnectListAllSecrets)
      src/libvirt.c: Implement the public API
      src/libvirt_public.syms: Export the symbol to public
      7a236982
    • O
      list: Define new API virConnectListAllNWFilters · 6498f76e
      Osier Yang 提交于
      This is to list the network filter objects. No flags are supported
      
      include/libvirt/libvirt.h.in: Declare enum virConnectListAllNWFilterFlags
                                    and virConnectListAllNWFilters.
      python/generator.py: Skip auto-generating
      src/driver.h: (virDrvConnectListAllNWFilters)
      src/libvirt.c: Implement the public API
      src/libvirt_public.syms: Export the symbol to public
      6498f76e
    • O
      list: Define new API virConnectListAllNodeDevices · c6a3be5d
      Osier Yang 提交于
      This is to list the node device objects, supports to filter the results
      by capability types.
      
      include/libvirt/libvirt.h.in: Declare enum virConnectListAllNodeDeviceFlags
                                    and virConnectListAllNodeDevices.
      python/generator.py: Skip auto-generating
      src/driver.h: (virDrvConnectListAllNodeDevices)
      src/libvirt.c: Implement the public API
      src/libvirt_public.syms: Export the symbol to public
      c6a3be5d
  20. 12 9月, 2012 1 次提交
    • O
      list: Define new API virConnectListAllInterfaces · f4af202f
      Osier Yang 提交于
      This is to list the interface objects, supported filtering flags
      are: active|inactive.
      
      include/libvirt/libvirt.h.in: Declare enum virConnectListAllInterfaceFlags
                                    and virConnectListAllInterfaces.
      python/generator.py: Skip auto-generating
      src/driver.h: (virDrvConnectListAllInterfaces)
      src/libvirt.c: Implement the public API
      src/libvirt_public.syms: Export the symbol to public
      f4af202f
  21. 11 9月, 2012 1 次提交
    • O
      list: Define new API virConnectListAllNetworks · 89a1df9b
      Osier Yang 提交于
      This is to list the network objects, supported filtering flags
      are: active|inactive, persistent|transient, autostart|no-autostart.
      
      include/libvirt/libvirt.h.in: Declare enum virConnectListAllNetworkFlags
                                    and virConnectListAllNetworks.
      python/generator.py: Skip auto-generating
      src/driver.h: (virDrvConnectListAllNetworks)
      src/libvirt.c: Implement the public API
      src/libvirt_public.syms: Export the symbol to public
      89a1df9b
  22. 10 9月, 2012 1 次提交
    • O
      list: Define new API virStoragePoolListAllVolumes · a42eac60
      Osier Yang 提交于
      Simply returns the storage volume objects. No supported filter
      flags.
      
      include/libvirt/libvirt.h.in: Declare the API
      python/generator.py: Skip the function for generating. virStoragePool.py
                           will be added in later patch.
      src/driver.h: virDrvStoragePoolListVolumesFlags
      src/libvirt.c: Implementation for the API.
      src/libvirt_public.syms: Export the symbol to public
      a42eac60
  23. 06 9月, 2012 1 次提交
    • O
      list: Define new API virStorageListAllStoragePools · 075c754a
      Osier Yang 提交于
      This introduces a new API to list the storage pool objects,
      4 groups of flags are provided to filter the returned pools:
      
        * Active or not
      
        * Autostarting or not
      
        * Persistent or not
      
        * And the pool type.
      
      include/libvirt/libvirt.h.in: New enum virConnectListAllStoragePoolFlags;
                                    Declare the API.
      python/generator.py: Skip the generating
      src/driver.h: (virDrvConnectListAllStoragePools)
      src/libvirt.c: Implementation for the API.
      src/libvirt_public.syms: Export the symbol.
      075c754a
  24. 24 8月, 2012 1 次提交
    • E
      qemu-agent: available in 0.10.0 · 352cbae8
      Eric Blake 提交于
      The recent virDomainQemuAgentCommand addition is part of 0.10.0;
      also, grouping all libvirt-qemu.so callbacks together makes them
      easier to identify.
      
      * src/libvirt_qemu.syms: Fix release symbol.
      * src/qemu/qemu_driver.c (qemuDriver): Likewise.
      * src/remote/remote_driver.c (remote_driver): Likewise.
      * src/driver.h (_virDriver): Group qemu-specific callbacks.
      352cbae8
  25. 23 8月, 2012 1 次提交
  26. 22 8月, 2012 1 次提交
  27. 21 8月, 2012 1 次提交
  28. 01 8月, 2012 1 次提交
  29. 21 7月, 2012 1 次提交
    • G
      Add virDomainGetHostname · a91067fa
      Guido Günther 提交于
      to query a guests's hostname. Containers like LXC and OpenVZ allow to
      set a hostname different from the hosts name and QEMU's guest agent
      could provide similar functionality.
      a91067fa
  30. 20 6月, 2012 1 次提交
    • E
      list: add virDomainListAllSnapshots API · 37bb0447
      Eric Blake 提交于
      There was an inherent race between virDomainSnapshotNum() and
      virDomainSnapshotListNames(), where an additional snapshot could
      be created in the meantime, or where a snapshot could be deleted
      before converting the name back to a virDomainSnapshotPtr.  It
      was also an awkward name: the function operates on domains, not
      domain snapshots.  virDomainSnapshotListChildrenNames() suffered
      from the same inherent race, although its naming was nicer.
      
      This patch makes things nicer by grabbing a snapshot list
      atomically, in the format most useful to the user.
      
      * include/libvirt/libvirt.h.in (virDomainListAllSnapshots)
      (virDomainSnapshotListAllChildren): New declarations.
      * src/libvirt.c (virDomainSnapshotListNames)
      (virDomainSnapshotListChildrenNames): Add cross-references.
      (virDomainListAllSnapshots, virDomainSnapshotListAllChildren):
      New functions.
      * src/libvirt_public.syms (LIBVIRT_0.9.13): Export them.
      * src/driver.h (virDrvDomainListAllSnapshots)
      (virDrvDomainSnapshotListAllChildren): New callbacks.
      * python/generator.py (skip_function): Prepare for later
      hand-written versions.
      37bb0447