Commit Graph

126 Commits

Author SHA1 Message Date
Jim Meyering
f5f530f33f Avoid virsh leaks due to missing virDomainFree(dom) calls
* src/virsh.c (cmdDomuuid): Add missing virDomainFree call.
(cmdAttachDevice): Likewise.
(cmdDetachDevice): Likewise.
2008-01-30 19:58:59 +00:00
Jim Meyering
a1d2d2b21c src/virsh.c (cmdCapabilities): Plug a small leak. 2008-01-30 19:57:54 +00:00
Jim Meyering
2367caa327 Also detect and remove unnecessary if-before-xmlXPathFreeContext.
* build-aux/find-unnecessary-if-before-free: Update regexp.
* src/openvz_conf.c: Remove unnecessary "if (P)"-before xmlXPathFreeContext.
* src/qemu_conf.c: Likewise.
* src/virsh.c: Likewise.
* src/xm_internal.c: Likewise.
* src/xml.c: Likewise.
* tests/xmlrpctest.c: Likewise.
2008-01-29 18:23:43 +00:00
Jim Meyering
a378188194 Enable the <config.h>-requiring test; fix violations
Use <config.h>, not "config.h", per autoconf documentation.
* Makefile.cfg (local-checks-to-skip) [sc_require_config_h]: Enable.
* .x-sc_require_config_h: New file, to list exempted files.
* Makefile.am (EXTRA_DIST): Add .x-sc_require_config_h.
2008-01-29 18:15:54 +00:00
Jim Meyering
acff2d11ac Given code like if (foo) free (foo); remove the useless "if (foo) " part.
Likewise, given if (foo != NULL) free (foo); remove the useless "if" test.

* proxy/libvirt_proxy.c: Remove unnecessary "if" test before free.
* python/generator.py: Likewise.
* qemud/qemud.c: Likewise.
* src/buf.c: Likewise.
* src/conf.c: Likewise.
* src/hash.c: Likewise.
* src/iptables.c: Likewise.
* src/libvirt.c: Likewise.
* src/openvz_conf.c: Likewise.
* src/qemu_conf.c: Likewise.
* src/qemu_driver.c: Likewise.
* src/remote_internal.c: Likewise.
* src/test.c: Likewise.
* src/virsh.c: Likewise.
* src/virterror.c: Likewise.
* src/xen_internal.c: Likewise.
* src/xen_unified.c: Likewise.
* src/xend_internal.c: Likewise.
* src/xm_internal.c: Likewise.
* src/xml.c: Likewise.
* src/xmlrpc.c: Likewise.
* src/xs_internal.c: Likewise.
* tests/testutils.c: Likewise.
* tests/xencapstest.c: Likewise.
* tests/xmconfigtest.c: Likewise.
2008-01-29 17:41:07 +00:00
Daniel P. Berrange
45738083a6 Use virFileReadAll in virsh.c 2008-01-21 15:27:14 +00:00
Jim Meyering
42e5d20ae9 Avoid format string warnings.
* src/virsh.c: Add "%s" where needed.
* src/proxy_internal.c: Likewise.
2008-01-16 17:13:23 +00:00
Richard W.M. Jones
0d14fc0cbb Fri Dec 7 14:49:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* src/console.c, src/console.h, src/virsh.c: Disable
	  text console on Windows.
	* src/libvirt.c: Use replacement getpass from Gnulib.
	* src/libvirt.c: Initialize Winsock before use.
	* src/remote_internal.c: Header file fixes for Windows.
	  Don't fail if AI_ADDRCONFIG isn't defined.  Disable
	  unsupported stuff under Windows.
	* src/uuid.c: ENODATA unavailable on Windows, use EIO instead.
	* src/virsh.c: No uid_t / getuid on Windows.
	* src/virsh.c: No O_SYNC on Windows.
2007-12-07 14:56:37 +00:00
Richard W.M. Jones
efd495d667 Thu Dec 6 16:32:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* src/virsh.c: The prompt should depend on readonly status,
	  not on the UID.
2007-12-06 16:36:21 +00:00
Daniel Veillard
7633453cfa * configure.in src/Makefile.am src/virsh.c: fix compilation problems
when readline headers were found but not the library
Daniel
2007-12-06 10:24:52 +00:00
Daniel P. Berrange
e332ccdf71 Wire up SASL interaction callbacks to libvirt callbacks. Provide default callback impl 2007-12-05 18:55:04 +00:00
Daniel P. Berrange
ca71b87cb0 Quit virsh immediately if connection open fails, rather than giving a non-functional interactive shell 2007-12-05 16:24:22 +00:00
Richard W.M. Jones
4338271f1a Tue Dec 4 17:47:01 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* configure.in: curses is not actually required to build libvirt
	* configure.in, src/virsh.c: Make readline optional.  If not
	  available then virsh is built without support for command
	  line editing.
2007-12-04 18:27:52 +00:00
Daniel P. Berrange
2b3c49b6ab Fix numerous memory leaks 2007-12-01 15:45:25 +00:00
Richard W.M. Jones
ba75647b55 Thu Nov 29 09:15:00 GMT 2007 Richard W.M. Jones <rjones@redhat.com>
* src/virsh.c: Added #include <time.h> so it can compile
          on CentOS 4 (Carl Jones).
2007-11-29 09:18:04 +00:00
Richard W.M. Jones
df0525a911 Wed Nov 28 14:20:00 GMT 2007 Richard W.M. Jones <rjones@redhat.com>
* src/virsh.c: Missing comma.
2007-11-28 14:22:30 +00:00
Jim Meyering
55311d6c38 src/virsh.c (vshCloseLogFile): Diagnose close/write failure. 2007-11-28 13:22:33 +00:00
Daniel Veillard
a500a479b0 Begin fixing uses of strtol: parse integers more carefully.
Patch from Jim Meyering
* src/internal.h: Include <errno.h>.
  Define new static inline function, xstrtol_i.
* src/virsh.c: Detect integer overflow in domain ID number
  in vshCommandOptDomainBy. Detect overflow and invalid port
  number suffix in cmdVNCDisplay.
* src/xend_internal.c: Parse CPU number more carefully in
  xenDaemonDomainGetVcpus.
* tests/int-overflow: New script. Test for the above-fixed bug.
* tests/Makefile.am: Add int-overflow to TESTS. Define
  TESTS_ENVIRONMENT, to propagate $abs_top_* variables into the
  int-overflow script. Adapt the "valgrind" rule not to clobber
  new TESTS_ENVIRONMENT.
Daniel
2007-11-12 14:00:32 +00:00
Daniel Veillard
906c1f5055 * src/virsh.c: initialize a couple of variable to avoid warnings
when compiling with Fedora.
Daniel
2007-11-08 18:07:02 +00:00
Daniel Veillard
710547590b * src/virsh.c: patch from Jim Meyering to use gcc's printf attribute.
Daniel
2007-11-08 18:00:52 +00:00
Daniel Veillard
b31ed75bff * src/virsh.c: patch from Jim Meyering to correct vshCommandOptInt
indentation
Daniel
2007-11-08 16:14:12 +00:00
Daniel Veillard
31eade077e * src/virsh.c: patch from Masayuki Sunou to fix parameter
validation of virsh schedinfo parameters.
Daniel
2007-11-06 09:41:18 +00:00
Daniel Veillard
b5a3d4da61 * src/virsh.c: use virNodeGetFreeMemory() for freecell without
argument
* src/libvirt_sym.version: export virNodeGetFreeMemory()
Daniel
2007-09-30 13:22:16 +00:00
Daniel P. Berrange
fb741174ad Solaris portability fix from Mark Johnson. Remove use of anonymous union members 2007-09-29 18:16:26 +00:00
Daniel Veillard
4bf3bc9eda * include/libvirt/libvirt.h[.in] src/driver.h src/openvz_driver.c
src/qemu_driver.c src/remote_internal.c src/test.c
  src/xen_internal.[ch] src/xen_unified.c src/xend_internal.[ch]
  src/libvirt.c src/libvirt_sym.version: adding NUMA support patches
  from Beth Kon adding new virNodeGetCellsFreeMemory entry point
  and extending the virConnectGetCapabilities one. Fix a couple of
  issues in the patch and add to exported symbols from shared lib.
* docs/virsh.pod docs/virsh.1 src/virsh.c: added new command
  freecell to get the available memory on the node or in a NUMA cell.
* docs/*: updated and regenerated the documentation
Daniel
2007-09-28 14:28:12 +00:00
Daniel Veillard
b4d74032b0 * src/virsh.c: apply patch from Masayuki Sunou to fix the exit value
of vncdisplay command.
Daniel
2007-08-29 07:47:09 +00:00
Daniel Veillard
3a4c8d219c * src/xs_internal.c: cleanup of memory leaks from Masayuki Sunou
* src/virsh.c: another memory leaks of virsh schedinfo cleanup from
  Saori Fukuta
* po/*: string localization merge/update
Daniel
2007-08-21 11:53:52 +00:00
Richard W.M. Jones
442a15770c Tue Aug 21 10:58:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
* src/libvirt.c (virDomainBlockStats, virDomainInterfaceStats):
	  Added block device and network interface statistics.
	* src/xen_internal.c: Support for stats from Xen domains.
	* qemud/remote.c, qemud/remote_protocol.x, qemud/remote_internal.c:
	  Support for fetching device and network interface stats
	  across remote connections.
	* src/virsh.c: Added 'virsh domblkstat' and 'virsh domifstat'
	  commands to display stats.
	* docs/libvir.html, docs/hvsupport.html: Updated hvsupport
	  documentation.
2007-08-21 10:08:12 +00:00
Richard W.M. Jones
81005437f4 Tue Aug 21 10:21:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
* src/libvirt.c (virDomainMigrate): Added virDomainMigrate
	  API call.
	* src/xend_internal.c, src/xen_unified.c: Support for migration
	  of Xen domains.
	* src/xen_internal.c: Xen capabilities indicates level of
	  support for migration.
	* qemud/remote.c, qemud/remote_protocol.x, src/remote_internal.c:
	  Support for migration between remote hypervisors.
	* src/virsh.c: Added 'virsh migrate' command.
	* docs/libvir.html, docs/hvsupport.html: Updated hvsupport
	  documentation.
2007-08-21 09:31:12 +00:00
Daniel Veillard
0ee4415cc6 * src/virsh.c: vshCommandOptInt was broken as it would not
detect non-int inputs, problem raised by Masayuki Sunou
Daniel
2007-08-16 13:21:36 +00:00
Daniel Veillard
d7b5e2c2d8 * src/virsh.c: fixed 2 small bugs in setvcpus command, after
Atsushi SAKAI pointed out a value checking problem
Daniel
2007-08-15 10:18:33 +00:00
Daniel Veillard
f39e1b8860 * src/virsh.c: patch from Atsushi SAKAI fixing schedinfo synopsys
Daniel
2007-08-14 07:07:57 +00:00
Richard W.M. Jones
9d5e267e9a Tue Aug 7 16:24:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
* src/virsh.c: Include <time.h> (bug reported by Jan Michael).
2007-08-07 15:26:51 +00:00
Daniel Veillard
1d7164058c * src/virsh.c docs/virsh.pod virsh.1: added a ttyconsole command,
this should fix bug #239687
Daniel
2007-07-26 08:41:16 +00:00
Daniel Veillard
ea6279cb91 * src/virsh.c: fix an error in the default help string, bug #247197
Daniel
2007-07-06 15:05:19 +00:00
Richard W.M. Jones
9cd405497f Wed Jul 4 10:14:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
* src/conf.c, src/test.c, src/xen_internal.c: Readd checking
          of errors from virBuffer functions.
        * src/sexpr.c: Add comment about use of _GNU_SOURCE.
        * src/virsh.c: Remove use of _GNU_SOURCE / isblank.
        * src/xml.c, tests/Makefile.am: Minor cleanup.
2007-07-04 09:16:23 +00:00
Daniel Veillard
6bdad268f4 * src/virsh.c: applied patch from Masayuki Sunou to remove leaks
of domains references in some commands.
Daniel
2007-06-29 13:45:50 +00:00
Richard W.M. Jones
2be812bbc9 Tue Jun 26 12:40:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
* include/libvirt/libvirt.h.in, src/libvirt.c: (and numerous
	  other files) Added support for virConnectGetHostname
	  and virConnectGetURI calls.
2007-06-26 11:42:46 +00:00
Richard W.M. Jones
17e1ee3cc7 Wed Jun 20 18:21:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
* src/virsh.c: 'virsh help command' now works even if we could
	  not get a connection to the hypervisor.  Rearranged the list
	  of commands to be in alphabetical order.
2007-06-20 17:22:09 +00:00
Richard W.M. Jones
3b7046a743 Tue Jun 19 10:30:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
* src/virsh.c: vcpupin command now documented properly and
          gives clearer error messages if the cpulist is wrong
          (Masayuki Sunou).
2007-06-19 09:32:04 +00:00
Daniel Veillard
a03844f8ca * src/xend_internal.c: drop the release information as this
is usually garbage ending up polluting minor and major numbers.
* src/virsh.c: applied patch from Masayuki Sunou providing a pair
  of alternate attach/detach commands
Daniel
2007-06-19 09:12:55 +00:00
Daniel Veillard
af933f6ff0 * src/virsh.c: applied SetMem cleanup patch from Mark Johnson
Daniel
2007-06-18 08:33:08 +00:00
Richard W.M. Jones
6668e64766 Fri Jun 15 16:21:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
* configure.in: Solaris header file fixes (Mark Johnson).
2007-06-15 15:24:20 +00:00
Richard W.M. Jones
a770b4c357 Fri Jun 15 14:42:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
* src/test.c, src/virsh.c, src/xend_internal.c, src/xm_internal.c:
	  Replace calls to deprecated {,r}index with str{,r}chr.
2007-06-15 13:44:19 +00:00
Richard W.M. Jones
b69fcc15b4 Fri Jun 15 08:53:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
* src/internal.h, src/virsh.c: Replace _N with N_ so that
          Solaris builds work (Mark Johnson).
        * src/virsh.c: Add a couple of missing error messages (Mark
          Johnson).
        * python/types.c: Fix NULL pointer deref on DEBUG build
          (Mark Johnson).
        * src/virsh.c: Spelling fix (Mark Johnson).
2007-06-15 08:18:55 +00:00
Daniel Veillard
fce0ce6f85 tiny fix on last patch, Daniel 2007-06-13 13:13:59 +00:00
Daniel Veillard
7c85b83736 * src/virsh.c: patch from Saori Fukuta for messages
* *.po: updated with the patch from Saori Fukuta and merge from
  the i18n CVS base.
Daniel
2007-06-13 09:32:44 +00:00
Daniel Veillard
7eed474dd3 * src/virsh.c: added a logging option to a file based on
Nobuhiro Itou patch
* src/xen_internal.c: small TODO comment from Atsushi SAKAI
Daniel
2007-06-06 12:24:31 +00:00
Daniel Veillard
652f3bb13b * include/libvirt/libvirt.h include/libvirt/libvirt.h.in
src/driver.h src/libvirt.c src/libvirt_sym.version
  src/proxy_internal.c src/qemu_internal.c src/test.c
  src/virsh.c src/xen_internal.c src/xen_internal.h src/xen_unified.c
  src/xend_internal.c src/xm_internal.c src/xs_internal.c:
  Applied patches from Atsushi SAKAI to add the scheduler API,
  with patch from Rich Jones for error handing, and a number
  of cleanups and more error checking from me
Daniel
2007-06-05 12:06:08 +00:00
Daniel Veillard
7b88f59ce4 * src/virsh.c src/xen_internal.c src/xend_internal.c: memory leaks
fixed by a patch from Masayuki Sunou
Daniel
2007-05-29 13:55:19 +00:00