[qxl] xspice: Adjust to X.org 1.19 changes

Christophe Fergeau cfergeau at redhat.com
Thu Dec 15 09:52:40 UTC 2016


On Wed, Dec 14, 2016 at 12:07:55PM +0100, Hans de Goede wrote:
> Hi,
> 
> On 14-12-16 11:51, Christophe Fergeau wrote:
> > In newer X.org versions, it's no longer supported to modify the set of
> > FDs passed to a BlockHandler method to get notified when the FD has data
> > to be read. This was limited anyway as we could only get read events
> > this way, and had to do our own polling to get notified about socket
> > writeability.
> > 
> > Starting from xserver 1.19, the supported way of doing this is to use
> > the SetNotifyFd/RemoveNotifyFd API, which is actually a much better way
> > as it matches very well the 'watch' API spice-server expects Xspice to
> > implement.
> > 
> > This commit switches to that new API, which removes the need for
> > RegisterBlockAndWakeupHandlers().
> 
> Thank you for doing this, one small comment inline, otherwise looks
> good:
> 
> Reviewed-by: Hans de Goede <hdegoede at redhat.com>

I had a small unapplied change in my working copy,
s/watch_update_mask2/watch_update_mask_internal/ which I squashed in.

> > +static SpiceWatch *watch_add(int fd, int event_mask, SpiceWatchFunc func, void *opaque)
> > +{
> > +    SpiceWatch *watch = malloc(sizeof(SpiceWatch));
> 
> This malloc may fail, please replace malloc with
> xnfalloc which stands for X no fail alloc, it works like
> the glib malloc functions.

There are several other occurrences of unchecked malloc in the Xspice
code, as well as a few strdup calls. I'll change these in a follow-up
patch.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg-devel/attachments/20161215/915531d1/attachment-0001.sig>


More information about the xorg-devel mailing list