Commit Graph

30 Commits

Author SHA1 Message Date
Jim Meyering
bc18a91f91 error-reporting calls using VIR_ERR_NO_MEMORY: use virReportOOMError instead
* src/uml_conf.c (VIR_FROM_THIS): Define to VIR_FROM_UML.
* src/xs_internal.c (VIR_FROM_THIS): Define to VIR_FROM_XEN.
* src/xml.c (VIR_FROM_THIS): Define to VIR_FROM_XML.
* src/stats_linux.c (VIR_FROM_THIS): Define to VIR_FROM_STATS_LINUX.
* src/datatypes.c (VIR_FROM_THIS): Define to VIR_FROM_NONE.
* src/lxc_conf.c (VIR_FROM_THIS): Define to VIR_FROM_LXC.
* src/libvirt.c (VIR_FROM_THIS): Define to VIR_FROM_NONE.
* src/node_device_conf.c (VIR_FROM_THIS): Define to VIR_FROM_NODEDEV.
* src/openvz_conf.c (VIR_FROM_THIS): Define to VIR_FROM_OPENVZ.
* src/openvz_driver.c (VIR_FROM_THIS): Define to VIR_FROM_OPENVZ.
* src/conf.c (VIR_FROM_THIS): Define to VIR_FROM_CONF.
Note: this loses config_filename:config_lineno diagnostics,
but that's ok.
* src/node_device.c (VIR_FROM_THIS): Define to VIR_FROM_NODEDEV.
* src/sexpr.c (VIR_FROM_THIS): Define to VIR_FROM_SEXPR.
* po/POTFILES.in: remove src/sexpr.c and src/lxc_conf.c
2009-01-29 12:10:32 +00:00
Daniel P. Berrange
489fde7680 Add support for copy-on-write storage volumes 2009-01-27 18:30:03 +00:00
Daniel P. Berrange
437ac354fc Make error reporting threadsafe by avoiding strerror 2009-01-20 17:13:33 +00:00
Chris Lalancette
a9567e09ef Instead of relying solely on polling for /dev devices to appear in libvirt, we
really should be synchronizing against udev.  This is generally done by a call
to udevsettle, which is exactly what this patch implements for the storage
backends that are likely to create new /dev nodes.  I believe I've read that
even after udevsettle, you are not guaranteed that devices are all the way
created, so we still need the polling in the rest of the sources, but this
should give us a much better chance of things existing as we expect.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2008-11-28 07:50:20 +00:00
Daniel P. Berrange
c08a47b853 Refactor storage backends to avoid dependancy from config parser to implementation 2008-11-17 11:19:33 +00:00
Cole Robinson
00e8a7a491 Use different separator for lvs command to unbreak parsing for encrypted devs. 2008-11-14 16:10:47 +00:00
Chris Lalancette
1ac47e34f2 Call vgscan before attempting to scan logical volumes. This makes sure we've
"touched" any logical volumes, so they appear in the subsequent "pvs" call.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2008-11-05 11:41:43 +00:00
Daniel P. Berrange
d714b2afae Move internal error APIs into virterror_internal.h & drop leading __ prefix 2008-11-04 22:30:33 +00:00
Daniel P. Berrange
cbb1dd0a9b Remove use of virStringList in favour of strongly typed APIs 2008-11-04 21:54:21 +00:00
Chris Lalancette
e3b792d6e3 An updated patch for adding <device> tags to logical
findPoolSources.  Given danpb's last feedback, I completely removed the XML
parsing and did it all with structures.  The result should (hopefully) be a lot
easier on the eyes, and is a little more generic.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2008-10-23 11:39:53 +00:00
Chris Lalancette
c0c0fb8eef As suggested by danpb, to fix up the regression caused by last week's VIR_ENUM
cleanup patch, add a ".defaultFormat" member to .poolOptions.  In
storage_conf.c, if virXPathString(/pool/source/format/@type) returns NULL, then
set the pool type to .defaultFormat; otherwise, lookup the type via
formatFromString.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2008-10-23 11:32:22 +00:00
Chris Lalancette
eeff3cdcbc Add support for detecting the partition table type when scanning
iSCSI volumes.  This is implemented in the
virStorageBackendUpdateVolInfoFD function, so all future callers will
automatically benefit.  This is a somewhat large patch because the
conversion of the virStorageBackendPartTableTypeToString necessitated
a change to the formatToString and formatFromString function pointers,
which caused fallout in other places in the storage stuff.  The good
news is that most of these callers are now converted over to the
VIR_ENUM_IMPL, which means a lot of redundant code is now gone.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2008-10-16 15:06:03 +00:00
Jim Meyering
fd52c6ff67 avoid many format string warnings
Building with --disable-nls exposed many new warnings like these:
virsh.c:4952: warning: format not a string literal and no format ...
util.c:163: warning: format not a string literal and no format arguments
All but one of the following changes add a "%s" argument before
the offending _(...) argument.

This was the only manual change:
* src/lxc_driver.c (lxcVersion): Use %s and strerror(errno)
rather than %m, to avoid a warning from gcc -Wformat-security.

Add "%s" before each warned about format-string-with-no-%-directive:
* src/domain_conf.c (virDomainHostdevSubsysUsbDefParseXML)
(virDomainDefParseString, virDomainDefParseFile):
* src/hash.c (virGetConnect, __virGetDomain, virReleaseDomain)
(__virGetNetwork, virReleaseNetwork, __virGetStoragePool)
(virReleaseStoragePool, __virGetStorageVol, virReleaseStorageVol):
* src/lxc_container.c (lxcContainerChild):
* src/lxc_driver.c (lxcDomainDefine, lxcDomainUndefine)
(lxcDomainGetInfo, lxcGetOSType, lxcDomainDumpXML)
(lxcSetupInterfaces, lxcDomainStart, lxcDomainCreateAndStart)
(lxcVersion, lxcGetSchedulerParameters):
* src/network_conf.c (virNetworkDefParseString)
(virNetworkDefParseFile):
* src/openvz_conf.c (openvzReadNetworkConf, openvzLoadDomains):
* src/openvz_driver.c (openvzDomainDefineCmd)
(openvzDomainGetInfo, openvzDomainDumpXML, openvzDomainShutdown)
(openvzDomainReboot, ADD_ARG_LIT, openvzDomainDefineXML)
(openvzDomainCreateXML, openvzDomainCreate, openvzDomainUndefine)
(openvzDomainSetAutostart, openvzDomainGetAutostart)
(openvzDomainSetVcpus):
* src/qemu_driver.c (qemudDomainBlockPeek, qemudDomainMemoryPeek):
* src/remote_internal.c (remoteDomainBlockPeek)
(remoteDomainMemoryPeek, remoteAuthPolkit):
* src/sexpr.c (sexpr_new, _string2sexpr):
* src/storage_backend_disk.c (virStorageBackendDiskMakeDataVol)
(virStorageBackendDiskCreateVol):
* src/storage_backend_fs.c
(virStorageBackendFileSystemNetFindPoolSources):
* src/storage_backend_logical.c (virStorageBackendLogicalFindLVs)
(virStorageBackendLogicalFindPoolSources):
* src/test.c (testOpenDefault, testOpenFromFile, testOpen)
(testGetDomainInfo, testDomainRestore)
(testNodeGetCellsFreeMemory):
* src/util.c (virExec):
* src/virsh.c (cmdAttachDevice, cmdDetachDevice)
(cmdAttachInterface, cmdDetachInterface, cmdAttachDisk)
(cmdDetachDisk, cmdEdit):
* src/xend_internal.c (do_connect, wr_sync, xend_op_ext)
(urlencode, xenDaemonDomainCreateXML)
(xenDaemonDomainLookupByName_ids, xenDaemonDomainLookupByID)
(xenDaemonParseSxprOS, xend_parse_sexp_desc_char)
(xenDaemonParseSxprChar, xenDaemonParseSxprDisks)
(xenDaemonParseSxpr, sexpr_to_xend_topology, sexpr_to_domain)
(xenDaemonDomainFetch, xenDaemonDomainGetAutostart)
(xenDaemonDomainSetAutostart, xenDaemonDomainMigratePerform)
(xenDaemonDomainDefineXML, xenDaemonGetSchedulerType)
(xenDaemonGetSchedulerParameters)
(xenDaemonSetSchedulerParameters, xenDaemonDomainBlockPeek)
(xenDaemonFormatSxprChr, virDomainXMLDevID):
* src/xm_internal.c (xenXMConfigCacheRefresh, xenXMDomainPinVcpu)
(xenXMDomainCreate, xenXMDomainDefineXML)
(xenXMDomainAttachDevice, xenXMDomainDetachDevice):
* src/xml.c (virXPathString, virXPathNumber, virXPathLong)
(virXPathULong, virXPathBoolean, virXPathNode, virXPathNodeSet):
* src/xs_internal.c (xenStoreOpen):
2008-10-13 16:46:28 +00:00
Daniel P. Berrange
2e53a9912e Switch storage objects to array instead of linked list 2008-10-10 15:13:28 +00:00
Daniel Veillard
321c9a7f51 * configure.in libvirt.spec.in NEWS docs/*: release of libvirt-0.4.6
* src/storage_backend_logical.c: re-add the -f flag to vgremove
* po/*: rebuilt
Daniel
2008-09-23 20:48:49 +00:00
Daniel Veillard
ad5723e792 cleanup and removal for pools in logical backend
* src/storage_backend_logical.c: enable stop pool in logical backend
  improve portability when deleting a pool and also call pvremove
  patch by Chris Lalancette
Daniel
2008-09-22 20:22:35 +00:00
Daniel Veillard
914e1c61de finish applying initialization patch for logical storage backend
* src/storage_backend_logical.c: finish applying initialization
  from Jim Fehlig patch for logical storage backend
Daniel
2008-09-08 08:03:54 +00:00
Daniel Veillard
c37031ebf3 fix a miscalculation of command line size for vgcreate
* src/storage_backend_logical.c: fix a miscalculation of command line
  size for vgcreate, patch from Jim Fehlig
Daniel
2008-09-04 13:13:32 +00:00
Daniel Veillard
41ce15a586 Adds storage source element for pools
* src/storage_backend.h src/storage_backend_logical.c
src/storage_conf.c src/storage_conf.h src/virsh.c:
Applied patches from David Lively to add storage source
elements needed for storage pool
* docs/formatstorage.html docs/formatstorage.html.in: associated
documentation
Daniel
2008-09-02 14:15:42 +00:00
Daniel P. Berrange
39c9354c5c Add storage pool source discovery support (patch from David Lively) 2008-08-27 20:05:58 +00:00
Daniel Veillard
ce9439358c Fix creating and cleaning up logical volumes if a target path is specified
* src/storage_backend_logical.c: Patch from Cole Robinson, fix
  creating and cleaning up logical volumes if a target path is
  specified.
Daniel
2008-08-20 13:33:01 +00:00
Daniel P. Berrange
b3728d7d72 Fix const-correctness of virRUn and virExec 2008-08-08 15:43:38 +00:00
Daniel Veillard
c05cf3f3e1 * src/storage_backend_logical.c: patch from David Lively fixing
small differences of behaviour for 'lvs' and 'vgs' on SLES
Daniel
2008-07-30 08:52:44 +00:00
Chris Lalancette
a75a612ad5 This patch changes things around so that virStorageBackendRunProgRegex() does
*not* virStorageReportError() if the fork()/exec() process it spawned returned a
!= 0 exit code.  Rather, it returns the exitcode in this case, and it is up to
the higher level to determine whether this is a fatal error or not.  The use
case for this change is in the iSCSI stuff; older versions of iscsiadm tools
would return a failure when getting the session number, despite the command
succeeding.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2008-06-17 12:45:24 +00:00
Daniel P. Berrange
d789ef5a88 Switch over remaining driver code to use memory alloc apis 2008-06-06 11:09:57 +00:00
Richard W.M. Jones
1d8d4f86b6 Standardize use of header files, making internal.h primary.
* qemud/internal.h, qemud/qemud.h: Rename this file so it
	doesn't conflict with src/internal.h.
	* HACKING: Document how header files should be used.
	* qemud/Makefile.am: Add src/ directory to includes.
	* qemud/event.c, qemud/mdns.c, qemud/qemud.c, qemud/remote.c,
	qemud/remote_protocol.c, qemud/remote_protocol.h,
	qemud/remote_protocol.x, src/buf.c, src/libvirt.c,
	src/nodeinfo.c, src/qemu_conf.c, src/qemu_driver.c,
	src/stats_linux.c, src/storage_backend.c, src/storage_backend_fs.c,
	src/storage_backend_iscsi.c, src/storage_backend_logical.c,
	src/storage_conf.c, src/storage_driver.c, src/util.c,
	src/util.h, src/virsh.c, src/virterror.c, src/xend_internal.c,
	src/xml.c, tests/reconnect.c, tests/xmlrpctest.c,
	tests/qparamtest.c: Standardize	use of header files.
	* docs/*, po/*: Rebuild docs.
2008-05-23 08:24:41 +00:00
Jim Meyering
dc42a9d2de remove Vim and Emacs variable settings from C source files
Done with these commands:
git grep -l Local.variab|xargs \
  perl -0x3b -pi -e 's,\n+/\*\n \* vim:(.|\n)*,\n,'

git grep -l Local.variab|xargs \
  perl -0x3b -pi -e 's,\n+/\*\n \* Local variables:\n(.|\n)*,\n,'
2008-04-10 16:53:29 +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
Daniel P. Berrange
ac736602fd Added logical volume storage pool driver 2008-02-20 15:45:33 +00:00