- 23 7月, 2012 1 次提交
-
-
由 Osier Yang 提交于
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
-
- 20 7月, 2012 2 次提交
-
-
由 Daniel P. Berrange 提交于
Update the libvirtd dispatch code to use virReportError instead of the virNetError custom macro Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Update the remote driver to use virReportError instead of the remoteError custom macro Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 19 7月, 2012 3 次提交
-
-
由 Daniel P. Berrange 提交于
To allow virNetServerRun/virNetServerQuit to be invoked multiple times, we must reset the 'quit' flag in virNetServerRun Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
In the delayed close mode, we're just waiting for final data to be written back to the client. While waiting, we should not bother to read more data from the client. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Guannan Ren 提交于
Instead of only removing the ending newline character, it is better to remove all of standard whitespace character for the sake of log format. One example that we have to do this is: After three times incorrect password input, virsh command virsh -c qemu://remoteserver/system will report error like: : Connection reset by peerey,gssapi-keyex,gssapi-with-mic,password). But it should be: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password). : Connection reset by peer The reason is that we dropped the newline, but have a '\r' left. The terminal interprets it as "move the cursor back to the start of the current line", so the error string is messed up.
-
- 18 7月, 2012 2 次提交
-
-
由 Daniel P. Berrange 提交于
This rmoves all the per-file error reporting macros from the code in src/rpc/ Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
The virNetServerMDNSTimeoutNew method was casting a long long to an int when reporting errors. This should just be using %lld instead of %d, avoiding the need to cast Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 12 7月, 2012 1 次提交
-
-
由 Christophe Fergeau 提交于
Commit 32a9aac2 switched libvirt to use the XDG base directories to locate most of its data/config. In particular, the per-user socket for qemu:///session is now stored in the XDG runtime directory. This directory is located by looking at the XDG_RUNTIME_DIR environment variable, with a fallback to ~/.cache/libvirt if this variable is not set. When the daemon is autospawned because a client application wants to use qemu:///session, the daemon is ran in a clean environment which does not contain XDG_RUNTIME_DIR. It will create its socket in ~/.cache/libvirt. If the client application has XDG_RUNTIME_DIR set, it will not look for the socket in the fallback place, and will fail to connect to the autospawned daemon. This patch adds XDG_RUNTIME_DIR to the daemon environment before auto-starting it. I've done this in virNetSocketForkDaemon rather than in virCommandAddEnvPassCommon as I wasn't sure we want to pass these variables to other commands libvirt spawns. XDG_CACHE_HOME and XDG_CONFIG_HOME are also added to the daemon env as it makes use of those as well.
-
- 05 7月, 2012 2 次提交
-
-
由 Daniel P. Berrange 提交于
Refactor the RPC server dispatcher code so that if 'max_workers==0' the entire server will run single threaded. This is useful for use cases where there will only ever be 1 client connected which serializes its requests Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
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: NDaniel P. Berrange <berrange@redhat.com>
-
- 23 6月, 2012 1 次提交
-
-
由 Hu Tao 提交于
The test of ref count is not protected by lock, which is unsafe because the ref count may have been changed by other threads during the test. This patch fixes this.
-
- 22 6月, 2012 1 次提交
-
-
由 Jim Fehlig 提交于
When shutting down libvirtd, the virNetServer shutdown can deadlock if there are in-flight jobs being handled by virNetServerHandleJob(). virNetServerFree() will acquire the virNetServer lock and call virThreadPoolFree() to terminate the workers, waiting for the workers to finish. But in-flight workers will attempt to acquire the virNetServer lock, resulting in deadlock. Fix the deadlock by unlocking the virNetServer lock before calling virThreadPoolFree(). This is safe since the virNetServerPtr object is ref-counted and only decrementing the ref count needs to be protected. Additionally, there is no need to re-acquire the lock after virThreadPoolFree() completes as all the workers have terminated.
-
- 13 6月, 2012 13 次提交
-
-
由 Daniel P. Berrange 提交于
First 'poll' can't return EWOULDBLOCK, and second, we're checking errno so far away from the poll() call that we've probably already trashed the original errno value.
-
由 Jiri Denemark 提交于
In addition to keepalive responses, we also need to send keepalive requests from client IO loop to properly detect dead connection in case a libvirt API is called from the main loop, which prevents any timers to be called.
-
由 Jiri Denemark 提交于
We don't need to add or remove filters when client object is already locked anymore. There's no reason to keep the *Locked variants of those APIs.
-
由 Jiri Denemark 提交于
The previous commit removed the only usage of ``all'' parameter in virKeepAliveStopInternal, which was actually the only reason for having virKeepAliveStopInternal. This effectively reverts most of commit 6446a9e2.
-
由 Jiri Denemark 提交于
When a libvirt API is called from the main event loop (which seems to be common in event-based glib apps), the client IO loop would properly handle keepalive requests sent by a server but will not actually send them because the main event loop is blocked with the API. This patch gets rid of response timer and the thread which is processing keepalive requests is also responsible for queueing responses for delivery.
-
由 Jiri Denemark 提交于
This makes it possible to create and queue new calls while we are running IO loop.
-
由 Jiri Denemark 提交于
Add virKeepAliveTimeout and virKeepAliveTrigger APIs that can be used to set poll timeouts and trigger keepalive timer. virKeepAliveTrigger checks if it is called to early and does nothing in that case.
-
由 Jiri Denemark 提交于
The code that needs to be run every keepalive interval of inactivity was only called from a timer and thus from the main event loop. We will need to call the code directly from another place.
-
由 Jiri Denemark 提交于
As we never drop non-blocking calls, the return value that used to indicate a call was dropped is no longer needed.
-
由 Jiri Denemark 提交于
As non-blocking calls are no longer dropped, we don't really need to care that much about their fate and wait for the thread with the buck to process them. If another thread has the buck, we can just push a non-blocking call to the queue and be done with it.
-
由 Jiri Denemark 提交于
So far, we were dropping non-blocking calls whenever sending them would block. In case a client is sending lots of stream calls (which are not supposed to generate any reply), the assumption that having other calls in a queue is sufficient to get a reply from the server doesn't work. I tried to fix this in b1e374a7 but failed and reverted that commit. With this patch, non-blocking calls are never dropped (unless the connection is being closed) and will always be sent.
-
由 Jiri Denemark 提交于
Normally, when every call has a thread associated with it, the thread may get the buck and be in charge of sending all calls until its own call is done. When we introduced non-blocking calls, we had to add special handling of new non-blocking calls. This patch uses event loop to send data if there is no thread to get the buck so that any non-blocking calls left in the queue are properly sent without having to handle them specially. It also avoids adding even more cruft to client IO loop in the following patches. With this change in, non-blocking calls may see unpredictable delays in delivery when the client has no event loop registered. However, the only non-blocking calls we have are keepalives and we already require event loop for them, which makes this a non-issue until someone introduces new non-blocking calls.
-
由 Jiri Denemark 提交于
When analyzing our debug log, I'm always confused about what each of the pointers mean. Let's be explicit.
-
- 11 6月, 2012 1 次提交
-
-
由 Michal Privoznik 提交于
My latest patch for RPC rework (a2c304f6) introduced a memory leak. virNetMessageEncodeHeader() is calling VIR_ALLOC_N(msg->buffer, ...) despite fact, that msg->buffer isn't VIR_FREE()'d on all paths calling the function. Therefore, rather than injecting free statement switch to VIR_REALLOC_N().
-
- 05 6月, 2012 2 次提交
-
-
由 Michal Privoznik 提交于
Since we are allocating RPC buffer dynamically, we can increase limits for max. size of RPC message and RPC string. This is needed to cover some corner cases where libvirt is run on such huge machines that their capabilities XML is 4 times bigger than our current limit. This leaves users with inability to even connect.
-
由 Michal Privoznik 提交于
Currently, we are allocating buffer for RPC messages statically. This is not such pain when RPC limits are small. However, if we want ever to increase those limits, we need to allocate buffer dynamically, based on RPC message len (= the first 4 bytes). Therefore we will decrease our mem usage in most cases and still be flexible enough in corner cases.
-
- 04 6月, 2012 1 次提交
-
-
由 Radu Caragea 提交于
The stream lock is unlocked twice instead of being locked and then unlocked. Probably a typo.
-
- 28 5月, 2012 2 次提交
-
-
由 Daniel P. Berrange 提交于
Remove the uid param from virGetUserConfigDirectory, virGetUserCacheDirectory, virGetUserRuntimeDirectory, and virGetUserDirectory These functions were universally called with the results of getuid() or geteuid(). To make it practical to port to Win32, remove the uid parameter and hardcode geteuid() Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
When you try to connect to a socket in the abstract namespace, the error will be ECONNREFUSED for a non-listening daemon. With the non-abstract namespace though, you instead get ENOENT. Add a check for this extra errno when auto-spawning the daemon Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 23 5月, 2012 1 次提交
-
-
由 Jiri Denemark 提交于
This reverts commit b1e374a7, which was rather bad since I failed to consider all sides of the issue. The main things I didn't consider properly are: - a thread which sends a non-blocking call waits for the thread with the buck to process the call - the code doesn't expect non-blocking calls to remain in the queue unless they were already partially sent Thus, the reverted patch actually breaks more than what it fixes and clients (which may even be libvirtd during p2p migrations) will likely end up in a deadlock.
-
- 26 4月, 2012 2 次提交
-
-
由 Jiri Denemark 提交于
Currently, non-blocking calls are either sent immediately or discarded in case sending would block. This was implemented based on the assumption that the non-blocking keepalive call is not needed as there are other calls in the queue which would keep the connection alive. However, if those calls are no-reply calls (such as those carrying stream data), the remote party knows the connection is alive but since we don't get any reply from it, we think the connection is dead. This is most visible in tunnelled migration. If it happens to be longer than keepalive timeout (30s by default), it may be unexpectedly aborted because the connection is considered to be dead. With this patch, we only discard non-blocking calls when the last call with a thread is completed and thus there is no thread left to keep sending the remaining non-blocking calls.
-
由 Peter Krempa 提交于
The docs for virConnectSetKeepAlive() advertise that this function should be able to disable keepalives on negative or zero interval time. This patch removes the check that prohibited this and adds code to disable keepalives on negative/zero interval. * src/libvirt.c: virConnectSetKeepAlive(): - remove check for negative values * src/rpc/virnetclient.c * src/rpc/virnetclient.h: - add virNetClientKeepAliveStop() to disable keepalive messages * src/remote/remote_driver.c: remoteSetKeepAlive(): -add ability to disable keepalives
-
- 20 4月, 2012 2 次提交
-
-
由 Eric Blake 提交于
POSIX says that sa_sigaction is only safe to use if sa_flags includes SA_SIGINFO; conversely, sa_handler is only safe to use when flags excludes that bit. Gnulib doesn't guarantee an implementation of SA_SIGINFO, but does guarantee that if SA_SIGINFO is undefined, we can safely define it to 0 as long as we don't dereference the 2nd or 3rd argument of any handler otherwise registered via sa_sigaction. Based on a report by Wen Congyang. * src/rpc/virnetserver.c (SA_SIGINFO): Stub for mingw. (virNetServerSignalHandler): Avoid bogus dereference. (virNetServerFatalSignal, virNetServerNew): Set flags properly. (virNetServerAddSignalHandler): Drop unneeded #ifdef.
-
由 Daniel P. Berrange 提交于
DBus connection. The HAL device code further requires that the DBus connection is integrated with the event loop and provides such glue logic itself. The forthcoming FirewallD integration also requires a dbus connection with event loop integration. Thus we need to pull the current event loop glue out of the HAL driver. Thus we create src/util/virdbus.{c,h} files. This contains just one method virDBusGetSystemBus() which obtains a handle to the single shared system bus instance, with event glue automagically setup.
-
- 10 4月, 2012 1 次提交
-
-
由 Daniel P. Berrange 提交于
-
- 30 3月, 2012 1 次提交
-
-
由 Daniel P. Berrange 提交于
The code is splattered with a mix of sizeof foo sizeof (foo) sizeof(foo) Standardize on sizeof(foo) and add a syntax check rule to enforce it Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 08 3月, 2012 1 次提交
-
-
由 Eric Blake 提交于
Commit 5d4b0c4c tried to fix certain classes of VPATH builds, but was too limited. In particular, Guannan Ren reported: > For example: The libvirt source code resides in /home/testuser, > I make dist in /tmp/buildvpath, the XDR routine .c file will > include full path of the header file like: > > #include "/home/testuser/src/rpc/virnetprotocol.h" > #include "internal.h" > #include <arpa/inet.h> > > If we distribute the tarball to another machine to compile, > it will report error as follows: > > rpc/virnetprotocol.c:7:59: fatal error: > /home/testuser/src/rpc/virnetprotocol.h: No such file or directory * src/rpc/genprotocol.pl: Fix more include lines.
-