Commit Graph

870 Commits

Author SHA1 Message Date
Daniel Veillard
dc232cdf1b * src/bridge.c src/virsh.c: typo fixes from Atsushi SAKAI
daniel
2008-03-13 09:21:41 +00:00
Daniel Veillard
af1c7f96a8 * src/qemu_conf.c src/qemu_driver.c: patch from Cole Robinson
fixing CD Rom change on live QEmu/KVM domains.
Daniel
2008-03-13 09:17:45 +00:00
Daniel P. Berrange
77ed8ded7b Remove unused variable 2008-03-11 16:01:23 +00:00
Daniel P. Berrange
8d2d44ad05 Remove use of polkit-grant. Keep stdio open when running polkit-auth 2008-03-11 14:49:04 +00:00
Daniel P. Berrange
c3501d4792 Don't force Xen connections to readonly when non-root 2008-03-11 14:25:49 +00:00
Daniel Veillard
d4cbf4c624 * src/xend_internal.c: applied patch from Cole Robinson to not
loose the boot tag when defining a fully virtualized xen domain
Daniel
2008-03-07 09:23:30 +00:00
Richard W.M. Jones
2a4c20437d Make iSCSI login actually work
* src/storage_backend_iscsi.c: Make iSCSI login actually work
	  (Chris Lalancette).
2008-03-04 20:02:34 +00:00
Richard W.M. Jones
4d6a8a1c0a Report error when vcpupin is given bad vCPU number.
* src/virsh.c: Report error when vcpupin is given bad vCPU number
	  (Shigeki Sakamoto).
2008-03-04 19:59:56 +00:00
Jim Meyering
0075d7e74a fix typo in comment 2008-03-03 23:06:02 +00:00
Jim Meyering
869f8d0e7d Also ignore leading zeros when comparing MAC addresses.
* src/util.c: Include <ctype.h>.
(TOLOWER): Define.
(__virMacAddrCompare): Rewrite to also ignore leading zeros.
2008-03-03 20:39:52 +00:00
Daniel Veillard
65c4379c53 * src/capabilities.c: Cole Robinson pointed out a well formedness
problem when generating the capabilities in the test driver.
Daniel
2008-03-03 20:21:21 +00:00
Jim Meyering
4090a0870c Don't use first byte of string as a pointer.
* src/qemu_conf.c (qemudReportError): Use the pointer, errorMessage,
not its first byte, errorMessage[0].
2008-03-03 18:11:16 +00:00
Jim Meyering
1de5bace80 Plug two leaks: host.migrateTrans and arch.name
* src/capabilities.c (virCapabilitiesFree): Free host.migrateTrans.
(virCapabilitiesFreeGuest): Free arch.name member.
2008-03-03 13:15:14 +00:00
Jim Meyering
47a4c0fa0b Plug virCapabilities*GuestDomain leak.
* src/capabilities.c (virCapabilitiesFreeGuestDomain): Free dom->type.
(virCapabilitiesAddGuestDomain): Remove duplicate strdup stmt.
2008-03-03 13:14:26 +00:00
Jim Meyering
ba52fcbcdf Rewrite test-coverage rules to accommodate multiple .o files per .c.
* src/Makefile.am (cov): Rewrite rule to merge gcov results corresponding
to two .o files: the libvirt_la- one, and the libvirt_test_la- one.
(tst): Remove unused rule.
* configure.in (LV_LIBTOOL_OBJDIR): Define and AC_SUBST.
2008-02-28 17:07:37 +00:00
Jim Meyering
9262d88e28 Avoid link errors with "configure --disable-shared".
* src/Makefile.am: Create a convenience library, libvirt_test.la,
and don't restrict access to *its* symbols.
* tests/Makefile.am (LDADDS): Add ../src/libvirt_test.la, so that
"configure --disable-shared" no longer provokes link errors.
(LIBVIRT): Remove definition.
(LDADDS): Remove use.
($(LIBVIRT)): Remove rule.
(LDADDS): Use the new convenience library instead.
(CLEANFILES): Define.
* docs/examples/index.py (dump_Makefile): Append $(COVERAGE_LDFLAGS),
to the LDADDS definition, to avoid link error with the combination of
--enable-test-coverage and --disable-shared.
* docs/examples/Makefile.am: Regenerate.
* docs/examples/index.html: Likewise.
* qemud/Makefile.am (libvirtd_LDFLAGS): Append $(COVERAGE_LDFLAGS).
* src/libvirt_sym.version: Remove some SP-before-TAB.
2008-02-28 17:06:32 +00:00
Daniel Veillard
004ff90483 Fix qemudReportError.
* src/qemu_conf.c: applied patch from Cole Robinson to use virErrorMsg
  in qemudReportError.
Daniel
2008-02-28 11:17:49 +00:00
Daniel P. Berrange
9699e372c2 Set MAC address on TUN device for Xenner compatability 2008-02-28 01:23:14 +00:00
Richard W.M. Jones
92a1e14b0b virMacAddrCompare for comparing MAC addresses
* src/util.c, src/util.h, src/libvirt_sym.version: Added
	  virMacAddrCompare utility function for comparing MAC
	  addresses.
	* src/virsh.c, src/xm_internal.c: Use virMacAddrCompare
	  to compare addresses.  (Shigeki Sakamoto and Richard Jones).
2008-02-27 16:14:44 +00:00
Jim Meyering
fa4ab3325b Avoid "make distcheck" failure.
* src/Makefile.am (virsh_SOURCES): Add util-lib.h.
2008-02-27 15:17:45 +00:00
Jim Meyering
d7cdc28431 Fix a "make syntax-check" failure.
* src/capabilities.c: Include <config.h> from the .c file,
* src/capabilities.h: ... not from the .h file.
2008-02-27 14:40:19 +00:00
Richard W.M. Jones
b4882504ea Fix typos (Atsushi SAKAI). 2008-02-27 10:37:19 +00:00
Daniel P. Berrange
63bc5dd3e1 Add formal internal capabilities API and update drivers to use it 2008-02-27 04:35:08 +00:00
Richard W.M. Jones
727c5601ec Implement virDomainBlockStats for QEMU/KVM.
* src/qemu_driver.c: Implement virDomainBlockStats for QEMU/KVM
	  using QEMU/KVM 'info blockstats' command (Richard Jones).
	* src/qemu_driver.c, src/qemu_conf.h: const-correctness
	  fixes (Jim Meyering).
2008-02-26 18:41:43 +00:00
Richard W.M. Jones
242fe3d401 No address attribute in Xen domain XML.
* src/xm_internal.c: handle the case where <mac/> clause
	  in Xen domain interface has no address attribute
	  (Shigeki Sakamoto).
2008-02-26 18:31:57 +00:00
Daniel Veillard
ea47a7d4e4 Oops trailing blank, Daniel 2008-02-26 07:06:48 +00:00
Daniel Veillard
36c6bfa63d * src/driver.h src/libvirt.c src/openvz_driver.c src/qemu_driver.c
src/remote_internal.c src/test.c src/util.c src/util.h
  src/xen_unified.c: added probe interface at the driver level,
  use that to improve default hypervisor selection in the absence
  of a given URI when connecting
Daniel
2008-02-26 07:05:18 +00:00
Daniel Veillard
9b1cd481b8 fix compilation against static libraries
* src/Makefile.am src/util-lib.h: fix done with Jim to allow
  compilation of virsh with the static libraries.
Daniel
2008-02-25 13:55:56 +00:00
Jim Meyering
e497deb89e Avoid new "make syntax-check" failures.
* .x-sc_avoid_write: Exempt src/util-lib.c, too.
* Makefile.maint (sc_unmarked_diagnostics): Filter out false positives.
* src/storage_backend_fs.c (virStorageBackendFileSystemVolCreate):
Use safewrite, not write.
* src/storage_backend_logical.c (virStorageBackendLogicalBuildPool): Likewise.
2008-02-25 10:00:16 +00:00
Jim Meyering
b1b23f76be avoid format string warnings
Avoid warnings like this:
file:nnn:format not a string literal and no format arguments

* qemud/qemud.c: Insert a "%s" format argument.
* qemud/remote.c: Likewise.
* src/iptables.c: Likewise.
* src/qemu_driver.c: Likewise.
* src/storage_backend.c: Likewise.
* src/storage_backend_fs.c: Likewise.
* src/storage_backend_iscsi.c Likewise.
* src/storage_backend_logical.c: Likewise.
* src/storage_conf.c: Likewise.
* src/storage_driver.c: Likewise.
2008-02-22 16:26:13 +00:00
Jim Meyering
b59d9c85f1 Use safewrite in place of write, in many cases.
Also add "make syntax-check" rules to ensure no new uses sneak in.

There are many uses of write like this:

    if (write (fd, xml, towrite) != towrite)
        return -1;

The problem is that the syscall can succeed, yet write less than
the requested number of bytes, so the caller should retry
rather than simply failing.

This patch changes most of them to use util.c's safewrite wrapper,
which encapsulates the process.  Also, there were a few cases in
which the retry loop was open-coded, and I replaced those, too.

* Makefile.maint (sc_avoid_write): New rule, to avoid recurrence.
* .x-sc_avoid_write: New file.  Record two legitimate exemptions.
* qemud/qemud.c (sig_handler, qemudClientWriteBuf): Use safewrite, not write.
* src/conf.c (__virConfWriteFile): Likewise.
* src/qemu_conf.c (qemudSaveConfig, qemudSaveNetworkConfig): Likewise.
* src/qemu_driver.c (qemudWaitForMonitor, qemudStartVMDaemon)
(qemudVMData, PROC_IP_FORWARD): Likewise.
* proxy/libvirt_proxy.c: Include "util.h".
(proxyWriteClientSocket): Use safewrite.
* src/test.c (testDomainSave, testDomainCoreDump): Likewise.
* src/proxy_internal.c (virProxyWriteClientSocket): Likewise.
* src/virsh.c: Include "util-lib.h".
(vshOutputLogFile): Use safewrite.
* src/console.c: Include "util-lib.h".
(vshRunConsole): Use safewrite.
2008-02-22 15:55:04 +00:00
Jim Meyering
a178a4e7bf Move safewrite and saferead to a separate file.
We currently use safewrite from inside libvirt and don't want to publish
any such function name.  However, we do want to use it in applications
like virsh, libvirtd and libvirt_proxy that link with libvirt.  To that
end, this change moves that function definition (along with the nearly
identical saferead) into a new file, util-lib.c.  To avoid maintaining
separate copies of even such small functions, we simply include that new
file from util.c.  Then, the separate applications that need to use
safewrite simply compile and link with util-lib.c.

Of course, this does mean that each of those applications will
containing two copies of these functions.  However, the functions
are so small that it's not worth worrying about that.

* src/util.c (saferead, safewrite): Move function definitions to
util-lib.c and include that .c file.
* src/util-lib.c (saferead, safewrite): New file.  Functions from src/util.c
with slight change (s/int r =/ssize_t r =/) to reflect read/write return type.
* src/util-lib.h: Declare the two moved functions.
* src/util.h: Remove declarations.  Include src/util-lib.h.
* proxy/Makefile.am (libvirt_proxy_SOURCES): Add src/util-lib.c.
* qemud/Makefile.am (libvirtd_SOURCES): Likewise.
* src/Makefile.am (virsh_SOURCES): Add util-lib.c.  Remove some SP-before-TAB.
2008-02-22 15:53:13 +00:00
Jim Meyering
6187c6de9b With --enable-iptables-lokkit=no, avoid warning about unused parameter.
* src/iptables.c (iptRulesSave) [!ENABLE_IPTABLES_LOKKIT]:
Mark parameter as used.
2008-02-22 12:34:27 +00:00
Jim Meyering
9bcade46df Rewrite openvzSetUUID.
* src/openvz_conf.c (openvzSetUUID): Rewrite to avoid unchecked
lseek, write, and close as well as a potential file descriptor leak.
2008-02-21 18:48:06 +00:00
Jim Meyering
5fc07cd840 Handle failed openvzLocateConfDir.
* src/openvz_conf.c (openvzLocateConfDir, openvzGetVPSUUID):
(openvzSetUUID): Don't dereference NULL upon failure.
2008-02-21 18:22:45 +00:00
Richard W.M. Jones
be8653b183 Fix double-free in OpenVZ driver.
* src/openvz_conf.c: Double-free fix (Anton Protopopov).
2008-02-21 15:20:36 +00:00
Daniel P. Berrange
83d0aa0706 Added missing symbol export 2008-02-21 03:53:03 +00:00
Daniel P. Berrange
104cc98636 Update to work with new policy kit APIs 2008-02-20 16:54:35 +00:00
Daniel P. Berrange
4bea16df64 Ignore libvirt_parthelper binary 2008-02-20 15:58:38 +00:00
Daniel P. Berrange
291158945d Added no-op stub of storage APIs to test driver 2008-02-20 15:53:34 +00:00
Daniel P. Berrange
b7db975135 Added disk partition storage pool backend 2008-02-20 15:52:17 +00:00
Daniel P. Berrange
8ec1fcd925 Added iSCSI storage pool backend 2008-02-20 15:49:25 +00:00
Daniel P. Berrange
e266ded2f6 Added directory/filesystem/netfs based storage pool backend 2008-02-20 15:45:59 +00:00
Daniel P. Berrange
ac736602fd Added logical volume storage pool driver 2008-02-20 15:45:33 +00:00
Daniel P. Berrange
e39438e869 Added directory/filesystem/netfs based storage pool backend 2008-02-20 15:42:30 +00:00
Daniel P. Berrange
4a4e272f9d Added storage backend helper APIs 2008-02-20 15:38:29 +00:00
Daniel P. Berrange
20878720c0 Added main internal storage driver impl 2008-02-20 15:34:52 +00:00
Daniel P. Berrange
f43e709842 Added convenience virsh command for creating pools/volumes without XML 2008-02-20 15:29:13 +00:00
Daniel P. Berrange
816fd02876 Added virsh commands for storage management 2008-02-20 15:27:08 +00:00
Daniel P. Berrange
661c5c4476 Add storage APIs to remote driver 2008-02-20 15:23:36 +00:00
Daniel P. Berrange
cb228a0e24 Internal driver API for storage management 2008-02-20 15:06:53 +00:00
Daniel P. Berrange
e1d2e325dd Add public API for storage management 2008-02-20 14:57:39 +00:00
Mark McLoughlin
3da5504e68 Fix gcc-4.3.0 "inlining failed" warning.
* src/internal.h: move xstrol() variants from here ...

* src/util.[ch]: ... to here and rename to virStrToLong()

* src/libvirt_sym.version: export __virStrToLong_i() for
virsh and qemud.

* src/nodeinfo.c, src/stats_linux.c, src/virsh.c,
  src/xend_internal.c, qemud/qemud.c: replace xstrtol()
calls with virStrToLong()

* src/nodeinfo.h: don't include internal.h, which was only
needed for xstrtol(), but instead include libvirt.h which
is suffificient for the declarations in the header.
2008-02-08 09:15:16 +00:00
Daniel Veillard
e9b3bc773d virHashRemoveSet bugfixes
* src/hash.c: fix a couple of problems in virHashRemoveSet based
  on Hiroyuki Kaguchi patch and explanations.
Daniel
2008-02-07 16:56:01 +00:00
Jim Meyering
247df6e448 Mark all qemudLog diagnostics for translation.
* po/POTFILES.in: Add names of many new files.
* Makefile.maint (err_func_re): Add qemudLog.
Mark diagnostics with _(...).  Split some long lines.
* qemud/qemud.c (remoteCheckCertFile, remoteInitializeGnuTLS):
(qemudDispatchSignalEvent, qemudSetCloseExec, qemudSetNonBlock):
(qemudWritePidFile, qemudListenUnix, remoteMakeSockets):
(remoteListenTCP, qemudInitPaths, qemudInitialize):
(qemudNetworkInit, remoteInitializeTLSSession, remoteCheckDN):
(remoteCheckCertificate, remoteCheckAccess, qemudDispatchServer):
(qemudClientReadBuf, qemudDispatchClientRead):
(qemudClientWriteBuf, qemudDispatchClientWrite, qemudOneLoop):
(remoteConfigGetStringList, checkType, GET_CONF_STR):
(remoteConfigGetAuth, remoteReadConfigFile, main):
* qemud/remote.c (remoteDispatchAuthSaslInit, remoteSASLCheckSSF):
(remoteSASLCheckAccess, remoteDispatchAuthSaslStart):
(remoteDispatchAuthSaslStep, remoteDispatchAuthSaslInit):
(remoteDispatchAuthSaslStart, remoteDispatchAuthSaslStep):
(qemudGetSocketIdentity, remoteDispatchAuthPolkit):
* src/iptables.c (notifyRulesUpdated, MAX_FILE_LEN, iptRulesSave):
(iptRulesReload):
* src/qemu_conf.c (qemudExtractVersionInfo, qemudLoadConfig):
(qemudLoadNetworkConfig, qemudScanConfigDir):
* src/qemu_driver.c (qemudSetCloseExec, qemudSetNonBlock):
(qemudAutostartConfigs, qemudStartup, qemudReload):
(qemudWaitForMonitor, qemudStartVMDaemon, qemudVMData):
(qemudShutdownVMDaemon, qemudStartNetworkDaemon):
(qemudShutdownNetworkDaemon, qemudMonitorCommand):
(qemudDomainUndefine, qemudNetworkUndefine):
* src/uuid.c (virUUIDGenerate):
* src/xm_internal.c (xenXMAttachInterface):
2008-02-07 16:50:17 +00:00
Jim Meyering
e8ff93b4e6 Remove more useless if tests before "free"-like functions.
* build-aux/useless-if-before-free: Rename from ...
* build-aux/find-unnecessary-if-before-free: ... this.  Remove file.
Also changed it so that new names are no longer hard-coded in the
script.  Instead, they're supplied via options:
* Makefile.cfg (useless_free_options): Define.
Add xmlXPathFreeObject to the list of free-like functions it detects.
* Makefile.maint (sc_avoid_if_before_free): Reflect script renaming.
* .x-sc_avoid_if_before_free: Likewise.
* src/openvz_conf.c (openvzParseXML): Remove useless "if"-before-free.
* src/qemu_conf.c (qemudParseXML, qemudParseNetworkXML): Likewise.
* src/virsh.c (cmdVNCDisplay, cmdTTYConsole, cmdDetachInterface):
(cmdDetachDisk): Likewise.
* src/xm_internal.c (xenXMConfigSetIntFromXPath): Likewise.
(xenXMConfigSetStringFromXPath, xenXMParseXMLToConfig): Likewise.
(xenXMDomainAttachDevice, xenXMAttachDisk, xenXMAttachInterface):
(xenXMDomainDetachDevice): Likewise.
* src/xml.c (virXPathString): Likewise.
* tests/xmlrpctest.c (checkRequestValue): Likewise.
2008-02-07 16:49:29 +00:00
Jim Meyering
5a93214143 Remove trailing blanks 2008-02-07 12:34:19 +00:00
Mark McLoughlin
a0f83fd905 * src/xen_internal.c: Don't crash if there's no /sys/hypervisor/capabilities 2008-02-07 10:43:14 +00:00
Mark McLoughlin
3d3c8ac4c4 src/iptables.c: Create directory for saving iptables rules 2008-02-07 10:17:24 +00:00
Mark McLoughlin
f90cd4c3f4 src/xm_internal.[ch]: Move static function prototype from header 2008-02-07 10:14:43 +00:00
Daniel Veillard
b33f740e1f * src/libvirt.c: fix bug in xenUnifiedDomainSuspend() patch provided
by Marcus Meissner
Daniel
2008-02-07 09:37:10 +00:00
Daniel Veillard
594af3eb22 add/change/delete a Disk/NIC of an inactive domains
* src/xm_internal.[ch]: applied patch from Shigeki Sakamoto to
  add/change/delete a Disk/NIC of an inactive domains
Daniel
2008-02-06 17:57:10 +00:00
Daniel Veillard
eecd68364a QEmu config error handling fixes
* src/qemu_conf.c: applied 2 patches from Guido Guenther to avoid
  crashes when reading the config file
Daniel
2008-02-06 16:24:28 +00:00
Jim Meyering
5419d0b44d Fix new "make distcheck" failures.
* src/xml.c (virDomainParseXMLOSDescHVM): Mark a diagnostic.
2008-02-05 22:07:31 +00:00
Jim Meyering
e04912a9f0 Remove all trailing blanks; turn on the rule to detect them.
* Makefile.cfg (local-checks-to-skip): Remove sc_trailing_blank.
* .x-sc_trailing_blank: New file, to exempt the few binary files.
2008-02-05 19:27:37 +00:00
Daniel P. Berrange
e87e3f86bf Added support for booting off kenrel+initrd with HVM guests 2008-02-05 16:21:25 +00:00
Jim Meyering
fb66d5ab92 Eliminate all uses of virBufferAdd with string literals.
* Makefile.maint (sc_prohibit_virBufferAdd_with_string_literal):
New rule.
* src/buf.h (virBufferAddLit): Define.
* src/conf.c (virConfSaveValue): Use virBufferAddLit, in place
of virBufferAdd everywhere possible.
(virConfSaveEntry): Likewise.
* src/qemu_conf.c (qemudGenerateXML, qemudGenerateNetworkXML): Likewise.
* src/qemu_driver.c (qemudGetFeatures, qemudGetCapabilities): Likewise.
* src/test.c (testDomainDumpXML, testNetworkDumpXML): Likewise.
* src/xen_internal.c (xenHypervisorMakeCapabilitiesXML): Likewise.
* src/xend_internal.c (xend_parse_sexp_desc_os): Likewise.
(xend_parse_sexp_desc, sexpr_to_xend_topology_xml): Likewise.
* src/xm_internal.c (xenXMDomainFormatXML, xenXMDomainPinVcpu): Likewise.
* src/xml.c (virSaveCpuSet, virParseXenCpuTopology): Likewise.
(virDomainParseXMLGraphicsDescImage): Likewise.
(virDomainParseXMLGraphicsDescVFB, virDomainParseXMLOSDescHVM): Likewise.
(virDomainParseXMLOSDescPV, virDomainParseXMLDiskDesc): Likewise.
(virDomainParseXMLIfDesc, virDomainParseXMLDesc): Likewise.
2008-02-05 14:22:28 +00:00
Jim Meyering
ecaa696250 Enable more checks for unmarked messages; fix violators.
* Makefile.maint (sc_unmarked_diagnostics): Check for more functions.
* src/conf.c (virConfParseValue): Remove trailing space in diagnostic.
* src/libvirt.c (do_open, virDomainMigrate): Mark diagnostics.
* src/xend_internal.c (do_connect, xenDaemonDomainDumpXMLByID): Likewise.
(xenDaemonDomainDumpXMLByName, xenDaemonCreateLinux): Likewise.
(xenDaemonDomainMigratePerform, xenDaemonDomainDefineXML): Likewise.
* src/xml.c (virXPathString, virXPathNumber, virXPathLong): Likewise.
(virXPathBoolean, virXPathNode, virXPathNodeSet): Likewise.
(virDomainParseXMLOSDescHVM): Likewise.
* src/xmlrpc.c (xmlRpcValueNew): Likewise.
(xmlRpcValueUnmarshalDictElement): Likewise.
2008-02-04 19:31:30 +00:00
Jim Meyering
e99570fc77 Mark a string for translation.
* src/virsh.c: Add a "%s" and wrap with _(...).
2008-02-04 14:58:47 +00:00
Jim Meyering
70400346d2 Enable the sc_unmarked_diagnostics test and correct all violations
involving the "error" function.
* Makefile.cfg (local-checks-to-skip): Remove from skip list.
* src/remote_internal.c: Mark translatable strings.
2008-02-04 14:58:05 +00:00
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
34dff95bfd src/test.c (testLoadDomain): Avoid leaks upon failure. 2008-01-30 19:57:13 +00:00
Jim Meyering
1217e5d516 Avoid used-uninitialized errors in test driver.
* src/test.c (testOpenFromFile): Initialize "privconn".
2008-01-30 19:54:29 +00:00
Jim Meyering
6997b1920f src/libvirt.c (do_open): Avoid double-free upon failure. 2008-01-30 19:53:10 +00:00
Jim Meyering
218f866f86 Avoid segfault upon malloc failure, and plug a leak.
* src/test.c (testDomainSave): Detect testDomainDumpXML failure.  Free "xml".
2008-01-30 19:52:16 +00:00
Jim Meyering
5561e9125f Plug test-related leaks.
* src/test.c (testLoadNetwork): Free forwardDev.
(testLoadDomain): Free ctxt.
(testLoadNetwork): Likewise.
(testOpenFromFile): Likewise.
2008-01-30 19:50:14 +00:00
Daniel P. Berrange
17ef6faa7f Remove double mutex lock() 2008-01-30 18:21:13 +00:00
Daniel P. Berrange
03003499e7 Fix XML generation for Xen USB devices 2008-01-30 16:38:18 +00:00
Daniel P. Berrange
21416a4746 Fix device name -> number conversion for block stats 2008-01-29 18:36:00 +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 Veillard
aab826d4cc Fix VIR_DOMAIN_NONE into VIR_DOMAIN_NOSTATE
* src/xen_internal.c: fix an erronous use of VIR_DOMAIN_NONE instead
  of VIR_DOMAIN_NOSTATE (both defined as 0, no regression)
Daniel
2008-01-25 09:47:51 +00:00
Daniel Veillard
3f9a94bec3 * src/libvirt.c: Jay Gagnon pointed out that virDomainGetXMLDesc
was failing with a non-zero flag value
Daniel
2008-01-24 17:09:56 +00:00
Richard W.M. Jones
9cf2573c8a Portability improvements for Mac OS X.
* configure.in: Use PortableXDR if available.
        * qemud/internal.h: Use "socketcompat.h".
        * qemud/qemud.c: Use <signal.h>.
        * src/sexpr.c: Use <stdlib.h> instead of <malloc.h>.
        * src/socketcompat.h: Include <sys/un.h> for Mac OS X.
2008-01-23 14:54:41 +00:00
Richard W.M. Jones
569200b6d4 Remove DOS line-endings.
* src/socketcompat.h: Remove DOS line-endings in this file.
2008-01-23 14:50:14 +00:00
Daniel P. Berrange
9d7661e415 Fix compat for old pkg-config and gnutls 2008-01-22 21:30:05 +00:00
Daniel P. Berrange
97bed42f7a Fix & refactor ref counting cleanup code 2008-01-21 16:29:10 +00:00
Daniel P. Berrange
45738083a6 Use virFileReadAll in virsh.c 2008-01-21 15:27:14 +00:00
Daniel P. Berrange
53365f4c54 Remove no-op networking APIs from openvz driver 2008-01-21 15:19:46 +00:00
Jim Meyering
64b3019d69 Adjust sexpr-related interfaces to be const-correct.
* src/sexpr.c (sexpr_cons, append, sexpr_append, sexpr2string)
(sexpr_lookup_key, sexpr_lookup, sexpr_node, sexpr_fmt_node):
Add "const" attribute where appropriate.
* src/xend_internal.c (sexpr_int, sexpr_float, sexpr_u64)
(sexpr_uuid, sexpr_to_xend_domain_info, sexpr_to_xend_node_info)
(sexpr_to_xend_topology_xml, sexpr_to_domain): Likewise.
* src/sexpr.h: Adjust prototypes.
2008-01-21 14:22:15 +00:00
Jim Meyering
a430f22be4 Don't access line[-1] for a zero-length "line" from fgets.
A NUL byte at beginning of input, or just after a newline
would provoke an invalid buf[-1] access (possible segfault).
* src/libvirt.c (virConnectAuthCallbackDefault):
2008-01-21 14:09:51 +00:00
Daniel Veillard
5912e7c233 Preserve vif order
* src/xml-internal.c: apply patch from Hiroyuki Kaguchi to
  preserve the vif list order.
Daniel
2008-01-21 08:27:12 +00:00
Daniel P. Berrange
d56aff5255 Added xstrtol_ll and xstrtol_ull convenience functions 2008-01-20 16:11:25 +00:00
Daniel P. Berrange
e05a879022 Fix nodeinfo compat for Xen 3.2.0 2008-01-20 15:56:49 +00:00
Daniel P. Berrange
e8d690aeb5 Enable debug by default, but only if LIBVIRT_DEBUG=1. Use generic macro for debug output 2008-01-19 18:36:01 +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
Daniel P. Berrange
f6ba6e9eb7 Support VNC keymap option with QEMU (Daniel Hokka Zakrisson) 2008-01-15 15:18:33 +00:00
Daniel P. Berrange
045d32a8e8 Fix off-by-one in SSH argv checking. Fix format string warning 2008-01-15 14:23:52 +00:00
Jim Meyering
2edab512a0 Clean up the global name space.
* src/qemu_conf.c: Add "static" and "const" attributes to some globals.
* src/qemu_conf.h: Update a declaration.
* src/qemu_driver.c (qemud_driver): Declare static.


Author: Jim Meyering <meyering@redhat.com>
2008-01-14 14:05:25 +00:00
Daniel P. Berrange
6aae9a9efb Re-factor auth code to make clearer (Jim Meyering) 2008-01-14 04:05:23 +00:00
Daniel P. Berrange
b2083ea907 Fix crash when no auth callback 2008-01-14 04:00:34 +00:00
Mark McLoughlin
4c50142381 fix an unused variable warning 2008-01-10 14:41:39 +00:00
Mark McLoughlin
73ab4e0845 add iptablesSaveRules(), and don't save the rules to disk
and run lokkit each time a new rule is added.
2008-01-10 14:01:00 +00:00
Mark McLoughlin
2d2e410818 now that we only use built-in iptables chains, we don't
need to add or delete them
2008-01-10 13:58:59 +00:00
Mark McLoughlin
9b29b2a2a5 Like --with-iptables-prefix, --with-iptables-dir is no
longer useful, so let's remove it.
2008-01-10 13:57:48 +00:00
Mark McLoughlin
f8e0674ad5 --with-iptables-prefix was added to integrate with
a proposed system for letting iptables know how to
reload our rules. The proposed system wasn't accepted
so, although there might be some other theoretical
use for this, let's just remove it.
2008-01-10 13:56:22 +00:00
Mark McLoughlin
b9daf6d9dd Add support for integrating our iptables support with Fedora's
iptables configuration using the lokkit --custom-rules command.

Basically, we write out our rules to /var/lib/libvirt/iptables
and run lokkit --custom-rules so that if e.g. iptables is
restarted or the user edits their firewall configuration, then
libvirt's rules get reloaded.
2008-01-10 13:54:02 +00:00
Mark McLoughlin
a43ddc075a Include the iptables command and chain name in the saved rules files 2008-01-10 13:51:55 +00:00
Mark McLoughlin
9d04c25ab2 Re-name the "flipflop" variable to "command_idx" 2008-01-10 13:50:46 +00:00
Mark McLoughlin
cc83cda045 make use of virFileMakePath(), virFileBuildPath() and virRun(). 2008-01-10 13:49:55 +00:00
Mark McLoughlin
fc11528f98 Fix compile error in --with-iptables-dir code 2008-01-10 13:48:44 +00:00
Mark McLoughlin
cf0ee0f6e4 Change virExec() such that with --enable-debug,
stdout and stderr no longer go to /dev/null.
2008-01-10 13:47:49 +00:00
Mark McLoughlin
77a2fc0061 Add virRun() helper function (Dan Berrange) 2008-01-10 13:46:10 +00:00
Daniel P. Berrange
9d11255a47 Fix vcpupin hypercall map data to be 8-bytes 2008-01-09 21:08:29 +00:00
Daniel P. Berrange
78f2cd3d2d Added graceful shutdown support to QEMU/KVM (patch from Guido Guenther) 2008-01-09 16:05:21 +00:00
Daniel P. Berrange
8796a9ff74 Fix warning in debug output 2008-01-08 17:52:10 +00:00
Daniel P. Berrange
8cd4774468 Fix buffer passed to free() 2008-01-08 16:17:15 +00:00
Daniel P. Berrange
94e49e3f0e Fix config file reading to not truncate large files 2008-01-07 15:21:33 +00:00
Richard W.M. Jones
029aef1d24 Miscellaneous fixes for building on Windows (MinGW).
* configure.in: xdr functions may require -lxdr.
	* configure.in, src/Makefile.am: Extra linking flags for
	  building libvirt DLL.
	* src/socketcompat.h: Hide Windows Winsock incompatibilities
	  in a separate header file.
	* src/remote_internal.c: Switch to using socketcompat.h /
	  socket_errno().
	* src/test.c: Switch to using socketcompat.h.
	* gnulib/lib/arpa/.cvsignore: Ignore another generated file.
	* src/qparams.c: Include <config.h>.
2008-01-05 16:06:36 +00:00
Daniel P. Berrange
76122538b6 Fix crash when no auth callback is provided 2008-01-02 22:48:04 +00:00
Daniel Veillard
7b40fcd11f * src/openvz.c: patch from Mikhail Pokidko to fix the OpenVZ
compilation error #426385
Daniel
2007-12-26 05:41:05 +00:00
Daniel P. Berrange
d575a83f81 Fix nodeinfo compat with Xen 3.2.0 2007-12-17 23:04:33 +00:00
Richard W.M. Jones
1be1fe69f5 Fix remote_internal.c error handling of qparam_get_query
* src/remote_internal.c: Fixed reversed check of error handling
          of qparam_get_query call (Dan Berrange).
2007-12-17 17:41:02 +00:00
Richard W.M. Jones
3b0149354b Add separate qparams module for handling query parameters.
* src/qparams.c, src/qparams.h, src/Makefile.am: Added a
	  separate 'qparams' module for handling query parameters.
	* src/remote_internal.c: Factor out query parameter code so
	  it uses the 'qparams' module.
2007-12-17 10:07:56 +00:00
Richard W.M. Jones
ed9788c796 Add extra utility functions to buf.c
* src/buf.c, src/buf.h: Added utility functions
	  virBufferURIEncodeString and virBufferAddChar to the
	  buffer module.
2007-12-17 10:05:35 +00:00
Daniel P. Berrange
a11494fd52 Don't invoke callback with unsupported credential types 2007-12-15 17:15:12 +00:00
Daniel Veillard
cc8e4ff318 fix setting CPU parameters in the config files
* src/xm_internal.c: patch from Saori Fukuta to fix setting
  CPU parameters in the config files, the value was overwritten
Daniel
2007-12-14 15:51:42 +00:00
Daniel Veillard
81acc14e3a fix the detach-disk command when using Xen tap devices
* src/xs_internal.[ch]: patch from Saori Fukuta to fix the
  detach-disk command when using Xen tap devices.
* docs/libvir.html: typo fix from Jim Meyering
Daniel
2007-12-14 15:38:02 +00:00
Richard W.M. Jones
b47ffc035c Fix virBufferEscapeString escaping of '<'
* src/buf.c (virBufferEscapeString): '<' escaped as "&lt;"
2007-12-12 16:27:10 +00:00
Jim Meyering
49230350fa Use a variable name as sizeof argument, not a type name.
Given code like: T *var = calloc (n, sizeof (T));
Convert to this: T *var = calloc (n, sizeof (*var));
This first-cut change adjusts all malloc, calloc, and
realloc statements.

The only binary differences are in remote_internal.c
(due to the bug fix) and in xmlrpc.c (due to factorization).

* python/libvir.c: As above.
* qemud/event.c: Likewise.
* qemud/mdns.c: Likewise.
* qemud/qemud.c: Likewise.
* qemud/remote.c: Likewise.
* src/bridge.c: Likewise.
* src/buf.c: Likewise.
* src/conf.c: Likewise.
* src/hash.c: Likewise.
* src/iptables.c: Likewise.
* src/openvz_conf.c: Likewise.
* src/qemu_conf.c: Likewise.
* src/qemu_driver.c: Likewise.
* src/test.c: Likewise.
* src/xen_internal.c: Likewise.
* src/xen_unified.c: Likewise.
* src/xm_internal.c: Likewise.
* src/xml.c: Likewise.
* tests/qemuxml2argvtest.c: Likewise.
* src/xmlrpc.c (xmlRpcValuePtr): Likewise, and minor factorization.
* src/remote_internal.c (remoteAuthMakeCredentials): Use the right
type when allocating space for an array of cred _pointers_.
2007-12-11 21:57:29 +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
f3ebd20d35 Fri Dec 7 14:47:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* src/internal.h: Use gnulib gettext library.  Define
	  INET_ADDRSTRLEN unless already defined.
2007-12-07 14:52:24 +00:00
Richard W.M. Jones
f1f94721ae Fri Dec 7 14:36:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* src/.cvsignore: Ignore *.loT files (generated under Windows).
	* proxy/libvirt_proxy.c: Bail out earlier --without-xen.
	* src/proxy_internal.c: Don't build proxy client side if
	  configured --without-xen.
	* src/iptables.c, src/iptables.h: Disable this code if
	  configured --without-qemu.
	* src/nodeinfo.c: If no 'uname' function, set model name to
	  empty string (for Windows).
	* src/xen_unified.h, src/util.c, src/test.c: Include <winsock2.h>
	  on Windows.
	* src/util.c: Disable virExec* and virFileLinkPointsTo on
	  MinGW.
2007-12-07 14:45:39 +00:00
Richard W.M. Jones
36f0ce0472 Fri Dec 7 14:34:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* src/sexpr.c: Cosmetic rearrangement of headers.
2007-12-07 14:39:14 +00:00
Jim Meyering
4a2f8fc633 Include "config.h" in remaining non-generated files.
* proxy/libvirt_proxy.c: Likewise.
* python/libvir.c: Likewise.
* python/types.c: Likewise.
* src/event.c: Likewise.
* src/xm_internal.c: Likewise.
* tests/reconnect.c: Likewise.
* tests/testutils.c: Likewise.
2007-12-07 10:08:06 +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
Richard W.M. Jones
ec38eb9388 Thu Dec 6 12:00:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* src/remote_internal.c: Clean up a warning if neither SASL
          nor PolKit are enabled.
2007-12-06 12:05:35 +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
Jim Meyering
87396257fc Include "config.h".
* qemud/event.c: Likewise.
* src/buf.c: Likewise.
* src/hash.c: Likewise.
* src/nodeinfo.c: Likewise.
* src/openvz_conf.c: Likewise.
* src/proxy_internal.c: Likewise.
* src/virterror.c: Likewise.
* src/xmlrpc.c: Likewise.
* src/xs_internal.c: Likewise.
* tests/conftest.c: Likewise.
* tests/xmlrpctest.c: Likewise.
This fixes a mingw build failure reported by Rich Jones.

Author: Jim Meyering <meyering@redhat.com>
2007-12-05 21:40:15 +00:00
Jim Meyering
261e7581b1 Use gnulib, starting with its physmem and getaddrinfo modules.
New files go into these directories:
  gnulib/lib
  gnulib/m4
  gnulib/tests

* bootstrap: A wrapper around gnulib-tool.
* configure.in: Invoke gl_EARLY and gl_INIT, being careful to put gl_EARLY
before any macro that uses AC_COMPILE_IFELSE.
(AC_OUTPUT): Add lib/Makefile and gl-tests/Makefile.  Remove m4/Makefile.
* Makefile.am (SUBDIRS): Add gnulib/lib and remove m4.  Add gnulib/tests
early enough that those tests run before any libvirt unit tests.
* m4/Makefile.am: Remove file.  Not needed.
* src/Makefile.am (INCLUDES): Add -I$(top_srcdir)/gnulib/lib -I../gnulib/lib.
(LDADDS, libvirt_la_LIBADD): Add ../gnulib/lib/libgnu.la.
* src/nodeinfo.c: Include "physmem.h".
* qemud/qemud.c, src/remote_internal.c: Include "getaddrinfo.h".
(MEMINFO_PATH, linuxNodeInfoMemPopulate): Remove definitions.
(virNodeInfoPopulate): Use physmem_total, not linuxNodeInfoMemPopulate.
* tests/Makefile.am (INCLUDES): Add -I$(top_srcdir)/gnulib/lib -I../gnulib/lib.
(LDADDS): Add ../gnulib/lib/libgnu.la.
* qemud/Makefile.am (libvirtd_LDADD): Add ../gnulib/lib/libgnu.la.
* tests/nodeinfotest.c (linuxTestCompareFiles): No longer read total
memory from a file.
Update expected output not to include "Memory: NNNN"
* tests/nodeinfodata/linux-nodeinfo-1.txt:
* tests/nodeinfodata/linux-nodeinfo-2.txt:
* tests/nodeinfodata/linux-nodeinfo-3.txt:
* tests/nodeinfodata/linux-nodeinfo-4.txt:
* tests/nodeinfodata/linux-nodeinfo-5.txt:
* tests/nodeinfodata/linux-nodeinfo-6.txt:
* src/test.c [WITH_TEST]: Remove definition of _GNU_SOURCE that
would conflict with the one now in "config.h".
* autogen.sh: Add -I gnulib/m4.
* src/conf.c, src/sexpr.c: Don't define _GNU_SOURCE.
Instead, include "config.h".
* qemud/qemud.c: Remove definition of _GNU_SOURCE.
* src/openvz_driver.c: Likewise.
* src/qemu_driver.c: Likewise.
* src/remote_internal.c: Likewise.

* configure.in: Use AC_CONFIG_AUX_DIR(build-aux), so that a bunch
of gettextize-generated files go into build-aux/, rather than in
the top-level directory.
* .cvsignore: Adjust.
* build-aux/.cvsignore: New file.


Author: Jim Meyering <meyering@redhat.com>
2007-12-05 21:31:07 +00:00
Daniel P. Berrange
2add6b3026 Fix compile issues when SASL is disabled 2007-12-05 19:25:44 +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
7fa9ceb740 Added public API for authentication credential callback support 2007-12-05 18:28:05 +00:00
Daniel P. Berrange
282342c1c5 Added PolicyKit authentication support 2007-12-05 18:21:27 +00:00
Richard W.M. Jones
ffdbb903e4 Wed Dec 5 18:00:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* src/Makefile.am, tests/Makefile.am: Remove LIBOBJS/LTLIBOBJS
          which were incorrectly committed earlier.
2007-12-05 18:05:13 +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
Daniel P. Berrange
bb5371f668 Add data encryption using SASL SSF layer 2007-12-05 15:27:08 +00:00
Daniel P. Berrange
1b1d647439 Initial integration of SASL authentication, working for Kerberos only 2007-12-05 15:24:15 +00:00
Daniel P. Berrange
a8977b62ba Strip autogenerated vnetXXX interfaces 2007-12-05 15:08:23 +00:00
Richard W.M. Jones
4bfdb77aae Wed Dec 5 13:48:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* python/libvir.c, python/libvirt_wrap.h, qemud/qemud.c,
        qemud/remote.c, src/internal.h, src/openvz_conf.c,
        src/openvz_driver.c, src/proxy_internal.h, src/qemu_conf.c,
        src/qemu_driver.c, src/remote_internal.h, src/test.h, src/util.c,
        src/xen_unified.c, src/xen_unified.h, tests/nodeinfotest.c,
        tests/qemuxml2argvtest.c, tests/qemuxml2xmltest.c, tests/reconnect.c,
        tests/sexpr2xmltest.c, tests/virshtest.c, tests/xencapstest.c,
        tests/xmconfigtest.c, tests/xml2sexprtest.c:
        Change #include <> to #include "" for local includes.
        Removed many includes from src/internal.h and put them in
        the C files which actually use them.
        Removed <ansidecl.h> - unused.
        Added a comment around __func__.
        Removed a clashing redefinition of VERSION symbol.
        All limits (PATH_MAX etc) now done in src/internal.h, so we
        don't need to include those headers in other files.
2007-12-05 13:56: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
Richard W.M. Jones
78f756e081 Mon Dec 3 16:15:10 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* src/util.c: Fix header files for Windows builds.
2007-12-03 16:19:41 +00:00
Daniel P. Berrange
4cd62fe306 Move generic file & I/O routines out of QEMU driver into util.c 2007-12-03 14:30:46 +00:00
Daniel Veillard
ed5e20baab * src/xen_unified.[ch] src/proxy_internal.c src/xen_internal.c
src/xend_internal.c src/xm_internal.c src/xs_internal.c:
  cleanup the xen subdriver table, remove the type entry and
  always return "Xen" from the unified entry point.
Daniel
2007-12-03 09:34:38 +00:00
Daniel P. Berrange
2b3c49b6ab Fix numerous memory leaks 2007-12-01 15:45:25 +00:00
Daniel P. Berrange
b4f841d92f Fix buffer termination off-by-1 in link comparison code 2007-12-01 15:29:45 +00:00
Daniel P. Berrange
6d3f1d516e Disable Xen specific functions if Xen driver is disabled 2007-11-30 22:51:54 +00:00
Jim Meyering
c3c80a183e Detect heap allocation failure; factor out some duplication.
* qemud/qemud.c (tls_port, tcp_port, mdns_name, tls_allowed_ip_list):
  (tls_allowed_dn_list): Remove "const", now that we free these.
  (unix_sock_rw_mask): Rename from unix_sock_rw_perms, so that
  the latter name can be used as a local string variable, so that the
  variable name matches the config attribute name.
  (unix_sock_ro_mask): Rename from unix_sock_ro_perms, likewise.
  (remoteCheckDN, remoteCheckAccess): Adapt to const removal.
  (qemudDispatchServer): Check for heap allocation failure.
  (remoteConfigGetStringList): New function, based on code from Dan Berrangé.
  (CHECK_TYPE): Remove macro.
  (checkType): New function.
  (GET_CONF_INT, GET_CONF_STR): New macros.
  (remoteReadConfigFile): Use new macros to avoid duplication and to
  check for allocation failure.
* src/conf.h (virConfTypeName): New static inline function.
2007-11-30 15:43:42 +00:00
Richard W.M. Jones
d63034c018 Thu Nov 29 17:40:00 GMT 2007 Richard W.M. Jones <rjones@redhat.com>
* configure.in: Added CYGWIN_EXTRA_LDFLAGS, CYGWIN_EXTRA_LIBADD,
	  CYGWIN_EXTRA_PYTHON_LIBADD, CYGWIN automake conditional.
	* src/Makefile.am: Extra flags required to build DLL of libvirt
	  for Cygwin.
	* python/Makefile.am: Extra flags and rule required to build
	  Python module for Cygwin.
2007-11-29 17:44:01 +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
Richard W.M. Jones
208a450a53 Wed Nov 28 09:00:00 GMT 2007 Richard W.M. Jones <rjones@redhat.com>
* src/xm_internal.c, src/xm_internal.h: Added support for
          pinning inactive domains for Xen 3.0.3 (Saori Fukuta).
2007-11-28 10:11:18 +00:00
Jim Meyering
59a375812d When reporting errors, use "conn" whenever possible.
* src/remote_internal.c: change all error (NULL, ... to error (conn, ...
(check_cert_file): Add+use parameter, conn.
Adjust callers.
(initialise_gnutls): The "conn" parameter *is* used, so remove
ATTRIBUTE_UNUSED.


Author: Jim Meyering <meyering@redhat.com>
2007-11-27 18:18:23 +00:00
Daniel Veillard
1338ed4f25 * configure.in: when configuring with --prefix=/usr i.e. the same
prefix as the installed libvirt, use the same localstatedir /var
  (instead of /usr/var) and sysconfdir /etc (instead of /usr/etc) to
  be able to connect to the system daemon, and use the system local
  options
* src/xs_internal.c: avoid error message when non-root cannot open
  xenstore
* src/xend_internal.c: avoid error message when non-root cannot
  directly access xend, in those 2 cases the proxy (or remote code)
  should implement the access so there is no need to raise the error
  there.
Daniel
2007-11-27 14:39:42 +00:00
Richard W.M. Jones
851c651820 Mon Nov 26 12:12:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* configure.in, src/console.c: Replace cfmakeraw if not in
	  standard library.
2007-11-26 12:14:32 +00:00
Richard W.M. Jones
95585d7c94 Mon Nov 26 11:49:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* src/bridge.c, src/bridge.h, src/qemu_conf.c, src/qemu_conf.h,
	  src/qemu_driver.c, src/qemu_driver.h, src/test.c: Disable more
	  of qemu if configured --without-qemu.
2007-11-26 11:50:16 +00:00
Richard W.M. Jones
d6d1c629fa Mon Nov 26 11:47:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* src/remote_internal.c: Miscellaneous header file fixes for
	  Cygwin.
2007-11-26 11:47:15 +00:00
Richard W.M. Jones
46fdd02c75 Mon Nov 26 11:39:59 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* configure.in, src/internal.h, src/xml.c: <sys/syslimits.h>
	  is needed on Cygwin to get PATH_MAX.  HOST_NAME_MAX and
	  IF_NAMESIZE defined if not in header files.
2007-11-26 11:40:28 +00:00
Daniel Veillard
1ad3d2cdd8 * src/xm_internal.c: fix the parsing of predefined domains on
xen prior to 3.1 to take into accound the fact that disk can
  be shareable.
Daniel
2007-11-21 16:31:30 +00:00
Richard W.M. Jones
618db3deb7 Wed Nov 21 11:36:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* src/bridge.c, src/qemu_driver.c: Incorrect call to
	  brSetForwardDelay changed to brSetEnableSTP.
2007-11-21 11:46:05 +00:00
Daniel Veillard
61b113c623 Cleaned up a couple of comments/tests, Daniel 2007-11-20 18:57:41 +00:00
Richard W.M. Jones
4ef3a4ea7c Tue Nov 20 10:49:28 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* src/virterror.c, src/stats_linux.c, include/libvirt/virterror.h:
	  Renamed the VIR_FROM_LINUX error as VIR_FROM_STATS_LINUX for
	  consistency.
2007-11-20 10:58:21 +00:00
Daniel Veillard
aab34d876e * include/libvirt/virterror.h src/openvz_conf.c src/openvz_driver.c
src/stats_linux.c src/virterror.c src/xm_internal.c: patch from
  Saori Fukuta cleaning up various problems in the error reporting
  layers
Daniel
2007-11-20 10:15:38 +00:00
Daniel P. Berrange
2efc8ff757 Fixed 32-bit overflow 2007-11-17 11:53:44 +00:00
Daniel P. Berrange
6bb2d376b5 Refactor processing of incoming packets to remove dead code 2007-11-17 11:17:48 +00:00
Richard W.M. Jones
e714bb67ca Thu Nov 15 17:43:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* src/stats_linux.c: Fix parsing of short interface names
	  occurring in the /proc/net/dev file.
	* src/qemu_driver.c: Collect interface stats for QEMU & KVM
	  domains.
2007-11-15 17:45:44 +00:00
Richard W.M. Jones
7a66394fcb Thu Nov 15 17:40:15 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* docs/hvsupport.html, docs/libvir.html: Document HV support
	  for virNodeGetFreeMemory and virNodeGetCellsFreeMemory.
	* src/libvirt.c: Add DEBUG to virNodeGetFreeMemory and
	  virNodeGetCellsFreeMemory.
	* src/xen_internal.c: virXenError* functions now take an
	  additional virConnectPtr argument, and set it where possible.
2007-11-15 17:44:06 +00:00
Daniel Veillard
a4499a22c5 * src/stats_linux.c: patch from Jim Paris to fix compilation
when Xen isn't installed
* src/qemu_conf.h: small cleanup of signedness of bitfields
  from Jim Paris
Daniel
2007-11-15 10:56:24 +00:00
Daniel Veillard
ec58960745 * doc/libvir.html doc/format.html: add missing docs for
<shareable/> on disk devices
* src/Makefile.am: fix the tst build rule for missing libraries
Daniel
2007-11-14 17:11:19 +00:00
Jim Meyering
a3d909888d Handle failed strdup and malloc.
* src/remote_internal.c: Don't dereference NULL after
failed strdup or malloc in doRemoteOpen.
2007-11-14 16:29:08 +00:00
Richard W.M. Jones
3ba58f158d Wed Nov 14 11:55:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* src/stats_linux.c, src/stats_linux.h, src_xen_internal.c:
	  Abstract out the Linux-specific statistics.  Fixed parsing
	  of 64 bit numbers.
	* src/Makefile.am: Updated Makefile for new files.
2007-11-14 11:58:36 +00:00
Richard W.M. Jones
88f28d6980 Wed Nov 14 11:36:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* src/libvirt.c and all internal driver interfaces: Parse the
	  URI only once and pass it to virDrvOpen instead of the
	  unparsed name string.
2007-11-14 11:40:57 +00:00
Jim Meyering
5d25419188 Parse integers more carefully, cont'd.
* qemud/qemud.c: Replace uses of strtol with uses of xstrtol_i.
  Avoid overflow for very large --timeout=N values.
* src/nodeinfo.c: In linuxNodeInfoMemPopulate and
  linuxNodeInfoCPUPopulate, use xstrtol_i rather than strtol.
  Unlike in qemud.c, here we allow trailing "isspace", and in
  the case of "cpuinfo cpu MHz", also allow a "." terminator,
  since we ignore the decimal and any following digits.
* src/internal.h: Define xstrtol_ui, too.


Author: Jim Meyering <meyering@redhat.com>
2007-11-14 10:53:05 +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
Richard W.M. Jones
5a628880b0 Tue Nov 6 19:54:00 CET 2007 Jim Meyering <meyering@redhat.com>
Avoid risk of format string abuse (also avoids gcc warnings).
        * src/util.c (ReportError): Use a literal "%s" format string.
        * src/remote_internal.c (server_error): Likewise.
        * src/qemu_conf.c (qemudReportError): Likewise.
        * acinclude.m4: Add -Wformat -Wformat-security to default
          list of warning flags, to warn about errors such as the
          above.
2007-11-07 12:29:37 +00:00
Daniel Veillard
f2886d75e6 * src/xs_internals.c: patch from Chris Lalancette, forgot to
remove the domainDumpXML entry when changing the driver structure
Daniel
2007-11-06 16:25:32 +00:00
Daniel Veillard
9899932303 * src/xml.c src/xs_internal.c src/xs_internal.h: applied patch
from Masayuki Sunou to fix xend errors when adding disk
  devices, due to improper device id lookup.
Daniel
2007-11-06 11:49:01 +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
028275d6da * src/xml.c: patch from Beth Kon to fix a problem when the
cpuset parameter for numa uses cpu maxcpu-1
Daniel
2007-11-05 10:14:42 +00:00
Daniel Veillard
c33b54df47 * src/xm_internal.c: patches from Masayuki Sunou to fix a problem
when an HVM domain is started with a CD-Rom config, this should
  fix #328841
Daniel
2007-11-01 13:33:58 +00:00
Daniel Veillard
390cca8125 * proxy/libvirt_proxy.c src/proxy_internal.[ch] src/xen_internal.c
src/xen_unified.[ch] src/xend_internal.[ch] src/xml.[ch]: last
  patch for the library NUMA support, allow to serialize CPU pinning
  to domain configs (but won't work though proxy access), includes
  many patches from Saori Fukuta.
Daniel
2007-10-31 09:39:13 +00:00
Daniel P. Berrange
8a0711c758 Avoiding calling remote network driver recursively if inside daemon 2007-10-27 01:23:28 +00:00
Daniel P. Berrange
d6f351690e Support CDROM media change for QEMU/KVM 2007-10-27 01:21:09 +00:00
Daniel P. Berrange
97185033e5 Refactor shell escaping code 2007-10-27 01:19:51 +00:00