Ok, with that fix, my asynchronous Java event implementation seems to be working (though not fully tested) with these patches. But I'm not using connection cloning (yet). It's your concurrency control in the remote driver that makes this work. On the Java side, domain event callbacks from another thread work because of the (Java) locking of Connect objects. I don't think I should remove that, since libvirt still prohibits concurrent use of the same virConnect object (right?) I suppose I could clone the virConnect object before delivering an event to a Java Domain (so the Domain's Connect would wrap the clone). I don't think this does much in the remote case (since the underlying RPC pipe it still shared, albeit safely). But I suppose it might allow greater concurrency in the non-remote cases. Is this what you had in mind? Dave On Wed, 2008-12-17 at 11:21 -0500, David Lively wrote: > On Wed, 2008-12-17 at 13:58 +0000, Daniel P. Berrange wrote: > > On Wed, Dec 17, 2008 at 07:44:15AM -0500, David Lively wrote: > > > Hi Daniel - > > > When I apply these patches, I'm seeing segfaults on event delivery > > > when just running the existing synchronous > > > examples/domain-events/events-c/event-test.c (using the remote driver). > > > > I've not come across that specific problem, but there are a definitely > > some locking bugs & refcounting bugs inthe patches I've posted so far. > > I'll post an updated series of patches which may address this. > > > > Daniel > > It turned out to be a double-free. Trivial fix below. > > Dave > > diff --git a/src/remote_internal.c b/src/remote_internal.c > index 9245a2a..d6b94ff 100644 > --- a/src/remote_internal.c > +++ b/src/remote_internal.c > @@ -6423,10 +6423,10 @@ remoteDomainQueueEvent(virConnectPtr conn, XDR > *xdr) > return; > > if (virDomainEventQueuePush(priv->domainEvents, > - event) < 0) > + event) < 0) { > DEBUG0("Error adding event to queue"); > - > - virDomainEventFree(event); > + virDomainEventFree(event); > + } > } > > /** remoteDomainEventFired: > > > > -- > Libvir-list mailing list > Libvir-list@xxxxxxxxxx > https://www.redhat.com/mailman/listinfo/libvir-list -- Libvir-list mailing list Libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list