aboutsummaryrefslogtreecommitdiff
path: root/daemon
Commit message (Collapse)AuthorAgeFilesLines
* maint: fix up copyright notice inconsistenciesEric Blake2012-09-208-8/+8
| | | | | | | | | https://www.gnu.org/licenses/gpl-howto.html recommends that the 'If not, see <url>.' phrase be a separate sentence. * tests/securityselinuxhelper.c: Remove doubled line. * tests/securityselinuxtest.c: Likewise. * globally: s/; If/. If/
* build: define WITH_INTERFACE for the driverDoug Goldstein2012-09-192-5/+5
| | | | | | | | | | | | | | | | | | Based exclusively on work by Eric Blake in a patch posted with the same subject. However some modifications related to comments and my plans to add another backend. Added WITH_INTERFACE as the only automake variable deciding whether to build the driver and using WITH_NETCF to identify that we're wanting to use the netcf library as the backend. * configure.ac: Added with_interface * src/interface/netcf_driver.c: Renamed.. * src/interface/interface_backend_netcf.c: ..to this to match storage. * src/interface/netcf_driver.h: Renamed.. * src/interface/interface_driver.h: ..to this. * daemon/Makefile.am: Respect WITH_INTERFACE and WITH_NETCF. * libvirt.spec.in: Add RPM support for --with-interface
* node_memory: Wire up the RPC protocolOsier Yang2012-09-171-0/+60
| | | | | | | | | | | | | * src/rpc/gendispatch.pl: (virNodeSetMemoryParameters is the the special one which needs a connection object as the first argument, improve the generator to support it). * daemon/remote.c: (Implement the server side handler for virDomainGetMemoryParameters) * src/remote/remote_driver.c: (Implement the client side handler for virDomainGetMemoryParameters) * src/remote/remote_protocol.x: (New RPC procedures for the two new APIs and structs to represent the args and ret for it) * src/remote_protocol-structs: Likewise
* list: Implement RPC calls for virConnectListAllSecretsOsier Yang2012-09-171-0/+54
| | | | | | | | | | | | | | | | | The RPC generator doesn't support returning list of object yet, this patch does the work manually. * daemon/remote.c: Implement the server side handler remoteDispatchConnectListAllSecrets. * src/remote/remote_driver.c: Add remote driver handler remoteConnectListAllSecrets. * src/remote/remote_protocol.x: New RPC procedure REMOTE_PROC_CONNECT_LIST_ALL_SECRETS and structs to represent the args and ret for it. * src/remote_protocol-structs: Likewise.
* list: Implement RPC calls for virConnectListAllNWFiltersOsier Yang2012-09-171-0/+54
| | | | | | | | | | | | | | | | | The RPC generator doesn't support returning list of object yet, this patch do the work manually. * daemon/remote.c: Implemente the server side handler remoteDispatchConnectListAllNWFilters. * src/remote/remote_driver.c: Add remote driver handler remoteConnectListAllNWFilters. * src/remote/remote_protocol.x: New RPC procedure REMOTE_PROC_CONNECT_LIST_ALL_NWFILTERS and structs to represent the args and ret for it. * src/remote_protocol-structs: Likewise.
* list: Implement RPC calls for virConnectListAllNodeDevicesOsier Yang2012-09-171-0/+53
| | | | | | | | | | | | | | The RPC generator doesn't support returning list of object yet, this patch does the work manually. * daemon/remote.c: Implemente the server side handler remoteDispatchConnectListAllNodeDevices. * src/remote/remote_driver.c: Add remote driver handler remoteConnectListAllNodeDevices. * src/remote/remote_protocol.x: New RPC procedure REMOTE_PROC_CONNECT_LIST_ALL_INTERFACES and
* list: Implemente RPC calls for virConnectListAllInterfacesOsier Yang2012-09-121-0/+54
| | | | | | | | | | | | | | | | | The RPC generator doesn't support returning list of object yet, this patch do the work manually. * daemon/remote.c: Implemente the server side handler remoteDispatchConnectListAllInterfaces. * src/remote/remote_driver.c: Add remote driver handler remoteConnectListAllInterfaces. * src/remote/remote_protocol.x: New RPC procedure REMOTE_PROC_CONNECT_LIST_ALL_INTERFACES and structs to represent the args and ret for it. * src/remote_protocol-structs: Likewise.
* list: Implement RPC calls for virConnectListAllNetworksOsier Yang2012-09-111-0/+55
| | | | | | | | | | | | | | | | | The RPC generator doesn't support returning list of object, this patch do the work manually. * daemon/remote.c: Implemente the server side handler remoteDispatchConnectListAllNetworks. * src/remote/remote_driver.c: Add remote driver handler remoteConnectListAllNetworks. * src/remote/remote_protocol.x: New RPC procedure REMOTE_PROC_CONNECT_LIST_ALL_NETWORKS and structs to represent the args and ret for it. * src/remote_protocol-structs: Likewise.
* list: Implement RPC calls for virStoragePoolListAllVolumesOsier Yang2012-09-101-0/+58
| | | | | | | | | | | | | | | | | The RPC generator doesn't returning support list of object, this patch do the work manually. * daemon/remote.c: Implemente the server side handler remoteDispatchStoragePoolListAllVolumes * src/remote/remote_driver.c: Add remote driver handler remoteStoragePoolListAllVolumes * src/remote/remote_protocol.x: New RPC procedure REMOTE_PROC_STORAGE_POOL_LIST_ALL_VOLUMES and structs to represent the args and ret for it. * src/remote_protocol-structs: Likewise.
* Fix PMSuspend and PMWakeup eventsJiri Denemark2012-09-071-0/+2
| | | | | | The unused reason parameter of PM{Suspend,Wakeup} event callbacks was completely ignored in lot of places and those events were not actually working at all.
* list: Implement the RPC calls for virConnectListAllStoragePoolsOsier Yang2012-09-061-0/+54
| | | | | | | | | | | | | | | | | The RPC generator doesn't support returning list of object, this patch does the work manually. * daemon/remote.c: Implement the server side handler remoteDispatchConnectListAllStoragePools * src/remote/remote_driver.c: Add remote driver handler remoteConnectListAllStoragePools. * src/remote/remote_protocol.x: New RPC procedure REMOTE_PROC_CONNECT_LIST_ALL_STORAGE_POOLS and structs to represent the args and ret for it. * src/remote_protocol-structs: Likewise.
* Fix xen driver following changes to make it statefulJim Fehlig2012-08-312-6/+16
| | | | | | | | | | | | | | | | | | | | | | Recent work to improve support for loadable driver modules introduced a regression in the xen driver. The legacy xen driver is now a stateful, libvirtd driver but was not being registered when building without driver modules. A slight behavior change was also noted in the xen drivers when built as driver modules. Previously, explicitly specifying a connection URI was not necessary, but now Compiled against library: libvirt 0.10.0 Using library: libvirt 0.10.0 Using API: QEMU 0.10.0 error: failed to get the hypervisor version error: internal error Cannot find suitable emulator for x86_64 The xen drivers need to be registered before the qemu driver since the qemu driver will return success with a null connection URI. This ordering is safe since the xen drivers will decline when not running the xen kernel.
* Portability fixes for non-linux or old linux platformsDaniel Veillard2012-08-291-0/+4
| | | | | | | | | | The commits d57567940153147f4d43875fb92c3030b3178b03 and 080bf330e3749d94ebe094f8deca0e3e67d3f2fe made use directly of macro defined in recent linux netlink version. Make those part conditional on the definition * daemon/libvirtd.c: do not use NETLINK_ROUTE and NETLINK_KOBJECT_UEVENT without some check first
* Add uevent netlink service.Tang Chen2012-08-221-0/+6
| | | | | | | This patch adds a new netlink service with NETLINK_KOBJECT_UEVENT protocol hotplug event. Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
* Introduce virNetlinkEventServiceStopAll() to stop all netlink services.Tang Chen2012-08-221-1/+1
| | | | | | | This patch introduce virNetlinkEventServiceStopAll() to stop all the monitors to receive netlink messages for libvirtd. Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
* Improve netlink to support all protocol.Tang Chen2012-08-221-3/+3
| | | | | | | | This patch improve all the API in virnetlink.c to support all kinds of netlink protocols, and make all netlink sockets be able to join in groups. Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
* remote: introduce emulator pinning RPCsTang Chen2012-08-221-0/+91
| | | | | | | | | | Introduce 2 APIs to support emulator threads in remote driver. 1) remoteDomainPinEmulator: call driver api, such as qemudDomainPinEmulator. 2) remoteDomainGetEmulatorPinInfo: call driver api, such as qemudDomainGetEmulatorPinInfo. They are similar to remoteDomainPinVcpuFlags and remoteDomainGetVcpuPinInfo. Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com> Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
* daemon: Autodetect lock driver directoryJiri Denemark2012-08-211-2/+4
| | | | | | | | When running libvirtd from a build directory, libvirtd would load lock drivers from system directory unless explicitly overridden by setting LIBVIRT_LOCK_MANAGER_PLUGIN_DIR environment variable. Since we already autodetect driver directory if libvirt is build with driver modules, we can use the same trick to automagically set lock driver directory.
* Update the remote APIMarcelo Cerri2012-08-201-0/+63
| | | | | | | This patch updates libvirt's API to allow applications to inspect the full list of security labels of a domain. Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
* docs: Enhance documentation of log_filtersJiri Denemark2012-08-171-3/+6
| | | | | Also make sure documentation in libvirtd.conf matches the one from logging.html.
* Update libvirtd --help output to match codeDoug Goldstein2012-08-151-2/+2
| | | | | Updated the paths that libvirtd --help says are used when run as non-root to match what the code actually does.
* Update paths in man page to reflect libvirtd codeDoug Goldstein2012-08-151-5/+38
| | | | | | | | | Updated the paths in the man page to reflect what the code in libvirtd does. In addition broke out the FILES section into two subsections for files used when run as root and files used when run as non-root. Provided information about the defaults that libvirtd uses when running as non-root and when XDG_CONFIG_HOME and XDG_RUNTIME_DIR are not set in the environment.
* Replace unset REMOTE_PID_FILE with proper valueDoug Goldstein2012-08-152-6/+4
| | | | | | | REMOTE_PID_FILE is no longer used in the source or the build process but the man page still used it resulting in no file name being displayed. The same value that the libvirtd daemon code uses is now used in the man page.
* Fix man page file paths to real pathsDoug Goldstein2012-08-152-12/+12
| | | | | | | | Currently the man page has paths that start with @sysconfdir@, @localstatedir@ and @remote_pid_file@. The sed command attempts to replace these during the build but unfortunately pod2man gets to the files first and escapes the @ character resulting in the sed not working. This removes the @ character and makes the paths correct.
* Refactor RPC client private data setupDaniel P. Berrange2012-08-153-12/+10
| | | | | | | | | | | | | Currently there is a hook function that is invoked when a new client connection comes in, which allows an app to setup private data. This setup will make it difficult to serialize client state during process re-exec(). Change to a model where the app registers a callback when creating the virNetServerPtr instance, which is used to allocate the client private data immediately during virNetClientPtr construction. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Turn virNetServer* into virObject instancesDaniel P. Berrange2012-08-072-25/+16
| | | | | | | Make all the virNetServer* objects use the virObject APIs for reference counting Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Turn virNetSASLContext and virNetSASLSession into virObject instancesDaniel P. Berrange2012-08-071-4/+4
| | | | | | | Make virNetSASLContext and virNetSASLSession use virObject APIs for reference counting Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Turn virNetTLSContext and virNetTLSSession into virObject instancesDaniel P. Berrange2012-08-071-2/+2
| | | | | | | Make virNetTLSContext and virNetTLSSession use the virObject APIs for reference counting Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* daemon: Portable auto-detection of driver module directoryJiri Denemark2012-08-021-1/+2
| | | | | | When running libvirtd from a build directory on a system with unmodified libtool, libvirtd's binary is not renamed as "lt-libvirtd". Check for "/daemon/.libs/libvirtd" in addition to "lt-libvirtd".
* build: Link security manager into libvirt.soJiri Denemark2012-08-021-1/+0
| | | | | | | | | | | | Security manager is not a dynamically loadable driver, it's a common infrastructure similar to util, conf, cpu, etc. used by individual drivers. Such code is allowed to be linked into libvirt.so. This reverts commit ec5b7bd2ecbf40ceff5b2d4fc00d5cfdfba966a4 and most of aae5cfb69948fddef556f8f5b9f80a444f9c6125. This patch is supposed to fix virdrivermoduletest failures for qemu and lxc drivers as well as libvirtd's ability to load qemu and lxc drivers.
* Remove manual one-shot global initializersDaniel P. Berrange2012-08-021-1/+0
| | | | | | | | Remove the use of a manually run virLogStartup and virNodeSuspendInitialize methods. Instead make sure they are automatically run using VIR_ONCE_GLOBAL_INIT Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* build: Link security driver into daemonJiri Denemark2012-08-011-0/+1
| | | | | | Commit aae5cfb69948fddef556f8f5b9f80a444f9c6125 removed security driver from libvirt_la but forgot to link it into libvirtd in case libvirt is built without modules.
* daemon: Fix crash in virTypedParameterArrayClearJiri Denemark2012-07-301-8/+8
| | | | | | | | | | | | | | | | | | | Daemon uses the following pattern when dispatching APIs with typed parameters: VIR_ALLOC_N(params, nparams); virDomain*(dom, params, &nparams, flags); virTypedParameterArrayClear(params, nparams); In case nparams was originally set to 0, virDomain* API would fill it with the number of typed parameters it can provide and we would use this number (rather than zero) to clear params. Because VIR_ALLOC* returns non-NULL pointer even if size is 0, the code would end up walking through random memory. If we were lucky enough and the memory contained 7 (VIR_TYPED_PARAM_STRING) at the right place, we would try to free a random pointer and crash. Let's make sure params stays NULL when nparams is 0.
* Make RPC code generator a little more flexibleDaniel P. Berrange2012-07-301-2/+2
| | | | | | | | | | Update the gendispatch.pl script to get a little closer to being able to generate code for the LXC monitor, by passing in the struct prefix separately from the procedure prefix. Also allow method names using virCapitalLetters instead of vir_underscore_separator Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* doc: add more description on libvirtd option timeoutGuannan Ren2012-07-261-1/+4
|
* Fixup manpage names and copyright datesLaine Stump2012-07-252-2/+2
| | | | | | | | | | | | | | The copyright dates in the manpages haven't been updated in awhile. Also, when pod2man converts a pod file into a manpage, it will only remove the extension from the filename if it is ".pod". Some of the libvirt pod files are named *.pod.in, and that filename is placed unchanged into the manpage. This patch uses pod2man's --name option to fix that. Believe it or not, there's even a BZ for this: https://bugzilla.redhat.com/show_bug.cgi?id=819364
* daemon: Fix the wrong macro nameOsier Yang2012-07-241-1/+1
| | | | | | | | | | | | | | WITH_INTERFACE is not defined, it should be WITH_NETCF there to load the interface driver. Eric posted patch weeks ago to resolve the problems in the whole build system, but it's not finalised yet: https://www.redhat.com/archives/libvir-list/2012-June/msg01299.html I'm going to simply fix the wrong macro name here so that the interface driver could loaded, and continue the work on the listing API for interface driver.
* Fix libnl CFLAGS/LIBS inclusionDoug Goldstein2012-07-241-2/+3
| | | | | | When using libnl, use the variables pkg-config provides in case there are additional libraries or CFLAGS required to build it. Specifically if the libnl headers are not directly in /usr/include.
* More advanced auto-detection of driver module directoryDaniel P. Berrange2012-07-241-3/+21
| | | | | | | | When running directly from GIT, libvirtd attempts to locate the directory containing loadable modules. This currently only works if executing libvirtd with a CWD inside the libvirt source tree. Switch to locate based on the path to the current binary instead
* Desert the FSF address in copyrightOsier Yang2012-07-238-16/+16
| | | | | | | | | | | | | | | | | | | | | | Per the FSF address could be changed from time to time, and GNU recommends the following now: (http://www.gnu.org/licenses/gpl-howto.html) You should have received a copy of the GNU General Public License along with Foobar. If not, see <http://www.gnu.org/licenses/>. This patch removes the explicit FSF address, and uses above instead (of course, with inserting 'Lesser' before 'General'). Except a bunch of files for security driver, all others are changed automatically, the copyright for securify files are not complete, that's why to do it manually: src/security/security_selinux.h src/security/security_driver.h src/security/security_selinux.c src/security/security_apparmor.h src/security/security_apparmor.c src/security/security_driver.c
* Replace use of virNetError with virReportErrorDaniel P. Berrange2012-07-202-122/+114
| | | | | | | Update the libvirtd dispatch code to use virReportError instead of the virNetError custom macro Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Replace use of virConfError with virReportErrorDaniel P. Berrange2012-07-201-32/+28
| | | | | | | Update the libvirtd config handling code to use virReportError instead of the virConfError custom macro Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Define public API for receiving guest memory balloon eventsDaniel P. Berrange2012-07-141-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | When the guest changes its memory balloon applications may want to know what the new value is, without having to periodically poll on XML / domain info. Introduce a "balloon change" event to let apps see this * include/libvirt/libvirt.h.in: Define the virConnectDomainEventBalloonChangeCallback callback and VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE constant * python/libvirt-override-virConnect.py, python/libvirt-override.c: Wire up helpers for new event * daemon/remote.c: Helper for serializing balloon event * examples/domain-events/events-c/event-test.c, examples/domain-events/events-python/event-test.py: Add example of balloon event usage * src/conf/domain_event.c, src/conf/domain_event.h: Handling of balloon events * src/remote/remote_driver.c: Add handler of balloon events * src/remote/remote_protocol.x: Define wire protocol for balloon events * src/remote_protocol-structs: Likewise. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* systemd: start libvirtd after networkJim Fehlig2012-07-101-0/+1
| | | | | | | | | | Domains configured with autostart may fail to start if the host network stack has not been started. E.g. when using bridged networking autostarting a domain can fail with libvirtd[1403]: 2012-06-20 13:23:49.833+0000: 1485: error : qemuAutostartDomain:177 : Failed to autostart VM 'test': Cannot get interface MTU on 'br0': No such device
* Add a opaque parameter to the RPC client init callbackDaniel P. Berrange2012-07-053-3/+6
| | | | | | | | The callback that is invoked when a new RPC client is initialized does not have any opaque parameter. Add one so that custom data can be passed into the callback Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Don't install systemd service files executableGuido Günther2012-06-261-1/+1
| | | | since they aren't. Detected by Debian's lintian.
* list: provide RPC call for snapshotsEric Blake2012-06-191-0/+126
| | | | | | | | | | | | | | | The generator doesn't handle lists of virDomainSnapshotPtr, so this commit requires a bit more work than some RPC additions. * src/remote/remote_protocol.x (REMOTE_PROC_DOMAIN_LIST_ALL_SNAPSHOTS) (REMOTE_PROC_DOMAIN_SNAPSHOT_LIST_ALL_CHILDREN): New RPC calls, with corresponding structs. * daemon/remote.c (remoteDispatchDomainListAllSnapshots) (remoteDispatchDomainSnapshotListAllChildren): New functions. * src/remote/remote_driver.c (remoteDomainListAllSnapshots) (remoteDomainSnapshotListAllChildren): Likewise. * src/remote_protocol-structs: Regenerate.
* remote: implement remote protocol for virConnectListAllDomains()Peter Krempa2012-06-181-0/+54
| | | | | | | | | | This patch wires up the RPC protocol handlers for virConnectListAllDomains(). The RPC generator has no support for the way how virConnectListAllDomains() returns the results so the handler code had to be done manually. The new api is handled by REMOTE_PROC_CONNECT_LIST_ALL_DOMAINS, with number 273 and marked with high priority.
* Add more debug logging for libvirtd startupDaniel P. Berrange2012-06-151-11/+29
| | | | | To facilitate future troubleshooting add a bunch more debugging statements into important startup parts of libvirt
* Fix privileges on /var/run/libvirt directoryDaniel P. Berrange2012-06-111-1/+4
| | | | | | | | | | | | | | | | Previous commit commit 32a9aac2e04c991340b66c855a1095e4e6445e54 Author: William Jon McCann <william.jon.mccann@gmail.com> Date: Thu May 3 12:36:27 2012 -0400 Use XDG Base Directories instead of storing in home directory Accidentally changed the umask when creating /var/run/libvirt to 077. This prevents /var/run/libvirt being readable by non-root, which is required for non-root to connect to libvirtd. Fix the code so that umask 077 is only used for the non-privileged libvirtd instance.