[Spice-devel] [PATCH v5 4/9] server: add async io support

Gerd Hoffmann kraxel at redhat.com
Tue Jul 19 04:44:56 PDT 2011

> --- a/server/spice.h
> +++ b/server/spice.h
> @@ -122,6 +122,16 @@ struct QXLWorker {
>       void (*reset_cursor)(QXLWorker *worker);
>       void (*destroy_surface_wait)(QXLWorker *worker, uint32_t surface_id);
>       void (*loadvm_commands)(QXLWorker *worker, struct QXLCommandExt *ext, uint32_t count);
> +    /* async versions of commands. when complete spice calls async_complete */
> +    void (*update_area_async)(QXLWorker *qxl_worker, uint32_t surface_id,
> +                       struct QXLRect *area, uint32_t clear_dirty_region,
> +                       uint64_t cookie);
> +    void (*add_memslot_async)(QXLWorker *worker, QXLDevMemSlot *slot, uint64_t cookie);
> +    void (*destroy_surfaces_async)(QXLWorker *worker, uint64_t cookie);
> +    void (*destroy_primary_surface_async)(QXLWorker *worker, uint32_t surface_id, uint64_t cookie);
> +    void (*create_primary_surface_async)(QXLWorker *worker, uint32_t surface_id,
> +                                   QXLDevSurfaceCreate *surface, uint64_t cookie);
> +    void (*destroy_surface_wait_async)(QXLWorker *worker, uint32_t surface_id, uint64_t cookie);
>   };

Is there any reason to go this indirect route through QXLWorker in the 
first place (other than historical ones)?  We can do this instead:

    spice_qxl_update_area(QXLInstance *qxl, uint32_t surface_id,
                          QXLRect *qxl_area, QXLRect *qxl_dirty_rects,
                          uint32_t num_dirty_rects,
                          uint32_t clear_dirty_region)
        qxl_worker_update_area(&qxl->st->dispatcher->base, surface_id,
                               qxl_area, qxl_dirty_rects,
                               num_dirty_rects, clear_dirty_region);

Then have qemu call spice_qxl_update_area() directly instead of 
worker->update_area().  Likewise for all others.  We obviously have to 
keep the old indirect code path for the existing calls for compatibility 

I'd like to see all new calls go direct (and only direct).  Having 
direct calls for the old ones would be nice too.

This will (a) remove the pointless indirection and (b) make shared 
library versioning alot easier as we'll get new linker symbols which we 
can tag with the version they appeared in the shared library.



More information about the Spice-devel mailing list