[Spice-devel] [PATCH] remove dandling pointer for RedCharDeviceVDIPort

Christophe Fergeau cfergeau at redhat.com
Tue May 3 11:40:13 UTC 2016


Hey,

On Tue, May 03, 2016 at 06:53:49AM -0400, Frediano Ziglio wrote:
> 
> Honestly more I look at the patch and this fix and more I think it's all
> a big bug...
> What I know for sure is that this patch fix a dandling pointer.

NB: 'dangling' not 'dandling' (there is this typo in the short log,
would be nice to fix it ;)

> 
> Coming to your question. agent_attached. Should be a well defined things,
> there is an agent in the guest attached to spice-server. Now... can we have
> more agents or this "agent_attached" is referring to the agent daemon instead
> of the an agent? All code seems to not to handle multiple agents. I don't
> understand if this is a bug/missing feature or agent here refers to the daemon
> which handle multiple agents.
> Handling the agent_attached. Previous code delete the RedCharDevice before
> setting agent_attached to FALSE. This does not make much sense to me! The
> RedCharDevice represents a device created by Qemu (in the normal usage of
> spice-server) so there is no sense in deleting it when an agent is detached.
> Also looking at the if:

For what it's worth, 'agent_attached' was added in
https://cgit.freedesktop.org/spice/spice/commit/?id=1cec1c5118b65
"reds: Make VDIPortState a GObject".
Before that, we had
 struct RedCharDeviceVDIPortPrivate {
     RedCharDevice *base;
     /* ... */
}
and 'base' and RedCharDeviceVDIPortPrivate had different lifecycles
('base' could be NULL with a non-NULL RedChanDeviceVDIPortPrivate)
agent_attached was an attempt at handling this differently, which
apparently is not good enough :(

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160503/150427d4/attachment.sig>


More information about the Spice-devel mailing list