]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
17 years ago* src/driver.h src/libvirt.c src/openvz_driver.c src/qemu_driver.c
Daniel Veillard [Tue, 26 Feb 2008 07:05:18 +0000 (07:05 +0000)]
* 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

17 years agofix compilation against static libraries
Daniel Veillard [Mon, 25 Feb 2008 13:55:56 +0000 (13:55 +0000)]
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

17 years agoAvoid new "make syntax-check" failures.
Jim Meyering [Mon, 25 Feb 2008 10:00:16 +0000 (10:00 +0000)]
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.

17 years agoavoid format string warnings
Jim Meyering [Fri, 22 Feb 2008 16:26:13 +0000 (16:26 +0000)]
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.

17 years agoUse safewrite in place of write, in many cases.
Jim Meyering [Fri, 22 Feb 2008 15:55:04 +0000 (15:55 +0000)]
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.

17 years agoMove safewrite and saferead to a separate file.
Jim Meyering [Fri, 22 Feb 2008 15:53:13 +0000 (15:53 +0000)]
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.

17 years agoWith --enable-iptables-lokkit=no, avoid warning about unused parameter.
Jim Meyering [Fri, 22 Feb 2008 12:34:27 +0000 (12:34 +0000)]
With --enable-iptables-lokkit=no, avoid warning about unused parameter.

* src/iptables.c (iptRulesSave) [!ENABLE_IPTABLES_LOKKIT]:
Mark parameter as used.

17 years agoWith --without-xen, avoid warning about unused function.
Jim Meyering [Fri, 22 Feb 2008 12:33:47 +0000 (12:33 +0000)]
With --without-xen, avoid warning about unused function.

* tests/statstest.c (testQuietError) [!WITH_XEN]: Don't define.

17 years agoRewrite openvzSetUUID.
Jim Meyering [Thu, 21 Feb 2008 18:48:06 +0000 (18:48 +0000)]
Rewrite openvzSetUUID.

* src/openvz_conf.c (openvzSetUUID): Rewrite to avoid unchecked
lseek, write, and close as well as a potential file descriptor leak.

17 years agoHandle failed openvzLocateConfDir.
Jim Meyering [Thu, 21 Feb 2008 18:22:45 +0000 (18:22 +0000)]
Handle failed openvzLocateConfDir.

* src/openvz_conf.c (openvzLocateConfDir, openvzGetVPSUUID):
(openvzSetUUID): Don't dereference NULL upon failure.

17 years agoFix double-free in OpenVZ driver.
Richard W.M. Jones [Thu, 21 Feb 2008 15:20:36 +0000 (15:20 +0000)]
Fix double-free in OpenVZ driver.
        * src/openvz_conf.c: Double-free fix (Anton Protopopov).

17 years agoAdded missing symbol export
Daniel P. Berrange [Thu, 21 Feb 2008 03:53:03 +0000 (03:53 +0000)]
Added missing symbol export

17 years agoAvoid "make syntax-check" failure.
Jim Meyering [Wed, 20 Feb 2008 17:26:01 +0000 (17:26 +0000)]
Avoid "make syntax-check" failure.

* docs/examples/index.py: Don't emit trailing blanks.
* docs/examples/Makefile.am: Regenerate.

17 years agoUpdate to work with new policy kit APIs
Daniel P. Berrange [Wed, 20 Feb 2008 16:54:35 +0000 (16:54 +0000)]
Update to work with new policy kit APIs

17 years agoUpdate po files with latest translatable strings
Daniel P. Berrange [Wed, 20 Feb 2008 16:08:56 +0000 (16:08 +0000)]
Update po files with latest translatable strings

17 years agoIgnore libvirt_parthelper binary
Daniel P. Berrange [Wed, 20 Feb 2008 15:58:38 +0000 (15:58 +0000)]
Ignore libvirt_parthelper binary

17 years agoAdded docs on storage management capabilities
Daniel P. Berrange [Wed, 20 Feb 2008 15:58:06 +0000 (15:58 +0000)]
Added docs on storage management capabilities

17 years agoIgnore doc files for syntax check
Daniel P. Berrange [Wed, 20 Feb 2008 15:57:34 +0000 (15:57 +0000)]
Ignore doc files for syntax check

17 years agoAdded no-op stub of storage APIs to test driver
Daniel P. Berrange [Wed, 20 Feb 2008 15:53:34 +0000 (15:53 +0000)]
Added no-op stub of storage APIs to test driver

17 years agoAdded all example storage XML files
Daniel P. Berrange [Wed, 20 Feb 2008 15:52:40 +0000 (15:52 +0000)]
Added all example storage XML files

17 years agoAdded disk partition storage pool backend
Daniel P. Berrange [Wed, 20 Feb 2008 15:52:17 +0000 (15:52 +0000)]
Added disk partition storage pool backend

17 years agoAdded iSCSI storage pool backend
Daniel P. Berrange [Wed, 20 Feb 2008 15:49:25 +0000 (15:49 +0000)]
Added iSCSI storage pool backend

17 years agoSet close-on-exec flag for signal pipe
Daniel P. Berrange [Wed, 20 Feb 2008 15:47:06 +0000 (15:47 +0000)]
Set close-on-exec flag for signal pipe

17 years agoAdded directory/filesystem/netfs based storage pool backend
Daniel P. Berrange [Wed, 20 Feb 2008 15:45:59 +0000 (15:45 +0000)]
Added directory/filesystem/netfs based storage pool backend

17 years agoAdded logical volume storage pool driver
Daniel P. Berrange [Wed, 20 Feb 2008 15:45:33 +0000 (15:45 +0000)]
Added logical volume storage pool driver

17 years agoAdded directory/filesystem/netfs based storage pool backend
Daniel P. Berrange [Wed, 20 Feb 2008 15:42:30 +0000 (15:42 +0000)]
Added directory/filesystem/netfs based storage pool backend

17 years agoAdded storage backend helper APIs
Daniel P. Berrange [Wed, 20 Feb 2008 15:38:29 +0000 (15:38 +0000)]
Added storage backend helper APIs

17 years agoAdded main internal storage driver impl
Daniel P. Berrange [Wed, 20 Feb 2008 15:34:52 +0000 (15:34 +0000)]
Added main internal storage driver impl

17 years agoAdded convenience virsh command for creating pools/volumes without XML
Daniel P. Berrange [Wed, 20 Feb 2008 15:29:13 +0000 (15:29 +0000)]
Added convenience virsh command for creating pools/volumes without XML

17 years agoAdded virsh commands for storage management
Daniel P. Berrange [Wed, 20 Feb 2008 15:27:08 +0000 (15:27 +0000)]
Added virsh commands for storage management

17 years agoAdded python binding for storage APIs
Daniel P. Berrange [Wed, 20 Feb 2008 15:26:22 +0000 (15:26 +0000)]
Added python binding for storage APIs

17 years agoAdd storage APIs to remote driver
Daniel P. Berrange [Wed, 20 Feb 2008 15:23:36 +0000 (15:23 +0000)]
Add storage APIs to remote driver

17 years agoAdd remote daemon support for storage APIs
Daniel P. Berrange [Wed, 20 Feb 2008 15:22:35 +0000 (15:22 +0000)]
Add remote daemon support for storage APIs

17 years agoRegenerate docs to include storage APIs
Daniel P. Berrange [Wed, 20 Feb 2008 15:20:44 +0000 (15:20 +0000)]
Regenerate docs to include storage APIs

17 years agoInternal driver API for storage management
Daniel P. Berrange [Wed, 20 Feb 2008 15:06:53 +0000 (15:06 +0000)]
Internal driver API for storage management

17 years agoAdd public API for storage management
Daniel P. Berrange [Wed, 20 Feb 2008 14:57:39 +0000 (14:57 +0000)]
Add public API for storage management

17 years agoPull useless-if-before-free from gnulib, and update.
Jim Meyering [Wed, 13 Feb 2008 21:52:19 +0000 (21:52 +0000)]
Pull useless-if-before-free from gnulib, and update.

* bootstrap (gnulib_tool): Add useless-if-before-free to
the list of modules.
* build-aux/useless-if-before-free: Update from gnulib.
* gnulib/lib/vasnprintf.c: Work around a bug in HPUX 10.20.
* gnulib/m4/vasnprintf.m4: Likewise.

17 years agoIgnore ChangeLog/NEWS file for whitespace checks
Daniel P. Berrange [Tue, 12 Feb 2008 14:45:17 +0000 (14:45 +0000)]
Ignore ChangeLog/NEWS file for whitespace checks

17 years agoNetwork doc example fixes
Daniel Veillard [Mon, 11 Feb 2008 16:08:11 +0000 (16:08 +0000)]
Network doc example fixes
* docs/libvir.html docs/format.html: fixes the examples on the
  section about ethernet bridging, as raised by Maxwell Bottiger,
  fixes bug #430790
Daniel

17 years agoFix gcc-4.3.0 "inlining failed" warning.
Mark McLoughlin [Fri, 8 Feb 2008 09:15:16 +0000 (09:15 +0000)]
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.

17 years agoEnable another syntax-check rule.
Jim Meyering [Thu, 7 Feb 2008 19:20:36 +0000 (19:20 +0000)]
Enable another syntax-check rule.

* Makefile.cfg (local-checks-to-skip): Remove sc_no_have_config_h.
* qemud/mdns.c: Remove "#ifdef HAVE_CONFIG_H".
* Makefile.maint (sc_no_have_config_h): Tighten up regexp,
so that the above mention of "HAVE_CONFIG_H" doesn't match.
* .x-sc_no_have_config_h: New file, to exempt gnulib/ straggler.

17 years agoautobuild.sh: Run "make syntax-check", so the autobuilder does this.
Jim Meyering [Thu, 7 Feb 2008 19:19:45 +0000 (19:19 +0000)]
autobuild.sh: Run "make syntax-check", so the autobuilder does this.

17 years agomissing ')'
Daniel Veillard [Thu, 7 Feb 2008 17:03:17 +0000 (17:03 +0000)]
missing ')'
* qemud/remote.c: fix a missing ')' introduced earlier
Daniel

17 years agovirHashRemoveSet bugfixes
Daniel Veillard [Thu, 7 Feb 2008 16:56:01 +0000 (16:56 +0000)]
virHashRemoveSet bugfixes
* src/hash.c: fix a couple of problems in virHashRemoveSet based
  on Hiroyuki Kaguchi patch and explanations.
Daniel

17 years agoMark all qemudLog diagnostics for translation.
Jim Meyering [Thu, 7 Feb 2008 16:50:17 +0000 (16:50 +0000)]
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):

17 years agoRemove more useless if tests before "free"-like functions.
Jim Meyering [Thu, 7 Feb 2008 16:49:29 +0000 (16:49 +0000)]
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.

17 years agoRemove trailing blanks
Jim Meyering [Thu, 7 Feb 2008 12:34:19 +0000 (12:34 +0000)]
Remove trailing blanks

17 years ago* src/xen_internal.c: Don't crash if there's no /sys/hypervisor/capabilities
Mark McLoughlin [Thu, 7 Feb 2008 10:43:14 +0000 (10:43 +0000)]
* src/xen_internal.c: Don't crash if there's no /sys/hypervisor/capabilities

17 years agosrc/iptables.c: Create directory for saving iptables rules
Mark McLoughlin [Thu, 7 Feb 2008 10:17:24 +0000 (10:17 +0000)]
src/iptables.c: Create directory for saving iptables rules

17 years agosrc/xm_internal.[ch]: Move static function prototype from header
Mark McLoughlin [Thu, 7 Feb 2008 10:14:43 +0000 (10:14 +0000)]
src/xm_internal.[ch]: Move static function prototype from header

17 years agoPython bindings return values fixes
Daniel Veillard [Thu, 7 Feb 2008 09:49:13 +0000 (09:49 +0000)]
Python bindings return values fixes
* python/libvir.c: apply patch from Cole Robinson to provide
  return values for manulally written python bindings.
Daniel

17 years agoOops forgot >>>>, Daniel
Daniel Veillard [Thu, 7 Feb 2008 09:37:41 +0000 (09:37 +0000)]
Oops forgot >>>>, Daniel

17 years ago* src/libvirt.c: fix bug in xenUnifiedDomainSuspend() patch provided
Daniel Veillard [Thu, 7 Feb 2008 09:37:10 +0000 (09:37 +0000)]
* src/libvirt.c: fix bug in xenUnifiedDomainSuspend() patch provided
  by Marcus Meissner
Daniel

17 years agoadd/change/delete a Disk/NIC of an inactive domains
Daniel Veillard [Wed, 6 Feb 2008 17:57:10 +0000 (17:57 +0000)]
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

17 years agoQEmu config error handling fixes
Daniel Veillard [Wed, 6 Feb 2008 16:24:28 +0000 (16:24 +0000)]
QEmu config error handling fixes
* src/qemu_conf.c: applied 2 patches from Guido Guenther to avoid
  crashes when reading the config file
Daniel

17 years agoFix new "make distcheck" failures.
Jim Meyering [Tue, 5 Feb 2008 22:07:31 +0000 (22:07 +0000)]
Fix new "make distcheck" failures.

* src/xml.c (virDomainParseXMLOSDescHVM): Mark a diagnostic.

17 years agoRemove all trailing blanks; turn on the rule to detect them.
Jim Meyering [Tue, 5 Feb 2008 19:27:37 +0000 (19:27 +0000)]
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.

17 years agoIgnore built test files
Daniel P. Berrange [Tue, 5 Feb 2008 16:29:42 +0000 (16:29 +0000)]
Ignore built test files

17 years agoAdded support for booting off kenrel+initrd with HVM guests
Daniel P. Berrange [Tue, 5 Feb 2008 16:21:25 +0000 (16:21 +0000)]
Added support for booting off kenrel+initrd with HVM guests

17 years agoEliminate all uses of virBufferAdd with string literals.
Jim Meyering [Tue, 5 Feb 2008 14:22:28 +0000 (14:22 +0000)]
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.

17 years agoEnable more checks for unmarked messages; fix violators.
Jim Meyering [Mon, 4 Feb 2008 19:31:30 +0000 (19:31 +0000)]
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.

17 years agoMark a string for translation.
Jim Meyering [Mon, 4 Feb 2008 14:58:47 +0000 (14:58 +0000)]
Mark a string for translation.

* src/virsh.c: Add a "%s" and wrap with _(...).

17 years agoEnable the sc_unmarked_diagnostics test and correct all violations
Jim Meyering [Mon, 4 Feb 2008 14:58:05 +0000 (14:58 +0000)]
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.

17 years agoPull vc-list-files from gnulib, and update.
Jim Meyering [Fri, 1 Feb 2008 19:47:07 +0000 (19:47 +0000)]
Pull vc-list-files from gnulib, and update.
* bootstrap (gnulib_tool): Add the vc-list-files module.

17 years agoAvoid compilation failure when building --without-xen.
Jim Meyering [Thu, 31 Jan 2008 21:49:47 +0000 (21:49 +0000)]
Avoid compilation failure when building --without-xen.

* tests/statstest.c (testDevice) [!WITH_XEN]: #ifdef-out.
(main) [!WITH_XEN]: #ifdef-out the body.

Committer: Jim Meyering <meyering@redhat.com>
Author: Guido Guenther  <agx@sigxcpu.org>

17 years agoAvoid virsh leaks due to missing virDomainFree(dom) calls
Jim Meyering [Wed, 30 Jan 2008 19:58:59 +0000 (19:58 +0000)]
Avoid virsh leaks due to missing virDomainFree(dom) calls

* src/virsh.c (cmdDomuuid): Add missing virDomainFree call.
(cmdAttachDevice): Likewise.
(cmdDetachDevice): Likewise.

17 years agosrc/virsh.c (cmdCapabilities): Plug a small leak.
Jim Meyering [Wed, 30 Jan 2008 19:57:54 +0000 (19:57 +0000)]
src/virsh.c (cmdCapabilities): Plug a small leak.

17 years agosrc/test.c (testLoadDomain): Avoid leaks upon failure.
Jim Meyering [Wed, 30 Jan 2008 19:57:13 +0000 (19:57 +0000)]
src/test.c (testLoadDomain): Avoid leaks upon failure.

17 years agoAvoid used-uninitialized errors in test driver.
Jim Meyering [Wed, 30 Jan 2008 19:54:29 +0000 (19:54 +0000)]
Avoid used-uninitialized errors in test driver.

* src/test.c (testOpenFromFile): Initialize "privconn".

17 years agosrc/libvirt.c (do_open): Avoid double-free upon failure.
Jim Meyering [Wed, 30 Jan 2008 19:53:10 +0000 (19:53 +0000)]
src/libvirt.c (do_open): Avoid double-free upon failure.

17 years agoAvoid segfault upon malloc failure, and plug a leak.
Jim Meyering [Wed, 30 Jan 2008 19:52:16 +0000 (19:52 +0000)]
Avoid segfault upon malloc failure, and plug a leak.

* src/test.c (testDomainSave): Detect testDomainDumpXML failure.  Free "xml".

17 years agoPlug test-related leaks.
Jim Meyering [Wed, 30 Jan 2008 19:50:14 +0000 (19:50 +0000)]
Plug test-related leaks.

* src/test.c (testLoadNetwork): Free forwardDev.
(testLoadDomain): Free ctxt.
(testLoadNetwork): Likewise.
(testOpenFromFile): Likewise.

17 years agoRemove double mutex lock()
Daniel P. Berrange [Wed, 30 Jan 2008 18:21:13 +0000 (18:21 +0000)]
Remove double mutex lock()

17 years agoFix XML generation for Xen USB devices
Daniel P. Berrange [Wed, 30 Jan 2008 16:38:18 +0000 (16:38 +0000)]
Fix XML generation for Xen USB devices

17 years agoArrange for "make syntax-check" to pass.
Jim Meyering [Wed, 30 Jan 2008 06:55:56 +0000 (06:55 +0000)]
Arrange for "make syntax-check" to pass.

* .x-sc_avoid_if_before_free: Exempt ChangeLog.
* tests/statstest.c: Include <config.h>, not "config.h".

17 years agoFix device name -> number conversion for block stats
Daniel P. Berrange [Tue, 29 Jan 2008 18:36:00 +0000 (18:36 +0000)]
Fix device name -> number conversion for block stats

17 years agoAlso detect and remove unnecessary if-before-xmlXPathFreeContext.
Jim Meyering [Tue, 29 Jan 2008 18:23:43 +0000 (18:23 +0000)]
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.

17 years agoEnable two more tests.
Jim Meyering [Tue, 29 Jan 2008 18:21:00 +0000 (18:21 +0000)]
Enable two more tests.

* Makefile.cfg (local-checks-to-skip)
[sc_cast_of_x_alloc_return_value, sc_cast_of_argument_to_free]: Enable.

17 years agoEnable the <assert.h>-checking test; fix violations.
Jim Meyering [Tue, 29 Jan 2008 18:20:25 +0000 (18:20 +0000)]
Enable the <assert.h>-checking test; fix violations.

* Makefile.cfg (local-checks-to-skip)
[sc_prohibit_assert_without_use]: Enable.
* qemud/mdns.c: Don't include <assert.h>; no uses of assert here.
* qemud/qemud.c: Likewise.
* qemud/remote.c: Likewise.

17 years agoEnable the po-check test; fix violations.
Jim Meyering [Tue, 29 Jan 2008 18:19:46 +0000 (18:19 +0000)]
Enable the po-check test; fix violations.

* Makefile.cfg (local-checks-to-skip) [po-check]: Enable.
* po/POTFILES.in: Add three file names.  Sort.

17 years agoUpdate from gnulib
Jim Meyering [Tue, 29 Jan 2008 18:17:47 +0000 (18:17 +0000)]
Update from gnulib
* lib/poll.c: Update.
* lib/string.in.h: Update.
* m4/string_h.m4: Update.
* tests/test-getaddrinfo.c: Update.
* lib/Makefile.am: Regenerate.

17 years agoEnable the <config.h>-requiring test; fix violations
Jim Meyering [Tue, 29 Jan 2008 18:15:54 +0000 (18:15 +0000)]
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.

17 years agoEnable the duplicate-"the" test; fix violations
Jim Meyering [Tue, 29 Jan 2008 17:43:28 +0000 (17:43 +0000)]
Enable the duplicate-"the" test; fix violations

* Makefile.cfg (local-checks-to-skip) [sc_the_the]: Enable.
* docs/virsh.pod: Remove a duplicate "the".
* libvirt.spec.in: Likewise.
* virsh.1: Likewise.

17 years ago Add framework for code style- and syntax-checking rules.
Jim Meyering [Tue, 29 Jan 2008 17:42:39 +0000 (17:42 +0000)]
Add framework for code style- and syntax-checking rules.

Almost all tests are initially disabled via the list in Makefile.cfg.
* Makefile.am (EXTRA_DIST): Add .x-sc_avoid_if_before_free.
Omit names of files that automake includes automatically.
* .x-sc_avoid_if_before_free: New file.
* build-aux/vc-list-files: Likewise.
* build-aux/find-unnecessary-if-before-free: Likewise.
* GNUmakefile, Makefile.cfg, Makefile.maint: New files.

17 years agoGiven code like if (foo) free (foo); remove the useless "if (foo) " part.
Jim Meyering [Tue, 29 Jan 2008 17:41:07 +0000 (17:41 +0000)]
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.

17 years agoClarify virsh documentation.
Richard W.M. Jones [Fri, 25 Jan 2008 12:03:05 +0000 (12:03 +0000)]
Clarify virsh documentation.
        * docs/virsh.pod: Clarify virsh documentation on when you can
          set memory and vCPUs.

17 years agoFix VIR_DOMAIN_NONE into VIR_DOMAIN_NOSTATE
Daniel Veillard [Fri, 25 Jan 2008 09:47:51 +0000 (09:47 +0000)]
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

17 years ago* src/libvirt.c: Jay Gagnon pointed out that virDomainGetXMLDesc
Daniel Veillard [Thu, 24 Jan 2008 17:09:56 +0000 (17:09 +0000)]
* src/libvirt.c: Jay Gagnon pointed out that virDomainGetXMLDesc
  was failing with a non-zero flag value
Daniel

17 years agoCorrect typos in the documentation (Atsushi SAKAI)
Richard W.M. Jones [Thu, 24 Jan 2008 10:15:13 +0000 (10:15 +0000)]
Correct typos in the documentation (Atsushi SAKAI)
        * README, libvirt.spec.in, docs/devhelp/html.xsl,
          docs/devhelp/index.html: Correct typos in the documentation.

17 years agoFix enablement of SASL
Daniel P. Berrange [Wed, 23 Jan 2008 19:37:10 +0000 (19:37 +0000)]
Fix enablement of SASL

17 years agoPortability improvements for Mac OS X.
Richard W.M. Jones [Wed, 23 Jan 2008 14:54:41 +0000 (14:54 +0000)]
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.

17 years agoRemove DOS line-endings.
Richard W.M. Jones [Wed, 23 Jan 2008 14:50:14 +0000 (14:50 +0000)]
Remove DOS line-endings.
        * src/socketcompat.h: Remove DOS line-endings in this file.

17 years agoFix compat for old pkg-config and gnutls
Daniel P. Berrange [Tue, 22 Jan 2008 21:30:05 +0000 (21:30 +0000)]
Fix compat for old pkg-config and gnutls

17 years agoAvoid "may be used uninitialized" warning.
Jim Meyering [Mon, 21 Jan 2008 17:06:47 +0000 (17:06 +0000)]
Avoid "may be used uninitialized" warning.

* tests/xmconfigtest.c (testCompareParseXML): Initialize "old_priv".

17 years agoFix & refactor ref counting cleanup code
Daniel P. Berrange [Mon, 21 Jan 2008 16:29:10 +0000 (16:29 +0000)]
Fix & refactor ref counting cleanup code

17 years agoMake python generator fail build on any missing APIs
Daniel P. Berrange [Mon, 21 Jan 2008 15:55:53 +0000 (15:55 +0000)]
Make python generator fail build on any missing APIs

17 years agoAdd missing vcpu/schedular APIs to python binding
Daniel P. Berrange [Mon, 21 Jan 2008 15:41:15 +0000 (15:41 +0000)]
Add missing vcpu/schedular APIs to python binding

17 years agoUse virFileReadAll in virsh.c
Daniel P. Berrange [Mon, 21 Jan 2008 15:27:14 +0000 (15:27 +0000)]
Use virFileReadAll in virsh.c

17 years agoRemove no-op networking APIs from openvz driver
Daniel P. Berrange [Mon, 21 Jan 2008 15:19:46 +0000 (15:19 +0000)]
Remove no-op networking APIs from openvz driver

17 years agoAdjust sexpr-related interfaces to be const-correct.
Jim Meyering [Mon, 21 Jan 2008 14:22:15 +0000 (14:22 +0000)]
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.