Jim Meyering
3ef2e05c4d
lxc_container.c: avoid a leak on error paths
...
* src/lxc_container.c (lxcContainerMountBasicFS): Don't leak upon failure.
Add "cleanup:" label and change each post-allocation failure to
use "goto cleanup" rather than returning immediately.
2009-09-04 18:59:29 +02:00
Jim Meyering
e4ac19a87a
lxc: avoid NULL dereference upon getmntent failure
...
* src/lxc_container.c (lxcContainerUnmountOldFS): Don't pass
a NULL pointer to qsort.
2009-09-03 18:04:23 +02:00
Daniel P. Berrange
eb6d21cc0e
Reduce LXC capabilities
2009-06-29 17:09:42 +00:00
Daniel Veillard
43692df590
portability fix
...
* src/lxc_container.c: fix a portability issue if PR_CAPBSET_DROP is
not defined.
Daniel
2009-05-29 14:27:04 +00:00
Daniel P. Berrange
0d11a25e6d
Replace sys/capability.h with linux/capability.h
2009-05-13 11:37:16 +00:00
Daniel P. Berrange
65ecb4b434
Fix unused variable warning in LXC driver
2009-05-11 15:26:23 +00:00
Daniel Veillard
9959a1dd9d
drop CAP_SYS_BOOT capability from LXC containers
...
* src/lxc_container.c: drop LXC CAP_SYS_BOOT capability to avoid
reboot from inside containers, patch by Ryota Ozaki
Daniel
2009-05-11 14:05:27 +00:00
Daniel P. Berrange
328eac61cd
Fix /dev/ population to use char devices (Ryota Ozaki)
2009-05-08 10:22:46 +00:00
Daniel P. Berrange
220bcb0535
Use a private /dev/pts instance in containers if kernel is new enough
2009-04-22 14:26:50 +00:00
Daniel Veillard
bfc48afa14
cope with kernels where CLONE_NEWUSER is not supported
...
* src/lxc_container.c src/lxc_container.h: cope with kernels
where CLONE_NEWUSER is not supported, patch by Serge Hallyn
daniel
2009-04-20 12:27:12 +00:00
Mark McLoughlin
169afbe9aa
Fix lxc syntax-check failure
...
Fixes:
CHECK: avoid_if_before_free
src/lxc_container.c: if (oldroot) VIR_FREE(oldroot)
src/lxc_container.c: if (newroot) VIR_FREE(newroot)
Makefile.maint: found useless "if" before "free" above
and:
src/lxc_container.c:317:
Makefile.maint: found trailing blank(s)
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2009-04-16 13:08:03 +00:00
Dan Smith
06e43a8f2c
Commit patches by Serge Hallyn from 6-Apr and 7-Apr
2009-04-14 17:51:12 +00:00
Jim Meyering
bafd7389e4
remove remainder of offending strerror uses
...
* qemud/qemud.c (GET_CONF_STR): Use virStrerror, not strerror.
* qemud/remote.c (remoteDispatchDomainBlockPeek): Likewise.
(remoteDispatchDomainMemoryPeek, remoteDispatchAuthSaslInit): Likewise.
(remoteDispatchAuthPolkit): Likewise.
* src/lxc_container.c (lxcContainerAvailable): Likewise.
* src/network_driver.c (networkStartNetworkDaemon): Likewise.
(networkShutdownNetworkDaemon): Likewise.
* src/qemu_conf.c (qemudExtractVersion, qemudNetworkIfaceConnect):
* src/storage_conf.c (virStoragePoolLoadAllConfigs): Likewise.
* src/storage_driver.c (storagePoolUndefine): Likewise.
* src/uml_driver.c (umlStartup, umlStartVMDaemon): Likewise.
* src/util.c (virFileReadAll): Likewise.
* src/uuid.c (virUUIDGenerate): Likewise.
* src/xen_internal.c (get_cpu_flags): Likewise.
2009-02-05 16:28:30 +00:00
Jim Meyering
7faa50d1db
lxc_container: Don't dereference NULL upon failure
...
* src/lxc_container.c (lxcContainerPivotRoot): Free and zero
oldroot *after* printing the diagnostic, both for virFileMakePath
and pivot_root failure.
2009-02-05 15:28:19 +00:00
Jim Meyering
bc18a91f91
error-reporting calls using VIR_ERR_NO_MEMORY: use virReportOOMError instead
...
* src/uml_conf.c (VIR_FROM_THIS): Define to VIR_FROM_UML.
* src/xs_internal.c (VIR_FROM_THIS): Define to VIR_FROM_XEN.
* src/xml.c (VIR_FROM_THIS): Define to VIR_FROM_XML.
* src/stats_linux.c (VIR_FROM_THIS): Define to VIR_FROM_STATS_LINUX.
* src/datatypes.c (VIR_FROM_THIS): Define to VIR_FROM_NONE.
* src/lxc_conf.c (VIR_FROM_THIS): Define to VIR_FROM_LXC.
* src/libvirt.c (VIR_FROM_THIS): Define to VIR_FROM_NONE.
* src/node_device_conf.c (VIR_FROM_THIS): Define to VIR_FROM_NODEDEV.
* src/openvz_conf.c (VIR_FROM_THIS): Define to VIR_FROM_OPENVZ.
* src/openvz_driver.c (VIR_FROM_THIS): Define to VIR_FROM_OPENVZ.
* src/conf.c (VIR_FROM_THIS): Define to VIR_FROM_CONF.
Note: this loses config_filename:config_lineno diagnostics,
but that's ok.
* src/node_device.c (VIR_FROM_THIS): Define to VIR_FROM_NODEDEV.
* src/sexpr.c (VIR_FROM_THIS): Define to VIR_FROM_SEXPR.
* po/POTFILES.in: remove src/sexpr.c and src/lxc_conf.c
2009-01-29 12:10:32 +00:00
Daniel P. Berrange
1b745219c7
Remove use of non-reentrant POSIX apis
2009-01-22 19:41:48 +00:00
Daniel P. Berrange
437ac354fc
Make error reporting threadsafe by avoiding strerror
2009-01-20 17:13:33 +00:00
Guido Günther
043d702f02
use virAsprintf instead of asprintf
2008-12-23 13:03:29 +00:00
Daniel Veillard
df93e1ee24
add new logging module, and move existing definitions there
...
* src/logging.c src/logging.h proxy/Makefile.am proxy/libvirt_proxy.c
src/Makefile.am src/cgroup.c src/datatypes.c src/domain_event.c
src/internal.h src/libvirt.c src/lxc_container.c src/lxc_controller.c
src/lxc_driver.c src/proxy_internal.c src/qemu_driver.c
src/remote_internal.c src/storage_backend_disk.c src/util.c
src/veth.c src/xen_internal.c src/xen_unified.c src/xend_internal.c:
add new logging module, and move existing definitions there
Daniel
2008-11-06 16:36:07 +00:00
Daniel P. Berrange
d714b2afae
Move internal error APIs into virterror_internal.h & drop leading __ prefix
2008-11-04 22:30:33 +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
427f7a8b09
Switch domain device objects to array instead of linked list
2008-10-10 16:08:01 +00:00
Cole Robinson
e2a43cdb87
Move DEBUG macros to central location.
2008-10-06 19:53:06 +00:00
Dan Smith
4461568ab4
Add cgroup manipulation and LXC driver
2008-10-03 16:46:01 +00:00
Daniel P. Berrange
afac1439aa
Allow for private root filessytem in containers using pivot_root
2008-08-28 22:40:50 +00:00
Daniel P. Berrange
bb16f4a25d
Do conditional driver config in Makefile.am, not source files
2008-08-20 20:48:35 +00:00
Daniel P. Berrange
2e7a373646
Switch LXC driver over to generic domain XML processing APIs
2008-08-13 12:50:55 +00:00
Daniel P. Berrange
763dacda97
Make LXC I/O controller process a parent of the container process
2008-08-13 10:52:15 +00:00
Daniel P. Berrange
518c2144e5
Re-arrange code between LXC driver files
2008-08-13 10:25:34 +00:00
Daniel P. Berrange
e82c913680
Refactor LXC driver to pass tty/socket state directly
2008-08-13 10:14:47 +00:00
Dan Smith
0240fe9d58
[LXC] Add setup/cleanup of container network interfaces
2008-06-26 16:09:48 +00:00
Daniel P. Berrange
d789ef5a88
Switch over remaining driver code to use memory alloc apis
2008-06-06 11:09:57 +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
Daniel Veillard
9ae41a71ac
* src/Makefile.am src/lxc_conf.c src/lxc_conf.h src/lxc_container.c
...
src/lxc_container.h src/lxc_driver.c: Applied second set of
linux container patches from Dave Leskovec adding start/stop
of domains
Daniel
2008-04-10 07:30:52 +00:00