Commit Graph

19 Commits

Author SHA1 Message Date
Chris Lalancette
cb51aa48a7 Fix up connection reference counting.
Currently the reference counting for connections is busted.  I
first noticed it while trying to use virConnectRef; it would
eventually cause a crash in the remote_internal driver, although
that was really just a victim.  Really, we should only call the
close callbacks on the methods when the references drop to 0.  To
accomplish this, move all of the close callbacks into
virUnrefConnect (since there are lots of internal users of that
function), and arrange for virConnectClose to call that.

V2: Make sure to drop the connection lock before we call the close
    callbacks, otherwise we could deadlock the daemon
V3: Fix up a crash when we got an error from one of the drivers

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-08-18 09:26:26 +02:00
Laine Stump
165ed4a00e Add bare format string to printf-derivatives troubles
* src/datatypes.c src/domain_conf.c src/interface_conf.c
  src/lxc_driver.c src/qemu_driver.c src/storage_backend.c src/virsh.c:
  add bare %s format string to printf-derivatives called with no format
  string
2009-07-23 18:27:47 +02:00
Laine Stump
647247740f Release conn lock before reporting errors (end)
* src/datatypes.c: more cleanup, where lock must be released before
  calling error handling which tries to get it.
2009-07-22 19:22:41 +02:00
Laine Stump
528d37bdfe Release conn lock before reporting interface errors
* src/datatypes.c: fix a lock problem on error handling, as the
  error report takes the lock, it must be released before, fixes
  the problem but just for Interface objects
2009-07-22 16:15:52 +02:00
Laine Stump
fb1b7d8ed0 Update modified mac address in place in virGetInterface
* src/datatypes.c: handle the nasty case where an interface
  mac address change, while it's already in use
2009-07-22 16:07:26 +02:00
Laine Stump
9734c81f3a virGetinterface matching of MAC and interface name
MAC address of a particular interface may change over time, and the
reduced virInterface object (which contains just name and mac) needs
to reflect these changes. Since we can't modify the mac address of an
existing virInterface (some other thread may currently be using it) we
just create a new virInterface, and let the old one die a dignified
death when its refct goes to 0.
* src/datatypes.c: fix the matching and lifetime of virInterface object
  accordingly
2009-07-21 15:37:20 +02:00
Daniel P. Berrange
8a1a2ac558 Fix Win32 portability problems with 'inteface' symbol clash 2009-05-29 14:29:22 +00:00
Daniel Veillard
73bc011483 Add the Interface config APIs
* configure.in include/libvirt/libvirt.h[.in]
  include/libvirt/virterror.h qemud/remote.c
  qemud/remote_dispatch_args.h qemud/remote_dispatch_prototypes.h
  qemud/remote_dispatch_ret.h qemud/remote_dispatch_table.h
  qemud/remote_protocol.[chx] src/Makefile.am src/datatypes.c
  src/datatypes.h src/driver.h src/libvirt.c src/remote_internal.c
  src/virterror.c src/libvirt_private.syms src/libvirt_public.syms:
  Add the Interface config APIs and remote stubs for those, patch
  by Laine Stump
* AUTHORS: add Laine
daniel
2009-05-20 14:26:49 +00:00
Daniel P. Berrange
6582d5872d Make hash destructors call internal unref methods to free objects 2009-05-11 15:27:37 +00:00
Daniel P. Berrange
e4c65831e3 Misc fixes uncovered by OOM testing 2009-04-01 10:31:01 +00:00
Jim Meyering
bc18a91f91 error-reporting calls using VIR_ERR_NO_MEMORY: use virReportOOMError instead
* src/uml_conf.c (VIR_FROM_THIS): Define to VIR_FROM_UML.
* src/xs_internal.c (VIR_FROM_THIS): Define to VIR_FROM_XEN.
* src/xml.c (VIR_FROM_THIS): Define to VIR_FROM_XML.
* src/stats_linux.c (VIR_FROM_THIS): Define to VIR_FROM_STATS_LINUX.
* src/datatypes.c (VIR_FROM_THIS): Define to VIR_FROM_NONE.
* src/lxc_conf.c (VIR_FROM_THIS): Define to VIR_FROM_LXC.
* src/libvirt.c (VIR_FROM_THIS): Define to VIR_FROM_NONE.
* src/node_device_conf.c (VIR_FROM_THIS): Define to VIR_FROM_NODEDEV.
* src/openvz_conf.c (VIR_FROM_THIS): Define to VIR_FROM_OPENVZ.
* src/openvz_driver.c (VIR_FROM_THIS): Define to VIR_FROM_OPENVZ.
* src/conf.c (VIR_FROM_THIS): Define to VIR_FROM_CONF.
Note: this loses config_filename:config_lineno diagnostics,
but that's ok.
* src/node_device.c (VIR_FROM_THIS): Define to VIR_FROM_NODEDEV.
* src/sexpr.c (VIR_FROM_THIS): Define to VIR_FROM_SEXPR.
* po/POTFILES.in: remove src/sexpr.c and src/lxc_conf.c
2009-01-29 12:10:32 +00:00
Daniel P. Berrange
ead04dcbe8 Thread local error reporting 2009-01-20 12:01:45 +00:00
Daniel P. Berrange
4dac0a1105 Generic internal threads API 2009-01-15 19:56:05 +00:00
Daniel P. Berrange
e8a4ea75a3 Merge all return paths from node device driver APIs 2008-12-04 21:46:34 +00:00
Daniel P. Berrange
0793e73c02 Public API for node device enumeration (David Lively) 2008-11-21 12:19:22 +00:00
Daniel P. Berrange
618276de19 Push URI probing logic down into individual drivers 2008-11-17 11:44:51 +00:00
Daniel P. Berrange
25047e7cf8 Use a versioned linker script 2008-11-17 11:03:25 +00:00
Daniel Veillard
df93e1ee24 add new logging module, and move existing definitions there
* src/logging.c src/logging.h proxy/Makefile.am proxy/libvirt_proxy.c
  src/Makefile.am src/cgroup.c src/datatypes.c src/domain_event.c
  src/internal.h src/libvirt.c src/lxc_container.c src/lxc_controller.c
  src/lxc_driver.c src/proxy_internal.c src/qemu_driver.c
  src/remote_internal.c src/storage_backend_disk.c src/util.c
  src/veth.c src/xen_internal.c src/xen_unified.c src/xend_internal.c:
  add new logging module, and move existing definitions there
Daniel
2008-11-06 16:36:07 +00:00
Daniel P. Berrange
6ace5a39c3 Move some API declarations out of internal.h & hash.c into dedicated files 2008-11-04 23:22:06 +00:00