1. 22 7月, 2011 4 次提交
    • L
      conf: support abstracted interface info in network XML · 40fd7073
      Laine Stump 提交于
      The network XML is updated in the following ways:
      
      1) The <forward> element can now contain a list of forward interfaces:
      
           <forward .... >
             <interface dev='eth10'/>
             <interface dev='eth11'/>
             <interface dev='eth12'/>
             <interface dev='eth13'/>
           </forward>
      
         The first of these takes the place of the dev attribute that is
         normally in <forward> - when defining a network you can specify
         either one, and on output both will be present. If you specify
         both on input, they must match.
      
      2) In addition to forward modes of 'nat' and 'route', these new modes
         are supported:
      
           private, passthrough, vepa - when this network is referenced by a
           domain's interface, it will have the same effect as if the
           interface had been defined as type='direct', e.g.:
      
              <interface type='direct'>
                <source mode='${mode}' dev='${dev}>
                ...
              </interface>
      
           where ${mode} is one of the three new modes, and ${dev} is an interface
           selected from the list given in <forward>.
      
           bridge - if a <forward> dev (or multiple devs) is defined, and
           forward mode is 'bridge' this is just like the modes 'private',
           'passthrough', and 'vepa' above. If there is no forward dev
           specified but a bridge name is given (e.g. "<bridge
           name='br0'/>"), then guest interfaces using this network will use
           libvirt's "host bridge" mode, equivalent to this:
      
             <interface type='bridge'>
                <source bridge='${bridge-name}'/>
                ...
             </interface>
      
      3) A network can have multiple <portgroup> elements, which may be
         selected by the guest interface definition (by adding
         "portgroup='${name}'" in the <source> element along with the
         network name). Currently a portgroup can only contain a
         virtportprofile, but the intent is that other configuration items
         may be put there int the future (e.g. bandwidth config). When
         building a guest's interface, if the <interface> XML itself has no
         virtportprofile, and if the requested network has a portgroup with
         a name matching the name given in the <interface> (or if one of the
         network's portgroups is marked with the "default='yes'" attribute),
         the virtportprofile from that portgroup will be used by the
         interface.
      
      4) A network can have a virtportprofile defined at the top level,
         which will be used by a guest interface when connecting in one of
         the 'direct' modes if the guest interface XML itself hasn't
         specified any virtportprofile, and if there are also no matching
         portgroups on the network.
      40fd7073
    • L
      conf: support abstracted interface info in domain interface XML · 07f41369
      Laine Stump 提交于
      the domain XML <interface> element is updated in the following ways:
      
      1) <virtualportprofile> can be specified when source type='network'
      (previously it was only valid for source type='direct')
      
      2) A new attribute "portgroup" has been added to the <source>
      element. When source type='network' (the only time portgroup is
      recognized), extra configuration information will be taken from the
      <portgroup> element of the given name in the network definition.
      
      3) Each virDomainNetDef now also potentially has a
      virDomainActualNetDef which is a private object (never
      exported/imported via the public API, and not defined in the RNG) that
      is used to maintain information about the physical device that was
      actually used for a NetDef of type VIR_DOMAIN_NET_TYPE_NETWORK.
      
      The virDomainActualNetDef will only be parsed/formatted if the
      parse/format function is called with the
      VIR_DOMAIN_XML_INTERNAL_ACTUAL_NET flag set (which is only needed when
      saving/loading a running domain's state info to the stateDir).
      07f41369
    • L
      conf: put virtPortProfile struct / functions in a common location · a3d95b55
      Laine Stump 提交于
      virtPortProfiles are currently only used in the domain XML, but will
      soon also be used in the network XML. To prepare for that change, this
      patch moves the structure definition into util/network.h and the parse
      and format functions into util/network.c (I decided that this was a
      better choice than macvtap.h/c for something that needed to always be
      available on all platforms).
      a3d95b55
    • E
      build: rename files.h to virfile.h · 8e22e089
      Eric Blake 提交于
      In preparation for a future patch adding new virFile APIs.
      
      * src/util/files.h, src/util/files.c: Move...
      * src/util/virfile.h, src/util/virfile.c: ...here, and rename
      functions to virFile prefix.  Macro names are intentionally
      left alone.
      * *.c: All '#include "files.h"' uses changed.
      * src/Makefile.am (UTIL_SOURCES): Reflect rename.
      * cfg.mk (exclude_file_name_regexp--sc_prohibit_close): Likewise.
      * src/libvirt_private.syms: Likewise.
      * docs/hacking.html.in: Likewise.
      * HACKING: Regenerate.
      8e22e089
  2. 21 7月, 2011 3 次提交
    • W
      cgroup: Implement cpu.cfs_period_us and cpu.cfs_quota_us tuning API · fd7c1723
      Wen Congyang 提交于
      This patch provides 4 APIs to get and set cpu.cfs_period_us and cpu.cfs_quota_us.
      fd7c1723
    • W
      Introduce the function virCgroupForVcpu · 8e64f873
      Wen Congyang 提交于
      Introduce the function virCgroupForVcpu() to create sub directory for each vcpu.
      8e64f873
    • L
      util: add virtkeycode module · 0bbf87e9
      Lai Jiangshan 提交于
      Add virtkey lib for usage-improvment and keycode translating.
      Add 4 internal API for the aim
      
      const char *virKeycodeSetTypeToString(int codeset);
      int virKeycodeSetTypeFromString(const char *name);
      int virKeycodeValueFromString(virKeycodeSet codeset, const char *keyname);
      int virKeycodeValueTranslate(virKeycodeSet from_codeset,
                                   virKeycodeSet to_offset,
                                   int key_value);
      
      * include/libvirt/libvirt.h.in: extend virKeycodeSet enum
      * src/Makefile.am: add new virtkeycode module and rule to generate
        virkeymaps.h
      * src/util/virkeycode.c src/util/virkeycode.h: new module
      * src/util/virkeycode-mapgen.py: python generator for virkeymaps.h
        out of keymaps.csv
      * src/libvirt_private.syms: extend private symbols for new module
      * .gitignore: add generated virkeymaps.h
      0bbf87e9
  3. 15 7月, 2011 1 次提交
    • E
      command: introduce virPidWait, virPidAbort · e208c38b
      Eric Blake 提交于
      When using virCommandRunAsync and saving the pid for later, it
      is useful to be able to reap that pid in the same way that it
      would have been auto-reaped by virCommand if we had passed
      NULL for the pid argument in the first place.
      
      * src/util/command.c (virPidWait, virPidAbort): New functions,
      created from...
      (virCommandWait, virCommandAbort): ...bodies of these.
      (includes): Drop duplicate <stdlib.h>.  Ensure that our pid_t
      assumptions hold.
      (virCommandRunAsync): Improve documentation.
      * src/util/command.h (virPidWait, virPidAbort): New prototypes.
      * src/libvirt_private.syms: Export them.
      * docs/internals/command.html.in: Document them.
      e208c38b
  4. 14 7月, 2011 1 次提交
    • M
      storage: Avoid memory leak on metadata fetching · 85aa40e2
      Michal Privoznik 提交于
      Getting metadata on storage allocates a memory (path) which need to
      be freed after use otherwise it gets leaked. This means after use of
      virStorageFileGetMetadataFromFD or virStorageFileGetMetadata one
      must call virStorageFileFreeMetadata to free it. This function frees
      structure internals and structure itself.
      85aa40e2
  5. 13 7月, 2011 2 次提交
    • D
      Add auditing of filesystems · e6e90c8d
      Daniel P. Berrange 提交于
      When passing through filesystems from the host to a guest, the
      host filesystem passed must be audited
      
      * src/conf/domain_audit.{c,h}: Add virDomainAuditFS
      e6e90c8d
    • D
      Move qemu_audit.h helpers into shared code · b43070eb
      Daniel P. Berrange 提交于
      The LXC and UML drivers can both make use of auditing. Move
      the qemu_audit.{c,h} files to src/conf/domain_audit.{c,h}
      
      * src/conf/domain_audit.c: Rename from src/qemu/qemu_audit.c
      * src/conf/domain_audit.h: Rename from src/qemu/qemu_audit.h
      * src/Makefile.am: Remove qemu_audit.{c,h}, add domain_audit.{c,h}
      * src/qemu/qemu_audit.h, src/qemu/qemu_cgroup.c,
        src/qemu/qemu_command.c, src/qemu/qemu_driver.c,
        src/qemu/qemu_hotplug.c, src/qemu/qemu_migration.c,
        src/qemu/qemu_process.c: Update for changed audit API names
      b43070eb
  6. 12 7月, 2011 2 次提交
    • D
      Keep pidfile path in qemuDomainObjPrivate struct · accfe952
      Daniel P. Berrange 提交于
      Avoid re-formatting the pidfile path everytime we need it. Create
      it once when starting the guest, and preserve it until the guest
      is shutdown.
      
      * src/libvirt_private.syms, src/util/util.c,
        src/util/util.h: Add virFileReadPidPath
      * src/qemu/qemu_domain.h: Add pidfile field
      * src/qemu/qemu_process.c: Store pidfile path in qemuDomainObjPrivate
      accfe952
    • E
      maint: rename virtaudit to match file contents · 2ceb35e1
      Eric Blake 提交于
      * src/util/virtaudit.[ch]: Rename...
      * src/util/viraudit.[ch]: ...to match virAudit* API.
      * src/Makefile.am (UTIL_SOURCES): Reflect rename.
      * daemon/libvirtd.c: Likewise.
      * po/POTFILES.in: Likewise.
      * src/libvirt_private.syms: Likewise.
      * src/qemu/qemu_audit.c: Likewise.
      2ceb35e1
  7. 08 7月, 2011 1 次提交
  8. 07 7月, 2011 2 次提交
    • E
      util: add virTrimSpaces · 01374ec8
      Eric Blake 提交于
      The next patch wants to adjust an end pointer to trim trailing
      spaces but without modifying the underlying string, but a more
      generally useful ability to trim trailing spaces in place is
      also worth providing.
      
      * src/util/util.h (virTrimSpaces, virSkipSpacesBackwards): New
      prototypes.
      * src/util/util.c (virTrimSpaces, virSkipSpacesBackwards): New
      functions.
      * src/libvirt_private.syms (util.h): Export new functions.
      Inspired by a patch by Minoru Usui.
      01374ec8
    • E
      util: fix virSkipSpaces · 82162316
      Eric Blake 提交于
      Most clients of virSkipSpaces don't want to omit backslashes.
      Also, open-coding the list of spaces is not as nice as using
      c_isspace.
      
      * src/util/util.c (virSkipSpaces): Use c_isspace.
      (virSkipSpacesAndBackslash): New function.
      * src/util/util.h (virSkipSpacesAndBackslash): New prototype.
      * src/xen/xend_internal.c (sexpr_to_xend_topology): Update caller.
      * src/libvirt_private.syms (util.h): Export new function.
      82162316
  9. 06 7月, 2011 1 次提交
    • G
      pci: initialize state values on reattach · 416814e6
      Guannan Ren 提交于
      add a new API pciDeviceReAttachInit() in pci.c to initialize state values for nodedev reattach
      
      Initialize three state value of device driver to 1. This is just for a new call to
      qemudNodeDeviceReAttach()
      416814e6
  10. 28 6月, 2011 2 次提交
    • D
      Add a virSecurityManagerSetProcessFDLabel · 8e3c6fbb
      Daniel P. Berrange 提交于
      Add a new security driver method for labelling an FD with
      the process label, rather than the image label
      
      * src/libvirt_private.syms, src/security/security_apparmor.c,
        src/security/security_dac.c, src/security/security_driver.h,
        src/security/security_manager.c, src/security/security_manager.h,
        src/security/security_selinux.c, src/security/security_stack.c:
        Add virSecurityManagerSetProcessFDLabel & impl
      8e3c6fbb
    • D
      Rename virSecurityManagerSetFDLabel method · 4438c63e
      Daniel P. Berrange 提交于
      The virSecurityManagerSetFDLabel method is used to label
      file descriptors associated with disk images. There will
      shortly be a need to label other file descriptors in a
      different way. So the current name is ambiguous. Rename
      the method to virSecurityManagerSetImageFDLabel to clarify
      its purpose
      
      * src/libvirt_private.syms,
        src/qemu/qemu_migration.c, src/qemu/qemu_process.c,
        src/security/security_apparmor.c, src/security/security_dac.c,
        src/security/security_driver.h, src/security/security_manager.c,
        src/security/security_manager.h, src/security/security_selinux.c,
        src/security/security_stack.c: s/FDLabel/ImageFDLabel/
      4438c63e
  11. 27 6月, 2011 1 次提交
    • E
      build: rename Vcpupin to VcpuPin · 28e45afc
      Eric Blake 提交于
      We already have a public virDomainPinVcpu, which implies that
      Pin and Vcpu are treated as separate words.  Unreleased commit
      e261987c introduced virDomainGetVcpupinInfo as the first public
      API that used Vcpupin, although we had prior internal uses of
      that spelling.  For consistency, change the spelling to be two
      words everywhere, regardless of whether pin comes first or last.
      
      * daemon/remote.c: Treat vcpu and pin as separate words.
      * include/libvirt/libvirt.h.in: Likewise.
      * src/conf/domain_conf.c: Likewise.
      * src/conf/domain_conf.h: Likewise.
      * src/driver.h: Likewise.
      * src/libvirt.c: Likewise.
      * src/libvirt_private.syms: Likewise.
      * src/libvirt_public.syms: Likewise.
      * src/libxl/libxl_driver.c: Likewise.
      * src/qemu/qemu_driver.c: Likewise.
      * src/remote/remote_driver.c: Likewise.
      * src/xen/xend_internal.c: Likewise.
      * tools/virsh.c: Likewise.
      * src/remote/remote_protocol.x: Likewise.
      * src/remote_protocol-structs: Likewise.
      Suggested by Matthias Bolte.
      28e45afc
  12. 25 6月, 2011 3 次提交
  13. 24 6月, 2011 1 次提交
  14. 23 6月, 2011 2 次提交
    • S
      cleanup: make several interface functions commonly available · df3d8c36
      Stefan Berger 提交于
      In a second cleanup step this patch makes several interface functions from macvtap.c commonly available by moving them into interface.c and prefixing their names with 'iface'. Those functions taking Linux-specific structures as parameters are only visible on Linux.
      
      ifaceRestoreMacAddress returns the return code from the ifaceSetMacAddr call and display an error message if setting the MAC address did not work. The caller is unchanged and still ignores the return code (which is ok).
      df3d8c36
    • S
      cleanup: make nlComm commonly available · 6a597883
      Stefan Berger 提交于
      In a first cleanup step, make nlComm from macvtap.c commonly available
      for other code to use. Since nlComm uses Linux-specific structures as
      parameters it's prototype is only visible on Linux.
      6a597883
  15. 22 6月, 2011 1 次提交
    • M
      qemu: domain I/O asynchronous handling · 017abcbb
      Michal Privoznik 提交于
      For virtio disks and interfaces, qemu allows users to enable or disable
      ioeventfd feature. This means, qemu can execute domain code, while
      another thread waits for I/O event. Basically, in some cases it is win,
      in some loss. This feature is available via 'ioeventfd' attribute in disk
      and interface <driver> element. It accepts 'on' and 'off'. Leaving this
      attribute out defaults to hypervisor decision.
      017abcbb
  16. 21 6月, 2011 2 次提交
    • D
      set and restore MAC address of a NIC when using PASSTHROUGH mode · cbd8227e
      Dirk Herrendoerfer 提交于
      The following patch addresses the problem that when a PASSTHROUGH
      mode DIRECT NIC connection is made the MAC address of the NIC is
      not automatically set and reset to the configured VM MAC and
      back again.
      
      The attached patch fixes this problem by setting and resetting the MAC
      while remembering the previous setting while the VM is running.
      This also works if libvirtd is restarted while the VM is running.
      
      the patch passes make syntax-check
      cbd8227e
    • C
      Promote virEvent*Handle/Timeout to public API · 6094ad7b
      Cole Robinson 提交于
      Since we virEventRegisterDefaultImpl is now a public API, callers need
      a way to invoke the default registered Handle and Timeout functions. We
      already have general functions for these internally, so promote
      them to the public API.
      
      v2:
          Actually add APIs to libvirt.h
      6094ad7b
  17. 20 6月, 2011 2 次提交
  18. 16 6月, 2011 1 次提交
  19. 15 6月, 2011 4 次提交
    • A
      Asynchronous event for BlockPull completion · 12cd77a0
      Adam Litke 提交于
      When an operation started by virDomainBlockPullAll completes (either with
      success or with failure), raise an event to indicate the final status.  This
      allows an API user to avoid polling on virDomainBlockPullInfo if they would
      prefer to use the event mechanism.
      
      * daemon/remote.c: Dispatch events to client
      * include/libvirt/libvirt.h.in: Define event ID and callback signature
      * src/conf/domain_event.c, src/conf/domain_event.h,
        src/libvirt_private.syms: Extend API to handle the new event
      * src/qemu/qemu_driver.c: Connect to the QEMU monitor event
        for block_stream completion and emit a libvirt block pull event
      * src/remote/remote_driver.c: Receive and dispatch events to application
      * src/remote/remote_protocol.x: Wire protocol definition for the event
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c: Watch for BLOCK_STREAM_COMPLETED event
        from QEMU monitor
      Signed-off-by: NAdam Litke <agl@us.ibm.com>
      12cd77a0
    • M
      spice: add <clipboard copypaste='yes|no'> option · 98bfdff1
      Marc-André Lureau 提交于
      From a security pov copy and paste between the guest and the client is not
      always desirable. So we need to be able to enable/disable this. The best place
      to do this from an administration pov is on the hypervisor, so the qemu cmdline
      is getting a spice disable-copy-paste option, see bug 693645. Example qemu
      invocation:
      qemu -spice port=5932,disable-ticketing,disable-copy-paste
      
      https://bugzilla.redhat.com/show_bug.cgi?id=693661
      98bfdff1
    • M
      virNodeGetMemoryStats: Implement linux support · af35cece
      Minoru Usui 提交于
      Signed-off-by: NMinoru Usui <usui@mxm.nes.nec.co.jp>
      af35cece
    • M
      virNodeGetCPUStats: Implement linux support · ce76e853
      Minoru Usui 提交于
      Signed-off-by: NMinoru Usui <usui@mxm.nes.nec.co.jp>
      ce76e853
  20. 13 6月, 2011 1 次提交
  21. 08 6月, 2011 1 次提交
  22. 07 6月, 2011 1 次提交
  23. 02 6月, 2011 1 次提交
    • D
      Add a plugin for the 'sanlock' project · 9f135031
      Daniel P. Berrange 提交于
      Sanlock is a project that implements a disk-paxos locking
      algorithm. This is suitable for cluster deployments with
      shared storage.
      
      * src/Makefile.am: Add dlopen plugin for sanlock
      * src/locking/lock_driver_sanlock.c: Sanlock driver
      * configure.ac: Check for sanlock
      * libvirt.spec.in: Add a libvirt-lock-sanlock RPM
      9f135031