- 20 7月, 2012 1 次提交
-
-
由 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>
-
- 04 12月, 2011 1 次提交
-
-
由 Eric Blake 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=648855 mentioned a misuse of 'an' where 'a' is proper; that has since been fixed, but a search found other problems (some were a spelling error for 'and', while most were fixed by 'a'). * daemon/stream.c: Fix grammar. * src/conf/domain_conf.c: Likewise. * src/conf/domain_event.c: Likewise. * src/esx/esx_driver.c: Likewise. * src/esx/esx_vi.c: Likewise. * src/rpc/virnetclient.c: Likewise. * src/rpc/virnetserverprogram.c: Likewise. * src/storage/storage_backend_fs.c: Likewise. * src/util/conf.c: Likewise. * src/util/dnsmasq.c: Likewise. * src/util/iptables.c: Likewise. * src/xen/xen_hypervisor.c: Likewise. * src/xen/xend_internal.c: Likewise. * src/xen/xs_internal.c: Likewise. * tools/virsh.c: Likewise.
-
- 16 11月, 2011 1 次提交
-
-
由 Daniel P. Berrange 提交于
Very occasionally the sequence of events from poll would result in getting a HANGUP on its own, instead of a HANGUP+READABLE at the same time. In the former case we would send back an error event to the client, but never send the empty packet to indicate EOF.
-
- 27 9月, 2011 1 次提交
-
-
由 Michal Privoznik 提交于
as they are not used with debugging turned off.
-
- 01 9月, 2011 2 次提交
-
-
由 Daniel P. Berrange 提交于
Commit 2c85644b attempted to fix a problem with tracking RPC messages from streams by doing - if (msg->header.type == VIR_NET_REPLY) { + if (msg->header.type == VIR_NET_REPLY || + (msg->header.type == VIR_NET_STREAM && + msg->header.status != VIR_NET_CONTINUE)) { client->nrequests--; In other words any stream packet, with status NET_OK or NET_ERROR would cause nrequests to be decremented. This is great if the packet from from a synchronous virStreamFinish or virStreamAbort API call, but wildly wrong if from a server initiated abort. The latter resulted in 'nrequests' being decremented below zero. This then causes all I/O for that client to be stopped. Instead of trying to infer whether we need to decrement the nrequests field, from the message type/status, introduce an explicit 'bool tracked' field to mark whether the virNetMessagePtr object is subject to tracking. Also add a virNetMessageClear function to allow a message contents to be cleared out, without adversely impacting the 'tracked' field as a naive memset() would do * src/rpc/virnetmessage.c, src/rpc/virnetmessage.h: Add a 'bool tracked' field and virNetMessageClear() API * daemon/remote.c, daemon/stream.c, src/rpc/virnetclientprogram.c, src/rpc/virnetclientstream.c, src/rpc/virnetserverclient.c, src/rpc/virnetserverprogram.c: Switch over to use virNetMessageClear() and pass in the 'bool tracked' value when creating messages.
-
由 Daniel P. Berrange 提交于
When sending outbound stream RPC messages, a callback is used to re-enable stream data transmission. If the stream aborts while one of these messages is outstanding, the stream may have been free'd by the time it is invoked. This results in a use-after-free error * daemon/stream.c: Ref-count streams to avoid use-after-free
-
- 31 8月, 2011 1 次提交
-
-
由 Guannan Ren 提交于
*daemon/stream.c: remove virNetServerClientRef()
-
- 18 8月, 2011 1 次提交
-
-
由 Daniel P. Berrange 提交于
The I/O event callback processes incoming packets first, and then does outgoing packets. If the incoming packet caused the stream to close, then the attempt to process outgoing data resulted in an error. This caused libvirt to then send an error back to the client, but the stream had already been stopped. This confused the client since it sees 2 error events. * daemon/stream.c: Don't attempt read if stream is closed
-
- 17 8月, 2011 1 次提交
-
-
由 Daniel P. Berrange 提交于
Every active stream results in a reference being held on the virNetServerClientPtr object. This meant that if a client quit with any streams active, although all I/O was stopped the virNetServerClientPtr object would leak. This causes libvirtd to leak any file handles associated with open streams when a client quit To fix this, when we call virNetServerClientClose there is a callback invoked which lets the daemon release the streams and thus the extra references * daemon/remote.c: Add a hook to close all streams * daemon/stream.c, daemon/stream.h: Add API for releasing all streams * src/rpc/virnetserverclient.c, src/rpc/virnetserverclient.h: Allow registration of a hook to trigger when closing client
-
- 08 7月, 2011 2 次提交
-
-
由 Daniel P. Berrange 提交于
The dispatch for the CLOSE RPC call was invoking the method virNetServerClientClose(). This caused the client connection to be immediately terminated. This meant the reply to the final RPC message was never sent. Prior to the RPC rewrite we merely flagged the connection for closing, and actually closed it when the next RPC call dispatch had completed. * daemon/remote.c: Flag connection for a delayed close * daemon/stream.c: Update to use new API for closing failed connection * src/rpc/virnetserverclient.c, src/rpc/virnetserverclient.h: Add support for a delayed connection close. Rename the virNetServerClientMarkClose method to virNetServerClientImmediateClose to clarify its semantics
-
由 Daniel P. Berrange 提交于
If a client disconnects while it has a stream active, there is a race condition which could see libvirtd crash. This is because the client struct may be freed before the last stream event has triggered. This is trivially solved by holding an extra reference on the client for the stream callbak * daemon/stream.c: Acquire reference on client when adding the stream callback
-
- 01 7月, 2011 2 次提交
-
-
由 Daniel P. Berrange 提交于
If a message packet for a invalid stream is received it is just free'd. This is not good because it doesn't let the client RPC request counter decrement. If a stream is shutdown with pending packets the message also isn't released properly because of an incorrect header type * daemon/stream.c: Fix message header type * src/rpc/virnetserverprogram.c: Send dummy reply instead of free'ing ignored stream message
-
由 Daniel P. Berrange 提交于
The stream code was reusing a stream message object before it was removed from the linked list of filtered messages. This caused any later queued messages to be completely lost. * daemon/stream.c: Delay reuse of stream message until after it is removed from the queue
-
- 29 6月, 2011 1 次提交
-
-
由 Daniel P. Berrange 提交于
This guts the libvirtd daemon, removing all its networking and RPC handling code. Instead it calls out to the new virServerPtr APIs for all its RPC & networking work As a fallout all libvirtd daemon error reporting now takes place via the normal internal error reporting APIs. There is no need to call separate error reporting APIs in RPC code, nor should code use VIR_WARN/VIR_ERROR for reporting fatal problems anymore. * daemon/qemu_dispatch_*.h, daemon/remote_dispatch_*.h: Remove old generated dispatcher code * daemon/qemu_dispatch.h, daemon/remote_dispatch.h: New dispatch code * daemon/dispatch.c, daemon/dispatch.h: Remove obsoleted code * daemon/remote.c, daemon/remote.h: Rewrite for new dispatch APIs * daemon/libvirtd.c, daemon/libvirtd.h: Remove all networking code * daemon/stream.c, daemon/stream.h: Update for new APIs * daemon/Makefile.am: Link to libvirt-net-rpc-server.la
-
- 17 5月, 2011 1 次提交
-
-
由 Matthias Bolte 提交于
virStreamNew needs to dispatch the error that virGetStream reports on failure. remoteCreateClientStream can fail due to virStreamNew or due to VIR_ALLOC. Report OOM error for VIR_ALLOC failure to report errors in all error cases. Remove OOM error reporting from remoteCreateClientStream callers.
-
- 12 5月, 2011 1 次提交
-
-
由 Lai Jiangshan 提交于
These VIR_XXXX0 APIs make us confused, use the non-0-suffix APIs instead. How do these coversions works? The magic is using the gcc extension of ##. When __VA_ARGS__ is empty, "##" will swallow the "," in "fmt," to avoid compile error. example: origin after CPP high_level_api("%d", a_int) low_level_api("%d", a_int) high_level_api("a string") low_level_api("a string") About 400 conversions. 8 special conversions: VIR_XXXX0("") -> VIR_XXXX("msg") (avoid empty format) 2 conversions VIR_XXXX0(string_literal_with_%) -> VIR_XXXX(%->%%) 0 conversions VIR_XXXX0(non_string_literal) -> VIR_XXXX("%s", non_string_literal) (for security) 6 conversions Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
-
- 18 4月, 2011 1 次提交
-
-
由 Daniel P. Berrange 提交于
The dispatcher functions have numerous places where they return to the caller. This leads to duplicated cleanup code, often resulting in memory leaks. It makes it harder to ensure that errors are dispatched before freeing objects, which may overwrite the original error. The standard pattern is now remoteDispatchXXX(...) { int rv = -1; .... if (XXX < 0) goto cleanup; ... if (XXXX < 0) goto cleanup; ... rv = 0; cleanup: if (rv < 0) remoteDispatchError(rerr); ...free all other stuff.. return rv; } * daemon/remote.c: Centralize all cleanup paths * daemon/stream.c: s/remoteDispatchConnError/remoteDispatchError/ * daemon/dispatch.c, daemon/dispatch.h: Replace remoteDispatchConnError with remoteDispatchError removing unused virConnectPtr
-
- 29 3月, 2011 1 次提交
-
-
由 Daniel P. Berrange 提交于
The daemon loops over the linked list of streams when a client quits, closing any that the client hadn't already closed. Except it didn't ever move to the next element in the list! * daemon/stream.c: Fix loop over linked list of streams
-
- 21 2月, 2011 1 次提交
-
-
由 Eric Blake 提交于
Done mechanically with: $ git grep -l '\bDEBUG0\? *(' | xargs -L1 sed -i 's/\bDEBUG0\? *(/VIR_&/' followed by manual deletion of qemudDebug in daemon/libvirtd.c, along with a single 'make syntax-check' fallout in the same file, and the actual deletion in src/util/logging.h. * src/util/logging.h (DEBUG, DEBUG0): Delete. * daemon/libvirtd.h (qemudDebug): Likewise. * global: Change remaining clients over to VIR_DEBUG counterpart.
-
- 12 11月, 2010 1 次提交
-
-
由 Daniel P. Berrange 提交于
When closing open streams after a client quits, the event callback was not removed. This mean that poll() was using a closed FD and returning POLLNVAL in a busy-wait loop. * daemon/stream.c: Disconnect stream callbacks
-
- 30 9月, 2009 1 次提交
-
-
由 Chris Lalancette 提交于
Right now, the stream stuff assumes that a stream is always going to be used for transmit. This is not the case, and in fact doesn't work with the tunnelled migration stuff. Add a flag to remoteClientStream() to allow it to do RX only. Signed-off-by: NChris Lalancette <clalance@redhat.com>
-
- 29 9月, 2009 3 次提交
-
-
由 Daniel P. Berrange 提交于
* daemon/dispatch.c: Set streamTX flag on outgoing data packets * daemon/qemud.h: Add streamTX flag to track outgoing data * daemon/qemud.c: Re-enable further TX when outgoing data packet has been fully sent. * daemon/stream.h, daemon/stream.c: Add method for enabling TX. Support reading from streams and transmitting data out to client
-
由 Daniel P. Berrange 提交于
* daemon/stream.c: Handle incoming stream data packets, queuing until stream becomes writable. Handle stream completion handshake * po/POTFILES.in: Add daemon/stream.c
-
由 Daniel P. Berrange 提交于
Defines the extensions to the remote protocol for generic data streams. Adds a bunch of helper code to the libvirtd daemon for working with data streams. * daemon/Makefile.am: Add stream.c/stream.h to build * daemon/stream.c, qemud/stream.h: Generic helper functions for creating new streams, associating streams with clients, finding existing streams for a client and removing/deleting streams. * src/remote/remote_protocol.x: Add a new 'REMOTE_STREAM' constant for the 'enum remote_message_type' for encoding stream data in wire messages. Add a new 'REMOTE_CONTINUE' constant to 'enum remote_message_status' to indicate further data stream messsages are expected to follow. Document how the remote_message_header is used to encode data streams * src/remote/remote_protocol.h: Regenerate * daemon/dispatch.c: Remove assumption that a error message sent to client is always type=REMOTE_REPLY. It may now also be type=REMOTE_STREAM. Add convenient method for sending outgoing stream data packets. Log and ignore non-filtered incoming stream packets. Add a method for serializing a stream error message * daemon/dispatch.h: Add API for serializing stream errors and sending stream data packets * daemon/qemud.h: Add struct qemud_client_stream for tracking active data streams for clients. Tweak filter function operation so that it accepts a client object too. * daemon/qemud.c: Refactor code for free'ing message objects which have been fully transmitted into separate method. Release all active streams when client shuts down. Change filter function to be responsible for queueing the message
-