1. 04 6月, 2011 2 次提交
  2. 03 6月, 2011 24 次提交
    • M
      Make dlopen usage in lock manager conditional · 6b5c589d
      Matthias Bolte 提交于
      This fixes a build failure on MinGW, due to MinGW not supporting dlopen.
      6b5c589d
    • N
      Correct 'cputune' documentation example. · 5b8d2e6d
      Neil Wilson 提交于
      Signed-off-by: NNeil Wilson <neil@aldur.co.uk>
      5b8d2e6d
    • E
      build: silence coverity false positive · 32ce66f5
      Eric Blake 提交于
      Coverity couldn't see that priv is NULL on failure.  But on failure,
      we might as well guarantee that callers don't try to free uninitialized
      memory.
      
      * src/remote/remote_driver.c (remoteGenericOpen): Even on failure,
      pass priv back to caller.
      32ce66f5
    • E
      build: silence coverity false positive · 89e651fa
      Eric Blake 提交于
      Coverity complained that infd could be -1 at the point where it is
      passed to write, when in reality, this code can only be reached if
      infd is non-negative.
      
      * src/util/command.c (virCommandProcessIO): Help out coverity.
      89e651fa
    • E
      migrate: detect xml incompatibility · d391661a
      Eric Blake 提交于
      Detected by Coverity.  Bug introduced in 08106e20 (unreleased).
      
      * src/conf/domain_conf.c (virDomainChannelDefCheckABIStability):
      Use correct sizeof operand.
      d391661a
    • E
      event: avoid memory leak on cleanup · 278a050a
      Eric Blake 提交于
      Detected by Coverity.  Introduced in commit aaf2b70b, and turned into
      a regression in the next few commits through 4e6e6672 (unreleased).
      
      * src/conf/domain_event.c (virDomainEventStateFree): Free object,
      per documentation.
      278a050a
    • E
      qemu: avoid memory leak on vcpupin · 2834d571
      Eric Blake 提交于
      Detected by Coverity.  This leaked a cpumap on every iteration
      of the loop.  Leak introduced in commit 1cc4d025 (v0.9.0).
      
      * src/qemu/qemu_process.c (qemuProcessSetVcpuAffinites): Plug
      leak, and hoist allocation outside loop.
      2834d571
    • E
      remote: avoid leak on failure · c0e65ae5
      Eric Blake 提交于
      Detected by Coverity.  Only possible in OOM situations.
      
      * daemon/remote.c (remoteDispatchDomainScreenshot): Plug leak.
      c0e65ae5
    • E
      lock: avoid leak on failure · 0a41733c
      Eric Blake 提交于
      Detected by Coverity.  Only possible on OOM situations.
      
      * src/locking/lock_manager.c (virLockManagerPluginNew): Plug leak.
      0a41733c
    • E
      storage: avoid memory leak on stat failure · f515bab7
      Eric Blake 提交于
      Spotted by coverity.  Triggers on failed stat, although I'm not sure
      how easy that condition is, so I'm not sure if this is a runtime
      memory hog.  Regression introduced in commit 8077d64f (unreleased).
      
      * src/util/storage_file.c (virStorageFileGetMetadataFromFD):
      Reduce need for malloc, avoiding a leak.
      f515bab7
    • E
      storage: avoid memory leak · 9892f7bc
      Eric Blake 提交于
      Coverity detected that options was being set by strdup but never
      freed.  But why even bother with an options variable?  The options
      parameter never changes!  Leak present since commit 44948f5b (0.7.0).
      
      This function could probably be rewritten to take better advantage
      of virCommand, but that is more invasive.
      
      * src/storage/storage_backend_fs.c
      (virStorageBackendFileSystemMount): Avoid wasted strdup, and
      guarantee proper cleanup on all paths.
      9892f7bc
    • E
      libvirtd: avoid leak on failure · ef21beda
      Eric Blake 提交于
      Spotted by Coverity.  Only possible on an OOM condition, so
      unlikely to bite in the wild.
      
      * daemon/libvirtd.c (qemudSetLogging): Don't leak memory.
      ef21beda
    • E
      command: avoid leak on failure · bb889529
      Eric Blake 提交于
      Detected by Coverity.  While it is possible on OOM condition, as
      well as with bad code that passes binary == NULL, it is unlikely
      to be encountered in the wild.
      
      * src/util/command.c (virCommandNewArgList): Don't leak memory.
      bb889529
    • D
      Explicitly set VM state to paused after migration completes · 6d68e0df
      Daniel P. Berrange 提交于
      In v3 migration, once migration is completed, the VM needs
      to be left in a paused state until after Finish3 has been
      executed on the target. Only then will the VM be killed
      off. When using non-JSON QEMU monitor though, we don't
      receive any 'STOP' event from QEMU, so we need to manually
      set our state offline & thus release lock manager leases.
      It doesn't hurt to run this on the JSON case too, just in
      case the event gets lost somehow
      
      * src/qemu/qemu_migration.c: Explicitly set VM state to
        paused when migration completes
      6d68e0df
    • D
      Fix regressions BlockStats/Info APIs in QEMU driver · 2027e184
      Daniel P. Berrange 提交于
      The change 18c2a592 caused
      some regressions in behaviour of virDomainBlockStats
      and virDomainBlockInfo in the QEMU driver.
      
      The virDomainBlockInfo API stopped working for inactive
      guests if querying a block device.
      
      The virDomainBlockStats API did not promptly report
      an error if the guest was not running in some cases.
      
      * src/qemu/qemu_driver.c: Fix inactive guest handling
        in BlockStats/Info APIs
      2027e184
    • J
      Fix minor issues in libxenlight managed save · 9a76e737
      Jim Fehlig 提交于
      There were a few minor issues in commit 5b6c961e
      - leak managed save path
      - leak managed save fd
      - functions that open an fd should also close it
      9a76e737
    • H
      uml: correct command line networking parameters · 39b59dbd
      Heath Petersen 提交于
      I have been finding that some UML command line networking parameters are
      being generated incorrectly.
      
      For more information, see
      https://bugzilla.redhat.com/show_bug.cgi?id=706295 .
      39b59dbd
    • E
      docs: document iface-* commands · 72519f73
      Eric Blake 提交于
      I intentionally set things up so 'virsh help interface' lists
      commands in alphabetical order, but 'man virsh' lists them in
      topical order; this matches our practice on some other commands.
      
      * tools/virsh.pod: Document all iface commands.
      * tools/virsh.c (ifaceCmds): Sort.
      72519f73
    • D
      Fix auditing of disk hotunplug operations · 020342e6
      Daniel P. Berrange 提交于
      The qemuAuditDisk calls in disk hotunplug operations were being
      passed 'ret >= 0', but the code which sets ret to 0 was not yet
      executed, and the error path had already jumped to the 'cleanup'
      label. This meant hotunplug failures were never audited, and
      hotunplug success was audited as a failure
      
      * src/qemu/qemu_hotplug.c: Fix auditing of hotunplug
      020342e6
    • D
      Avoid crash on NULL pointer in lock driver impls during hotplug · eb661ce3
      Daniel P. Berrange 提交于
      When virLockDriverAcquire is invoked during hotplug the state
      parameter will be left as NULL.
      
      * src/locking/lock_driver_nop.c,
        src/locking/lock_driver_sanlock.c: Don't reference NULL state
        parameter
      eb661ce3
    • D
      Fix return value in lock manager hotplug methods · 09240ef1
      Daniel P. Berrange 提交于
      Refactoring of the lock manager hotplug methods lost the
      ret = 0 assignment for successful return path
      
      * src/locking/domain_lock.c: Add missing ret = 0 assignments
      09240ef1
    • D
      Make sure virDomainSave/virDomainManagedSave reset id to -1 · 13488f55
      Daniel P. Berrange 提交于
      After successfull virDomainSave/virDomainManagedSave calls
      the guest will no longer be active, so the domain ID must
      be reset to -1
      
      * daemon/remote_generator.pl: Special case virDomainSave &
        virDomainManagedSave for same reason as virDomainDestroy
      13488f55
    • D
      Fix handling of VIR_EVENT_HANDLE_ERROR in QEMU monitor · 43917db3
      Daniel P. Berrange 提交于
      Commit 4454a9ef introduced bad
      behaviour on the VIR_EVENT_HANDLE_ERROR condition. This condition
      is only hit when an invalid FD is used in poll() (typically due
      to a double-close bug). The QEMU monitor code was treating this
      condition as non-fatal, and thus libvirt would poll() in a fast
      loop forever burning 100% CPU. VIR_EVENT_HANDLE_ERROR must be
      handled in the same way as VIR_EVENT_HANDLE_HANGUP, killing the
      QEMU instance.
      
      * src/qemu/qemu_monitor.c: Treat VIR_EVENT_HANDLE_ERROR as EOF
      43917db3
    • D
      Add call to sanlock_restrict() in QEMU lock driver · ebfb8c42
      Daniel P. Berrange 提交于
      In between fork and exec, a connection to sanlock is acquired
      and the socket file descriptor is intionally leaked to the
      child process. sanlock watches this FD for POLL_HANGUP to
      detect when QEMU has exited. We don't want a rogus/compromised
      QEMU from issuing sanlock RPC calls on the leaked FD though,
      since that could be used to DOS other guests. By calling
      sanlock_restrict() on the socket before exec() we can lock
      it down.
      
      * configure.ac: Check for sanlock_restrict API
      * src/locking/domain_lock.c: Restrict lock acquired in
        process startup phase
      * src/locking/lock_driver.h: Add VIR_LOCK_MANAGER_ACQUIRE_RESTRICT
      * src/locking/lock_driver_sanlock.c: Add call to sanlock_restrict
        when requested by VIR_LOCK_MANAGER_ACQUIRE_RESTRICT flag
      ebfb8c42
  3. 02 6月, 2011 14 次提交
    • E
      build: fix VPATH build break from previous patch · a2f9bd5b
      Eric Blake 提交于
      Partial revert of commit c3c30d4d.
      
      * docs/Makefile.am (internals/%.html.tmp): Restore MKDIR_P; it is
      needed for intermediate file after all.
      Reported by Daniel P. Berrange.
      a2f9bd5b
    • M
      screenshot: Expose the new API in virsh · 3ef7350c
      Michal Privoznik 提交于
      * tools/virsh.c: Add screenshot command
      * tools/virsh.pod: Document new command
      * src/libvirt.c: Fix off-be-one error
      3ef7350c
    • D
      libxl : fix the version for the managed save APIs · 4cc4aee6
      Daniel Veillard 提交于
      4cc4aee6
    • M
      libxl: adds managed save and restore support · 5b6c961e
      Markus Groß 提交于
      Based on the equivalent qemu driver code
      
      * src/libxl/libxl_driver.c: refactor the Start save and restore
        routines of the driver and adds the new entry points for
        managed saves handling
      5b6c961e
    • M
      libxl: get maximum memory of running domain · 47370d5a
      Markus Groß 提交于
      * src/libxl/libxl_driver.c: fix the libxlDomainGetInfo to return the
        maximum memory for running domain
      47370d5a
    • 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
      Support passing QEMU lock state to dest during migration · 7474560b
      Daniel P. Berrange 提交于
      Some lock managers associate state with leases, allowing a process
      to temporarily release its leases, and re-acquire them later, safe
      in the knowledge that no other process has acquired + released the
      leases in between.
      
      This is already used between suspend/resume operations, and must
      also be used across migration. This passes the lockstate in the
      migration cookie. If the lock manager uses lockstate, then it
      becomes compulsory to use the migration v3 protocol to get the
      cookie support.
      
      * src/qemu/qemu_driver.c: Validate that migration v2 protocol is
        not used if lock manager needs state transfer
      * src/qemu/qemu_migration.c: Transfer lock state in migration
        cookie XML
      7474560b
    • D
      Integrate the QEMU driver with the lock manager infrastructure · 12317957
      Daniel P. Berrange 提交于
      The QEMU integrates with the lock manager instructure in a number
      of key places
      
       * During startup, a lock is acquired in between the fork & exec
       * During startup, the libvirtd process acquires a lock before
         setting file labelling
       * During shutdown, the libvirtd process acquires a lock
         before restoring file labelling
       * During hotplug, unplug & media change the libvirtd process
         holds a lock while setting/restoring labels
      
      The main content lock is only ever held by the QEMU child process,
      or libvirtd during VM shutdown. The rest of the operations only
      require libvirtd to hold the metadata locks, relying on the active
      QEMU still holding the content lock.
      
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h,
        src/qemu/libvirtd_qemu.aug, src/qemu/test_libvirtd_qemu.aug:
        Add config parameter for configuring lock managers
      * src/qemu/qemu_driver.c: Add calls to the lock manager
      12317957
    • D
      Add initial docs about the lock managers · 395793a8
      Daniel P. Berrange 提交于
      395793a8
    • 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
      Add a 'nop' lock driver implementation. · db98851c
      Daniel P. Berrange 提交于
      To allow hypervisor drivers to assume that a lock driver impl
      will be guaranteed to exist, provide a 'nop' impl that is
      compiled into the library
      
      * src/Makefile.am: Add nop driver
      * src/locking/lock_driver_nop.c, src/locking/lock_driver_nop.h:
        Nop lock driver implementation
      * src/locking/lock_manager.c: Enable direct access of 'nop'
        driver, instead of dlopen()ing it.
      db98851c
    • 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
      Support leases in guest XML and lock manager · 1ea83207
      Daniel P. Berrange 提交于
      A lock manager may operate in various modes. The direct mode of
      operation is to obtain locks based on the resources associated
      with devices in the XML. The indirect mode is where the app
      creating the domain provides explicit leases for each resource
      that needs to be locked. This XML extension allows for listing
      resources in the XML
      
        <devices>
           ...
           <lease>
             <lockspace>somearea</lockspace>
             <key>thequickbrownfoxjumpsoverthelazydog</key>
             <target path='/some/lease/path' offset='23432'/>
           </lease>
           ...
        </devices>
      
      The 'lockspace' is a unique identifier for the lockspace which
      the lease is associated
      
      The 'key' is a unique identifier for the resource associated
      with the lease.
      
      The 'target' is the file on disk where the leases are held.
      
      * docs/schemas/domain.rng: Add lease schema
      * src/conf/domain_conf.c, src/conf/domain_conf.h: parsing and
        formatting for leases
      * tests/qemuxml2argvdata/qemuxml2argv-lease.args,
        tests/qemuxml2argvdata/qemuxml2argv-lease.xml,
        tests/qemuxml2xmltest.c: Test XML handling for leases
      1ea83207