1. 15 6月, 2011 1 次提交
  2. 13 6月, 2011 1 次提交
  3. 08 6月, 2011 1 次提交
  4. 07 6月, 2011 1 次提交
  5. 02 6月, 2011 5 次提交
    • 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
    • D
      Allow leases to be hotpluged with QEMU guests · 30ffe7bc
      Daniel P. Berrange 提交于
      * src/conf/domain_conf.c, src/conf/domain_conf.h: APIs for
        inserting/finding/removing virDomainLeaseDefPtr instances
      * src/qemu/qemu_driver.c: Wire up hotplug/unplug for leases
      * src/qemu/qemu_hotplug.h, src/qemu/qemu_hotplug.c: Support
        for hotplug and unplug of leases
      30ffe7bc
    • D
      Add higher level lock API for domain objects · ad73a937
      Daniel P. Berrange 提交于
      To facilitate use of the locking plugins from hypervisor drivers,
      introduce a higher level API for locking virDomainObjPtr instances.
      In includes APIs targetted to VM startup, and hotplug/unplug
      
      * src/Makefile.am: Add domain lock API
      * src/locking/domain_lock.c, src/locking/domain_lock.h: High
        level API for domain locking
      ad73a937
    • D
      Basic framework for lock manager plugins · 6a943419
      Daniel P. Berrange 提交于
      Define the basic framework lock manager plugins. The
      basic plugin API for 3rd parties to implemented is
      defined in
      
        src/locking/lock_driver.h
      
      This allows dlopen()able modules for alternative locking
      schemes, however, we do not install the header. This
      requires lock plugins to be in-tree allowing changing of
      the lock manager plugin API in future.
      
      The libvirt code for loading & calling into plugins
      is in
      
        src/locking/lock_manager.{c,h}
      
      * include/libvirt/virterror.h, src/util/virterror.c: Add
        VIR_FROM_LOCKING
      * src/locking/lock_driver.h: API for lock driver plugins
        to implement
      * src/locking/lock_manager.c, src/locking/lock_manager.h:
        Internal API for managing locking
      * src/Makefile.am: Add locking code
      6a943419
    • D
      Allow handshake with child process during startup · 285c2fdf
      Daniel P. Berrange 提交于
      Allow the parent process to perform a bi-directional handshake
      with the child process during fork/exec. The child process
      will fork and do its initial setup. Immediately prior to the
      exec(), it will stop & wait for a handshake from the parent
      process. The parent process will spawn the child and wait
      until the child reaches the handshake point. It will do
      whatever extra setup work is required, before signalling the
      child to continue.
      
      The implementation of this is done using two pairs of blocking
      pipes. The first pair is used to block the parent, until the
      child writes a single byte. Then the second pair pair is used
      to block the child, until the parent confirms with another
      single byte.
      
      * src/util/command.c, src/util/command.h,
        src/libvirt_private.syms: Add APIs to perform a handshake
      285c2fdf
  6. 31 5月, 2011 1 次提交
    • D
      Add an API for comparing the ABI of two guest configurations · 08106e20
      Daniel P. Berrange 提交于
      To allow a client app to pass in custom XML during migration
      of a guest it is neccessary to ensure the guest ABI remains
      unchanged. The virDomainDefCheckABIStablity method accepts
      two virDomainDefPtr structs and compares everything in them
      that could impact the guest machine ABI
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h,
        src/libvirt_private.syms: Add virDomainDefCheckABIStablity
      * src/conf/cpu_conf.c, src/conf/cpu_conf.h: Add virCPUDefIsEqual
      * src/util/sysinfo.c, src/util/sysinfo.h: Add virSysinfoIsEqual
      08106e20
  7. 29 5月, 2011 1 次提交
    • D
      Introduce a new event emitted when a virtualization failure occurs · a6135ec1
      Daniel P. Berrange 提交于
      This introduces a new domain
      
        VIR_DOMAIN_EVENT_ID_CONTROL_ERROR
      
      Which uses the existing generic callback
      
      typedef void (*virConnectDomainEventGenericCallback)(virConnectPtr conn,
                                                           virDomainPtr dom,
                                                           void *opaque);
      
      This event is intended to be emitted when there is a failure in
      some part of the domain virtualization system. Whether the domain
      continues to run/exist after the failure is an implementation
      detail specific to the hypervisor.
      
      The idea is that with some types of failure, hypervisors may
      prefer to leave the domain running in a "degraded" mode of
      operation. For example, if something goes wrong with the QEMU
      monitor, it is possible to leave the guest OS running quite
      happily. The mgmt app will simply loose the ability todo various
      tasks. The mgmt app can then choose how/when to deal with the
      failure that occured.
      * daemon/remote.c: Dispatch of new event
      * examples/domain-events/events-c/event-test.c: Demo catch
        of event
      * include/libvirt/libvirt.h.in: Define event ID and callback
      * src/conf/domain_event.c, src/conf/domain_event.h: Internal
        event handling
      * src/remote/remote_driver.c: Receipt of new event from daemon
      * src/remote/remote_protocol.x: Wire protocol for new event
      * src/remote_protocol-structs: add new event for checks
      a6135ec1
  8. 28 5月, 2011 1 次提交
  9. 27 5月, 2011 2 次提交
    • M
      Fix build with --with-driver-modules enabled · a07d1784
      Matthias Bolte 提交于
      Export a bunch of missing symbols and link the remote driver to gnulib.
      a07d1784
    • K
      qemu : support persistent add/delete network interface · 9c26d6f0
      KAMEZAWA Hiroyuki 提交于
      This patch allows to modify interfaces of domain(qemu)
      * src/conf/domain_conf.c src/conf/domain_conf.h src/libvirt_private.syms:
        (virDomainNetInsert)     : Insert a network device to domain definition.
        (virDomainNetIndexByMac) : Returns an index of net device in array.
        (virDomainNetRemoveByMac): Remove a NIC of passed MAC address.
      * src/qemu/qemu_driver.c
        (qemuDomainAttachDeviceConfig): add codes for NIC.
        (qemuDomainDetachDeviceConfig): add codes for NIC.
      9c26d6f0
  10. 24 5月, 2011 1 次提交
    • A
      spice: support streaming-video parameter · bb1c5423
      Alon Levy 提交于
      This adds a streaming-video=filter|all|off attribute. It is used to change
      the behavior of video stream detection in spice, the default is filter (the
      default for libvirt is not to specify it - the actual default is defined in
      libspice-server.so).
      
      Usage:
      
          <graphics type='spice' autoport='yes'>
            <streaming mode='off'/>
          </graphics>
      
      Tested with the above and with tests/qemuxml2argvtest.
      Signed-off-by: NAlon Levy <alevy@redhat.com>
      bb1c5423
  11. 17 5月, 2011 1 次提交
  12. 16 5月, 2011 3 次提交
    • D
      Introduce migration cookies to QEMU driver · 8654175c
      Daniel P. Berrange 提交于
      The migration protocol has support for a 'cookie' parameter which
      is an opaque array of bytes as far as libvirt is concerned. Drivers
      may use this for passing around arbitrary extra data they might
      need during migration. The QEMU driver needs to do a few things:
      
       - Pass hostname/uuid to allow strict protection against localhost
         migration attempts
       - Pass SPICE/VNC server port from the target back to the source to
         allow seamless relocation of client sessions
       - Pass lock driver state from source to destination
      
      This patch introduces the basic glue for handling cookies
      but only includes the host/guest UUID & name.
      
      * src/libvirt_private.syms: Export virXMLParseStrHelper
      * src/qemu/qemu_migration.c, src/qemu/qemu_migration.h: Parsing
        and formatting of migration cookies
      * src/qemu/qemu_driver.c: Pass in cookie parameters where possible
      * src/remote/remote_protocol.h, src/remote/remote_protocol.x: Change
        cookie max length to 16384 bytes
      8654175c
    • D
      Introduce yet another migration version in API. · 65043d2d
      Daniel P. Berrange 提交于
      Migration just seems to go from bad to worse. We already had to
      introduce a second migration protocol when adding the QEMU driver,
      since the one from Xen was insufficiently flexible to cope with
      passing the data the QEMU driver required.
      
      It turns out that this protocol still has some flaws that we
      need to address. The current sequence is
      
       *  Src: DumpXML
                - Generate XML to pass to dst
      
       *  Dst: Prepare
                - Get ready to accept incoming VM
                - Generate optional cookie to pass to src
      
       *  Src: Perform
                - Start migration and wait for send completion
                - Kill off VM if successful, resume if failed
      
       *  Dst: Finish
                - Wait for recv completion and check status
                - Kill off VM if unsuccessful
      
      The problems with this are:
      
       - Since the first step is a generic 'DumpXML' call, we can't
         add in other migration specific data. eg, we can't include
         any VM lease data from lock manager plugins
       - Since the first step is a generic 'DumpXML' call, we can't
         emit any 'migration begin' event on the source, or have
         any hook that runs right at the start of the process
       - Since there is no final step on the source, if the Finish
         method fails to receive all migration data & has to kill
         the VM, then there's no way to resume the original VM
         on the source
      
      This patch attempts to introduce a version 3 that uses the
      improved 5 step sequence
      
       *  Src: Begin
                - Generate XML to pass to dst
                - Generate optional cookie to pass to dst
      
       *  Dst: Prepare
                - Get ready to accept incoming VM
                - Generate optional cookie to pass to src
      
       *  Src: Perform
                - Start migration and wait for send completion
                - Generate optional cookie to pass to dst
      
       *  Dst: Finish
                - Wait for recv completion and check status
                - Kill off VM if failed, resume if success
                - Generate optional cookie to pass to src
      
       *  Src: Confirm
                - Kill off VM if success, resume if failed
      
      The API is designed to allow both input and output cookies
      in all methods where applicable. This lets us pass around
      arbitrary extra driver specific data between src & dst during
      migration. Combined with the extra 'Begin' method this lets
      us pass lease information from source to dst at the start of
      migration
      
      Moving the killing of the source VM out of Perform and
      into Confirm, means we can now recover if the dst host
      can't successfully Finish receiving migration data.
      65043d2d
    • J
      Implement domain state reason · b046c55d
      Jiri Denemark 提交于
      Only in drivers which use virDomainObj, drivers that query hypervisor
      for domain status need to be updated separately in case their hypervisor
      supports this functionality.
      
      The reason is also saved into domain state XML so if a domain is not
      running (i.e., no state XML exists) the reason will be lost by libvirtd
      restart. I think this is an acceptable limitation.
      b046c55d
  13. 14 5月, 2011 1 次提交
  14. 13 5月, 2011 2 次提交
  15. 11 5月, 2011 2 次提交
    • C
      command: Add virCommandExec helper · f095398a
      Cole Robinson 提交于
      Actually execs the argv/env we've generated, replacing the current process.
      Kind of has a limited usage, but allows us to use virCommand in LXC
      driver to launch the 'init' process
      f095398a
    • C
      command: Add virCommandEnvAddFormat · 35c1b35e
      Cole Robinson 提交于
      Similar to virCommandArgAddFormat. We will use this shortly.
      
      v2:
          Convert virCommandEnvAddPair to use the new function
      35c1b35e
  16. 06 5月, 2011 4 次提交
    • M
      Add warning message to XML definition files stored on disk · 5d09c314
      Michal Privoznik 提交于
      Users often edit XML file stored in configuration directory
      thinking of modifying a domain/network/pool/etc. Thus it is wise
      to let them know they are using the wrong way and give them hint.
      5d09c314
    • D
      Add field to virDomainObjPtr to track "tainting" · 79984650
      Daniel P. Berrange 提交于
      Some configuration setups for guests are allowed, but strongly
      discouraged and unsupportable in production systems. Introduce
      a concept of 'tainting' to virDomainObjPtr to allow such setups
      to be identified. Drivers can then log warnings at suitable
      times
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Declare taint
        flags and add parsing/formatting of domain status XML
      79984650
    • E
      buf: add virBufferVasprintf · f09acccf
      Eric Blake 提交于
      Match the fact that we have virAsprintf and virVasprintf.
      
      * src/util/buf.h (virBufferVasprintf): New prototype.
      * src/util/buf.c (virBufferAsprintf): Move guts...
      (virBufferVasprintf): ...to new function.
      * src/libvirt_private.syms (buf.h): Export it.
      * bootstrap.conf (gnulib_modules): Add stdarg, for va_copy.
      f09acccf
    • E
      maint: rename virBufferVSprintf to virBufferAsprintf · 68ea80cf
      Eric Blake 提交于
      We already have virAsprintf, so picking a similar name helps for
      seeing a similar purpose.  Furthermore, the prefix V before printf
      generally implies 'va_list', even though this variant was '...', and
      the old name got in the way of adding a new va_list version.
      
      global rename performed with:
      
      $ git grep -l virBufferVSprintf \
        | xargs -L1 sed -i 's/virBufferVSprintf/virBufferAsprintf/g'
      
      then revert the changes in ChangeLog-old.
      68ea80cf
  17. 28 4月, 2011 2 次提交
    • K
      libvirt/qemu - support persistent attach/detach disks · ab9102c2
      KAMEZAWA Hiroyuki 提交于
      Support changes of disks by MODIFY_CONFIG for qemu.
      
      This patch includes patches for qemu's disk to support
      virDomainAt(De)tachDeviceFlags with VIR_DOMAIN_DEVICE_MODIFY_CONFIG.
      
      Other devices can be added incrementally.
      Signed-off-by: NKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      
      * /src/conf/domain_conf.c
      (virDomainDiskIndexByName): returns array index of disk in vmdef.
      (virDomainDiskRemoveByName): removes a disk which has the name in vmdef.
      * src/qemu/qemu_driver.c
      (qemuDomainAttachDeviceConfig): add support for Disks.
      (qemuDomainDetachDeviceConfig): add support for Disks.
      ab9102c2
    • K
      libvirt/qemu - support persistent modification of devices · da1eba6b
      KAMEZAWA Hiroyuki 提交于
      This patch adds functions for modify domain's persistent definition.
      To do error recovery in easy way, we use a copy of vmdef and update it.
      
      The whole sequence will be:
      
        make a copy of domain definition.
      
        if (flags & MODIFY_CONFIG)
            update copied domain definition
        if (flags & MODIF_LIVE)
            do hotplug.
        if (no error)
            save copied one to the file and update cached definition.
        else
            discard copied definition.
      
      This patch is mixuture of Eric Blake's work and mine.
      From: Eric Blake <eblake@redhat.com>
      Signed-off-by: NKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      
      (virDomainObjCopyPersistentDef): make a copy of persistent vm definition
      (qemuDomainAttach/Detach/UpdateDeviceConfig) : callbacks. now empty
      (qemuDomainModifyDeviceFlags): add support for MODIFY_CONFIG and MODIFY_CURRENT
      da1eba6b
  18. 27 4月, 2011 1 次提交
    • J
      tests: More unit tests for internal hash APIs · 91e12a50
      Jiri Denemark 提交于
      This adds several tests for remaining hash APIs (custom
      hasher/comparator functions are not covered yet, though).
      
      All tests pass both before and after the "Simplify hash implementation".
      91e12a50
  19. 26 4月, 2011 1 次提交
  20. 25 4月, 2011 1 次提交
    • E
      threads: add one-time initialization support · 99de5990
      Eric Blake 提交于
      mingw lacks the counterpart to PTHREAD_MUTEX_INITIALIZER, so the
      best we can do is portably expose once-only runtime initialization.
      
      * src/util/threads.h (virOnceControlPtr): New opaque type.
      (virOnceFunc): New callback type.
      (virOnce): New prototype.
      * src/util/threads-pthread.h (virOnceControl): Declare.
      (VIR_ONCE_CONTROL_INITIALIZER): Define.
      * src/util/threads-win32.h (virOnceControl)
      (VIR_ONCE_CONTROL_INITIALIZER): Likewise.
      * src/util/threads-pthread.c (virOnce): Implement in pthreads.
      * src/util/threads-win32.c (virOnce): Implement in WIN32.
      * src/libvirt_private.syms: Export it.
      99de5990
  21. 15 4月, 2011 2 次提交
    • M
      Introduce virDomainChrDefNew() · 2ac455c4
      Michal Novotny 提交于
      Make: passed
      Make check: passed
      Make syntax-check: passed
      
      this is the commit to introduce the function to create new character
      device definition for the domain as advised by Cole Robinson
      <crobinso@redhat.com>.
      
      The function is used on the relevant places and also new tests has
      been added.
      Signed-off-by: NMichal Novotny <minovotn@redhat.com>
      2ac455c4
    • M
      Spice: support audio, images and stream compression · abb1570e
      Michal Privoznik 提交于
      This extends the SPICE XML to allow variable compression settings for audio,
      images and streaming:
          <graphics type='spice' port='5901' tlsPort='-1' autoport='yes'>
              <image compression='auto_glz'/>
              <jpeg compression='auto'/>
              <zlib compression='auto'/>
              <playback compression='on'/>
          </graphics>
      
      All new elements are optional.
      abb1570e
  22. 08 4月, 2011 1 次提交
    • S
      nwfilters: support for TCP flags evaluation · 6ab24feb
      Stefan Berger 提交于
      This patch adds support for the evaluation of TCP flags in nwfilters.
      
      It adds documentation to the web page and extends the tests as well.
      Also, the nwfilter schema is extended.
      
      The following are some example for rules using the tcp flags:
      
      <rule action='accept' direction='in'>
          <tcp state='NONE' flags='SYN/ALL' dsptportstart='80'/>
      </rule>
      <rule action='drop' direction='in'>
          <tcp state='NONE' flags='SYN/ALL'/>
      </rule>
      6ab24feb
  23. 29 3月, 2011 4 次提交
    • O
      cputune: Add data structures presenting cputune XML · 853f0fdf
      Osier Yang 提交于
      Also related new functions' declaration, and expose the new introduced
      functions in libvirt_private.syms.
      
      v1 - v2:
        Don't expose "virAllocVar" in libvirt_private.syms
      853f0fdf
    • M
      Implements domainXMLTo/FromNative in libxl driver · 02449771
      Markus Groß 提交于
      * src/Makefile.am src/libvirt_private.syms configure.ac: share and
        reuse the sexpr routines from sexpr.h of the old xen driver
      * src/libxl/libxl_driver.c: implements libxlDomainXMLFromNative and
        libxlDomainXMLToNative
      02449771
    • E
      util: rename virFileOperation to virFileOpenAs · 1fdd50f9
      Eric Blake 提交于
      This patch intentionally doesn't change indentation, in order to
      make it easier to review the real changes.
      
      * src/util/util.h (VIR_FILE_OP_RETURN_FD, virFileOperationHook):
      Delete.
      (virFileOperation): Rename...
      (virFileOpenAs): ...and reduce parameters.
      * src/util/util.c (virFileOperationNoFork, virFileOperation):
      Rename and simplify.
      * src/qemu/qemu_driver.c (qemudDomainSaveFlag): Adjust caller.
      * src/storage/storage_backend.c (virStorageBackendCreateRaw):
      Likewise.
      * src/libvirt_private.syms: Reflect rename.
      1fdd50f9
    • E
      util: allow clearing cloexec bit · 296eb0bb
      Eric Blake 提交于
      * src/util/util.h (virSetInherit): New prototype.
      * src/util/util.c (virSetCloseExec): Move guts...
      (virSetInherit): ...to new function, and allow clearing.
      * src/libvirt_private.syms (util.h): Export it.
      296eb0bb