1. 26 1月, 2013 6 次提交
    • J
      libxl: Domain event handler improvements · 70291149
      Jim Fehlig 提交于
      Since libxl provides the domain ID in the event handler callback,
      find the domain object based on the ID.  This approach prevents
      processing the callback on a domain that has already been reaped.
      
      Also, similar to the xl implementation, ignore the SUSPEND shutdown
      reason.  By calling libxl_domain_suspend(), we know a shutdown
      event with SUSPEND reason will be generated, but it can be safely
      ignored since any subsequent cleanup will be done by the callers.
      70291149
    • J
      libxl: Fix removing non-persistent domain after save · 02ed255e
      Jim Fehlig 提交于
      libxlDoDomainSave() was removing non-persistent domains, but
      required callers to have the virDomainObj locked.  Callers could
      potentially unlock an already freed virDomainObj.  Move this
      logic to the callers of libxlDoDomainSave().
      02ed255e
    • J
      libxl: Explicitly remove timeouts · ce33422d
      Jim Fehlig 提交于
      I've noticed that libxl can invoke timeout reregister/modify hooks
      after returning from libxl_ctx_free.  Explicitly remove the
      timeouts before freeing the libxl ctx to avoid executing hooks on
      stale objects.
      ce33422d
    • J
      libxl: Fix race between destruction of objects · 889ce746
      Jim Fehlig 提交于
      It is possible to destroy and cleanup a VM, resulting in freeing the
      libxlDomainObjPrivate object and associated libxl ctx, before all fds and
      timeouts have been deregistered and destroyed.
      
      Fix this race by incrementing the reference count on libxlDomainObjPrivate
      for each fd and timeout registration.  Only when all fds and timeouts are
      deregistered and destroyed will the libxlDomainObjPrivate be destroyed.
      889ce746
    • J
      libxl: Fix races in libxl event code · e0622ca2
      Jim Fehlig 提交于
      The libxl driver is racy in it's interactions with libxl and libvirt's
      event loop.  The event loop can invoke callbacks after libxl has
      deregistered the event, and possibly access freed data associated with
      the event.
      
      This patch fixes the race by converting libxlDomainObjPrivate to a
      virObjectLockable, and locking it while executing libxl upcalls and
      libvirt event loop callbacks.
      
      Note that using the virDomainObj lock is not satisfactory since it may
      be desirable to hold the virDomainObj lock even when libxl events such
      as reading and writing to xenstore need processed.
      e0622ca2
    • J
      libxl: Fix handling of timeouts · 04172610
      Jim Fehlig 提交于
      xen-unstable changeset 26469 makes changes wrt modifying and deregistering
      timeouts.
      
      First, timeout modify callbacks will only be invoked with an
      abs_t of {0,0}, i.e. make the timeout fire immediately.  Prior to this
      commit, timeout modify callbacks were never invoked.
      
      Second, timeout deregister hooks will no longer be called.
      
      This patch makes changes in the libvirt libxl driver that should be
      compatible before and after changeset 26469.
      
      While at it, fix a potential overflow in the timeout register callback.
      04172610
  2. 17 1月, 2013 5 次提交
  3. 16 1月, 2013 2 次提交
  4. 21 12月, 2012 6 次提交
  5. 19 12月, 2012 2 次提交
  6. 07 12月, 2012 1 次提交
    • J
      Convert libxl driver to Xen 4.2 · dfa1e1dd
      Jim Fehlig 提交于
      Based on a patch originally authored by Daniel De Graaf
      
        http://lists.xen.org/archives/html/xen-devel/2012-05/msg00565.html
      
      This patch converts the Xen libxl driver to support only Xen >= 4.2.
      Support for Xen 4.1 libxl is dropped since that version of libxl is
      designated 'technology preview' only and is incompatible with Xen 4.2
      libxl.  Additionally, the default toolstack in Xen 4.1 is still xend,
      for which libvirt has a stable, functional driver.
      dfa1e1dd
  7. 04 12月, 2012 1 次提交
  8. 30 11月, 2012 1 次提交
  9. 02 11月, 2012 1 次提交
  10. 20 10月, 2012 1 次提交
    • E
      storage: use enum for disk driver type · e5e8d5d0
      Eric Blake 提交于
      Actually use the enum in the domain conf structure.
      
      * src/conf/domain_conf.h (_virDomainDiskDef): Store enum rather
      than string for disk type.
      * src/conf/domain_conf.c (virDomainDiskDefFree)
      (virDomainDiskDefParseXML, virDomainDiskDefFormat)
      (virDomainDiskDefForeachPath): Adjust users.
      * src/xenxs/xen_sxpr.c (xenParseSxprDisks, xenFormatSxprDisk):
      Likewise.
      * src/xenxs/xen_xm.c (xenParseXM, xenFormatXMDisk): Likewise.
      * src/vbox/vbox_tmpl.c (vboxAttachDrives): Likewise.
      * src/libxl/libxl_conf.c (libxlMakeDisk): Likewise.
      e5e8d5d0
  11. 21 9月, 2012 1 次提交
  12. 18 9月, 2012 1 次提交
  13. 30 8月, 2012 1 次提交
    • P
      vcpupin: Fix returning of arrays from virDomainVcpuPinAdd · 077e7bf5
      Peter Krempa 提交于
      virDomainVcpuPinAdd does a realloc on vcpupin_list if the new vcpu pin
      definition doesn't fit into the array. The list is an array of pointers
      but the function definition didn't support returning the changed pointer
      to the caller if it was realloced. This caused segfaults if realloc
      would change the base pointer.
      077e7bf5
  14. 22 8月, 2012 1 次提交
  15. 14 8月, 2012 1 次提交
    • O
      Destroy virdomainlist.[ch] · bb705e25
      Osier Yang 提交于
      As the consensus in:
      https://www.redhat.com/archives/libvir-list/2012-July/msg01692.html,
      this patch is to destroy conf/virdomainlist.[ch], folding the
      helpers into conf/domain_conf.[ch].
      
      * src/Makefile.am:
        - Various indention fixes incidentally
        - Add macro DATATYPES_SOURCES (datatypes.[ch])
        - Link datatypes.[ch] for libvirt_lxc
      
      * src/conf/domain_conf.c:
        - Move all the stuffs from virdomainlist.c into it
        - Use virUnrefDomain and virUnrefDomainSnapshot instead of
          virDomainFree and virDomainSnapshotFree, which are defined
          in libvirt.c, and we don't want to link to it.
        - Remove "if" before "free" the object, as virObjectUnref
          is in the list "useless_free_options".
      
      * src/conf/domain_conf.h:
        - Move all the stuffs from virdomainlist.h into it
        - s/LIST_FILTER/LIST_DOMAINS_FILTER/
      
      * src/libxl/libxl_driver.c:
        - s/LIST_FILTER/LIST_DOMAINS_FILTER/
        - no (include "virdomainlist.h")
      
      * src/libxl/libxl_driver.c: Likewise
      
      * src/lxc/lxc_driver.c: Likewise
      
      * src/openvz/openvz_driver.c: Likewise
      
      * src/parallels/parallels_driver.c: Likewise
      
      * src/qemu/qemu_driver.c: Likewise
      
      * src/test/test_driver.c: Likewise
      
      * src/uml/uml_driver.c: Likewise
      
      * src/vbox/vbox_tmpl.c: Likewise
      
      * src/vmware/vmware_driver.c: Likewise
      
      * tools/virsh-domain-monitor.c: Likewise
      
      * tools/virsh.c: Likewise
      bb705e25
  16. 07 8月, 2012 1 次提交
  17. 23 7月, 2012 1 次提交
    • O
      Desert the FSF address in copyright · f9ce7dad
      Osier Yang 提交于
      Per the FSF address could be changed from time to time, and GNU
      recommends the following now: (http://www.gnu.org/licenses/gpl-howto.html)
      
        You should have received a copy of the GNU General Public License
        along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
      
      This patch removes the explicit FSF address, and uses above instead
      (of course, with inserting 'Lesser' before 'General').
      
      Except a bunch of files for security driver, all others are changed
      automatically, the copyright for securify files are not complete,
      that's why to do it manually:
      
        src/security/security_selinux.h
        src/security/security_driver.h
        src/security/security_selinux.c
        src/security/security_apparmor.h
        src/security/security_apparmor.c
        src/security/security_driver.c
      f9ce7dad
  18. 20 7月, 2012 2 次提交
  19. 20 6月, 2012 1 次提交
    • P
      drivers: Implement virListAllDomains for drivers using virDomainObj · 33dc8cf0
      Peter Krempa 提交于
      This patch adds support for listing all domains into drivers that use
      the common virDomainObj implementation: libxl, lxc, openvz, qemu, test,
      uml, vmware.
      
      For drivers that don't support managed save images the guests are
      treated as if they had none, so filtering guests that do have such an
      image on this driver succeeds and produces 0 results.
      33dc8cf0
  20. 19 6月, 2012 1 次提交
  21. 22 5月, 2012 2 次提交
    • E
      build: fix unused variable after last patch · b8e6021e
      Eric Blake 提交于
      The previous commit (2cb0899e) left a dead variable behind.
      
      * src/libxl/libxl_driver.c (libxlClose): Drop dead variable.
      b8e6021e
    • D
      Fix potential events deadlock when unref'ing virConnectPtr · 2cb0899e
      Daniel P. Berrange 提交于
      When the last reference to a virConnectPtr is released by
      libvirtd, it was possible for a deadlock to occur in the
      virDomainEventState functions. The virDomainEventStatePtr
      holds a reference on virConnectPtr for each registered
      callback. When removing a callback, the virUnrefConnect
      function is run. If this causes the last reference on the
      virConnectPtr to be released, then virReleaseConnect can
      be run, which in turns calls qemudClose. This function has
      a call to virDomainEventStateDeregisterConn which is intended
      to remove all callbacks associated with the virConnectPtr
      instance. This will try to grab a lock on virDomainEventState
      but this lock is already held. Deadlock ensues
      
      Thread 1 (Thread 0x7fcbb526a840 (LWP 23185)):
      
      Since each callback associated with a virConnectPtr holds a
      reference on virConnectPtr, it is impossible for the qemudClose
      method to be invoked while any callbacks are still registered.
      Thus the call to virDomainEventStateDeregisterConn must in fact
      be a no-op. Thus it is possible to just remove all trace of
      virDomainEventStateDeregisterConn and avoid the deadlock.
      
      * src/conf/domain_event.c, src/conf/domain_event.h,
        src/libvirt_private.syms: Delete virDomainEventStateDeregisterConn
      * src/libxl/libxl_driver.c, src/lxc/lxc_driver.c,
        src/qemu/qemu_driver.c, src/uml/uml_driver.c: Remove
        calls to virDomainEventStateDeregisterConn
      2cb0899e
  22. 30 3月, 2012 1 次提交