[Spice-devel] [PATCH 3/3] server/tests: avoid using deprecated symbols
--- server/tests/test_display_base.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/server/tests/test_display_base.c b/server/tests/test_display_base.c index 20c0e47..ccdd2f2 100644 --- a/server/tests/test_display_base.c +++ b/server/tests/test_display_base.c @@ -358,7 +358,6 @@ static SimpleSurfaceCmd *destroy_surface(int surface_id) static void create_primary_surface(Test *test, uint32_t width, uint32_t height) { -QXLWorker *qxl_worker = test->qxl_worker; QXLDevSurfaceCreate surface = { 0, }; ASSERT(height <= MAX_HEIGHT); @@ -380,7 +379,7 @@ static void create_primary_surface(Test *test, uint32_t width, test->width = width; test->height = height; -qxl_worker->create_primary_surface(qxl_worker, 0, &surface); +spice_qxl_create_primary_surface(&test->qxl_instance, 0, &surface); } QXLDevMemSlot slot = { @@ -407,9 +406,9 @@ static void attache_worker(QXLInstance *qin, QXLWorker *_qxl_worker) } printf("%s\n", __func__); test->qxl_worker = _qxl_worker; -test->qxl_worker->add_memslot(test->qxl_worker, &slot); +spice_qxl_add_memslot(&test->qxl_instance, &slot); create_primary_surface(test, DEFAULT_WIDTH, DEFAULT_HEIGHT); -test->qxl_worker->start(test->qxl_worker); +spice_server_vm_start(test->server); } static void set_compression_level(QXLInstance *qin, int level) @@ -511,7 +510,7 @@ static void produce_command(Test *test) .bottom = (test->target_surface == 0 ? test->primary_height : test->height) }; if (rect.right > 0 && rect.bottom > 0) { -qxl_worker->update_area(qxl_worker, test->target_surface, &rect, NULL, 0, 1); +spice_qxl_update_area(&test->qxl_instance, test->target_surface, &rect, NULL, 0, 1); } break; } @@ -584,7 +583,7 @@ static void produce_command(Test *test) } case DESTROY_PRIMARY: -qxl_worker->destroy_primary_surface(qxl_worker, 0); +spice_qxl_destroy_primary_surface(&test->qxl_instance, 0); break; case CREATE_PRIMARY: @@ -614,7 +613,7 @@ static void do_wakeup(void *opaque) } test->core->timer_start(test->wakeup_timer, test->wakeup_ms); -test->qxl_worker->wakeup(test->qxl_worker); +spice_qxl_wakeup(&test->qxl_instance); } static void release_resource(QXLInstance *qin, struct QXLReleaseInfoExt release_info) -- 1.8.3.1 ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel
[Spice-devel] [PATCH 1/3] server: mark deprecated symbols
--- server/Makefile.am | 1 + server/spice.h | 51 +-- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/server/Makefile.am b/server/Makefile.am index 815f65e..8cbd87b 100644 --- a/server/Makefile.am +++ b/server/Makefile.am @@ -2,6 +2,7 @@ NULL = SUBDIRS = . tests AM_CPPFLAGS = \ + -DSPICE_SERVER_INTERNAL \ -DRED_STATISTICS\ $(CELT051_CFLAGS) \ $(COMMON_CFLAGS)\ diff --git a/server/spice.h b/server/spice.h index 6fbb7b2..b645112 100644 --- a/server/spice.h +++ b/server/spice.h @@ -22,9 +22,15 @@ #include #include #include +#include #define SPICE_SERVER_VERSION 0x000c04 /* release 0.12.4 */ +#ifdef SPICE_SERVER_INTERNAL +#undef SPICE_GNUC_DEPRECATED +#define SPICE_GNUC_DEPRECATED +#endif + /* interface base type */ typedef struct SpiceBaseInterface SpiceBaseInterface; @@ -69,9 +75,10 @@ typedef struct SpiceChannelEventInfo { int id; int flags; /* deprecated, can't hold ipv6 addresses, kept for backward compatibility */ -struct sockaddr laddr; -struct sockaddr paddr; -socklen_t llen, plen; +struct sockaddr laddr SPICE_GNUC_DEPRECATED; +struct sockaddr paddr SPICE_GNUC_DEPRECATED; +socklen_t llen SPICE_GNUC_DEPRECATED; +socklen_t plen SPICE_GNUC_DEPRECATED; /* should be used if (flags & SPICE_CHANNEL_EVENT_FLAG_ADDR_EXT) */ struct sockaddr_storage laddr_ext; struct sockaddr_storage paddr_ext; @@ -113,32 +120,32 @@ struct QXLWorker { uint32_t minor_version; uint32_t major_version; /* These calls are deprecated. Please use the spice_qxl_* calls instead */ -void (*wakeup)(QXLWorker *worker); -void (*oom)(QXLWorker *worker); -void (*start)(QXLWorker *worker); -void (*stop)(QXLWorker *worker); +void (*wakeup)(QXLWorker *worker) SPICE_GNUC_DEPRECATED; +void (*oom)(QXLWorker *worker) SPICE_GNUC_DEPRECATED; +void (*start)(QXLWorker *worker) SPICE_GNUC_DEPRECATED; +void (*stop)(QXLWorker *worker) SPICE_GNUC_DEPRECATED; void (*update_area)(QXLWorker *qxl_worker, uint32_t surface_id, struct QXLRect *area, struct QXLRect *dirty_rects, - uint32_t num_dirty_rects, uint32_t clear_dirty_region); -void (*add_memslot)(QXLWorker *worker, QXLDevMemSlot *slot); -void (*del_memslot)(QXLWorker *worker, uint32_t slot_group_id, uint32_t slot_id); -void (*reset_memslots)(QXLWorker *worker); -void (*destroy_surfaces)(QXLWorker *worker); -void (*destroy_primary_surface)(QXLWorker *worker, uint32_t surface_id); + uint32_t num_dirty_rects, uint32_t clear_dirty_region) SPICE_GNUC_DEPRECATED; +void (*add_memslot)(QXLWorker *worker, QXLDevMemSlot *slot) SPICE_GNUC_DEPRECATED; +void (*del_memslot)(QXLWorker *worker, uint32_t slot_group_id, uint32_t slot_id) SPICE_GNUC_DEPRECATED; +void (*reset_memslots)(QXLWorker *worker) SPICE_GNUC_DEPRECATED; +void (*destroy_surfaces)(QXLWorker *worker) SPICE_GNUC_DEPRECATED; +void (*destroy_primary_surface)(QXLWorker *worker, uint32_t surface_id) SPICE_GNUC_DEPRECATED; void (*create_primary_surface)(QXLWorker *worker, uint32_t surface_id, - QXLDevSurfaceCreate *surface); -void (*reset_image_cache)(QXLWorker *worker); -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); + QXLDevSurfaceCreate *surface) SPICE_GNUC_DEPRECATED; +void (*reset_image_cache)(QXLWorker *worker) SPICE_GNUC_DEPRECATED; +void (*reset_cursor)(QXLWorker *worker) SPICE_GNUC_DEPRECATED; +void (*destroy_surface_wait)(QXLWorker *worker, uint32_t surface_id) SPICE_GNUC_DEPRECATED; +void (*loadvm_commands)(QXLWorker *worker, struct QXLCommandExt *ext, uint32_t count) SPICE_GNUC_DEPRECATED; }; void spice_qxl_wakeup(QXLInstance *instance); void spice_qxl_oom(QXLInstance *instance); -void spice_qxl_start(QXLInstance *instance); /* deprecated since 0.11.2 -spice_server_vm_start replaces it */ -void spice_qxl_stop(QXLInstance *instance); /* deprecated since 0.11.2 -spice_server_vm_stop replaces it */ +/* deprecated since 0.11.2, spice_server_vm_start replaces it */ +void spice_qxl_start(QXLInstance *instance) SPICE_GNUC_DEPRECATED; +/* deprecated since 0.11.2 spice_server_vm_stop replaces it */ +void spice_qxl_stop(QXLInstance *instance) SPICE_GNUC_DEPRECATED; void spice_qxl_update_area(QXLInstance *instance, uint32_t surface_id, struct QXLRect *area, struct QXLRect *dirty_rects, uint32_t num_dirty_r
[Spice-devel] [PATCH 2/3] server: set dispatcher before calling attache_worker
This allows to call spice_qxl_add_memslot during attache_worker(), like done in the tests. --- server/red_dispatcher.c | 12 +++- server/red_dispatcher.h | 3 ++- server/reds.c | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/server/red_dispatcher.c b/server/red_dispatcher.c index 03a4c4a..fd6c2e1 100644 --- a/server/red_dispatcher.c +++ b/server/red_dispatcher.c @@ -1072,7 +1072,7 @@ static RedChannel *red_dispatcher_cursor_channel_create(RedDispatcher *dispatche return cursor_channel; } -RedDispatcher *red_dispatcher_init(QXLInstance *qxl) +void red_dispatcher_init(QXLInstance *qxl) { RedDispatcher *red_dispatcher; RedWorkerMessage message; @@ -1085,6 +1085,8 @@ RedDispatcher *red_dispatcher_init(QXLInstance *qxl) sigset_t curr_sig_mask; ClientCbs client_cbs = { NULL, }; +spice_return_if_fail(qxl->st->dispatcher == NULL); + quic_init(); sw_canvas_init(); #ifdef USE_OPENGL @@ -1175,12 +1177,12 @@ RedDispatcher *red_dispatcher_init(QXLInstance *qxl) reds_register_channel(cursor_channel); } -qxl->st->qif->attache_worker(qxl, &red_dispatcher->base); -qxl->st->qif->set_compression_level(qxl, calc_compression_level()); - +qxl->st->dispatcher = red_dispatcher; red_dispatcher->next = dispatchers; dispatchers = red_dispatcher; -return red_dispatcher; + +qxl->st->qif->attache_worker(qxl, &red_dispatcher->base); +qxl->st->qif->set_compression_level(qxl, calc_compression_level()); } struct Dispatcher *red_dispatcher_get_dispatcher(RedDispatcher *red_dispatcher) diff --git a/server/red_dispatcher.h b/server/red_dispatcher.h index 7d23b11..907b7c7 100644 --- a/server/red_dispatcher.h +++ b/server/red_dispatcher.h @@ -21,9 +21,10 @@ #include "red_channel.h" struct RedChannelClient; +struct RedDispatcher; typedef struct AsyncCommand AsyncCommand; -struct RedDispatcher *red_dispatcher_init(QXLInstance *qxl); +void red_dispatcher_init(QXLInstance *qxl); void red_dispatcher_set_mm_time(uint32_t); void red_dispatcher_on_ic_change(void); diff --git a/server/reds.c b/server/reds.c index 0f81a32..1456b75 100644 --- a/server/reds.c +++ b/server/reds.c @@ -3771,7 +3771,7 @@ SPICE_GNUC_VISIBLE int spice_server_add_interface(SpiceServer *s, qxl = SPICE_CONTAINEROF(sin, QXLInstance, base); qxl->st = spice_new0(QXLState, 1); qxl->st->qif = SPICE_CONTAINEROF(interface, QXLInterface, base); -qxl->st->dispatcher = red_dispatcher_init(qxl); +red_dispatcher_init(qxl); } else if (strcmp(interface->type, SPICE_INTERFACE_TABLET) == 0) { spice_info("SPICE_INTERFACE_TABLET"); -- 1.8.3.1 ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel
[Spice-devel] govirt 0.30 plans
Hi Christophe, When do you plan to release govirt 0.30 with the SSL fixes and the new API for getting available VMs, powering on the VM at login time, etc.? Do you plan to include something like the function that I submitted to spice-devel earlier for reading the cert from a local file? You had some suggestion for changes to the code, would you like me to make those changes? Thanks! iordan -- The conscious mind has only one thread of execution. ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] Where is the source code of aSpice? And is there a spice version in iOS?
Hi Shen, The source code is part of the bVNC project. https://github.com/iiordanov/bVNC Please keep in mind that the user interface is GPL licensed, and if you distribute binaries to third parties, you must also make public the exact source code that was used to produce the binaries. Cheers and thanks! iordan On Thu, Sep 26, 2013 at 10:15 PM, Shen Dongliang wrote: > Hi all, > Where is the source code of aSpice? > And is there a spice version in iOS? > >Thanks! > > > Best Regards, > Edward Shen > ___ > Spice-devel mailing list > Spice-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/spice-devel -- The conscious mind has only one thread of execution. ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [PATCH spice-gtk 1/2] display: fix palette regression
On Thu, Oct 03, 2013 at 09:43:31AM -0400, Marc-André Lureau wrote: > > > - Original Message - > > On Thu, Oct 03, 2013 at 08:51:15AM -0400, Marc-André Lureau wrote: > > > > > > > > > - Original Message - > > > > On Thu, Oct 03, 2013 at 01:53:55PM +0200, Marc-André Lureau wrote: > > > > > palette_get() used to return a ref, and palette_release() used to > > > > > release that ref. > > > > > > > > > > Since ed877341, the palette is no longer refcount'ed, since its usage > > > > > is > > > > > exclusively local in common/canvas code. > > > > > > > > > > palette_release() shouldn't remove the palette from the cache. > > > > > > > > Doesn't this mean we will keep some palettes in the cache forever? If > > > > yes, > > > > some guarantee that the memory used by these palettes is bounded? > > > > > > palette_get() / palette_release() always come in pair > > > > Ah right, looks like we can even go with removal then: > > Sure, but you'll have to fix server code too then. Ah right, this is shared. It seems the server is not using it, but the old client is :-/ ACK Christophe pgpwliIHoq8GK.pgp Description: PGP signature ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [PATCH spice-gtk 1/2] display: fix palette regression
- Original Message - > On Thu, Oct 03, 2013 at 08:51:15AM -0400, Marc-André Lureau wrote: > > > > > > - Original Message - > > > On Thu, Oct 03, 2013 at 01:53:55PM +0200, Marc-André Lureau wrote: > > > > palette_get() used to return a ref, and palette_release() used to > > > > release that ref. > > > > > > > > Since ed877341, the palette is no longer refcount'ed, since its usage > > > > is > > > > exclusively local in common/canvas code. > > > > > > > > palette_release() shouldn't remove the palette from the cache. > > > > > > Doesn't this mean we will keep some palettes in the cache forever? If > > > yes, > > > some guarantee that the memory used by these palettes is bounded? > > > > palette_get() / palette_release() always come in pair > > Ah right, looks like we can even go with removal then: Sure, but you'll have to fix server code too then. > diff --git a/common/canvas_base.c b/common/canvas_base.c > index 2753fae..1fb89d2 100644 > --- a/common/canvas_base.c > +++ b/common/canvas_base.c > @@ -942,10 +942,6 @@ static pixman_image_t *canvas_get_bits(CanvasBase > *canvas, > > surface = canvas_bitmap_to_surface(canvas, bitmap, palette, > want_original); > > -if (palette && (bitmap->flags & SPICE_BITMAP_FLAGS_PAL_FROM_CACHE)) { > -canvas->palette_cache->ops->release(canvas->palette_cache, > palette); > -} > - > return surface; > } > > diff --git a/common/canvas_base.h b/common/canvas_base.h > index 637cdc1..10b855c 100644 > --- a/common/canvas_base.h > +++ b/common/canvas_base.h > @@ -77,8 +77,6 @@ typedef struct { > SpicePalette *palette); > SpicePalette *(*get)(SpicePaletteCache *cache, > uint64_t id); > -void (*release)(SpicePaletteCache *cache, > -SpicePalette *palette); > } SpicePaletteCacheOps; > > struct _SpicePaletteCache { > > diff --git a/gtk/channel-display.c b/gtk/channel-display.c > index 794f4eb..0a91a5e 100644 > --- a/gtk/channel-display.c > +++ b/gtk/channel-display.c > @@ -559,11 +559,6 @@ static void palette_remove(SpicePaletteCache *cache, > uint32 > cache_remove(c->palettes, id); > } > > -static void palette_release(SpicePaletteCache *cache, SpicePalette > *palette) > -{ > -palette_remove(cache, palette->unique); > -} > - > #ifdef SW_CANVAS_CACHE > static void image_put_lossy(SpiceImageCache *cache, uint64_t id, > pixman_image_t *surface) > @@ -625,7 +620,6 @@ static SpiceImageCacheOps image_cache_ops = { > static SpicePaletteCacheOps palette_cache_ops = { > .put = palette_put, > .get = palette_get, > -.release = palette_release, > }; > > > > And a palette is remove from cache with > > SPICE_MSG_DISPLAY_INVAL_{ALL_}PALETTE > > Hopefully canvas_get_bits() and handling of > SPICE_MSG_DISPLAY_INVAL_ALL_PALETTE can't race with each other? Not in spice-gtk, since canvas operations are not async/reordered or multi-threaded. > Christophe > > ___ > Spice-devel mailing list > Spice-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/spice-devel > ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [PATCH spice-gtk 1/2] display: fix palette regression
On Thu, Oct 03, 2013 at 08:51:15AM -0400, Marc-André Lureau wrote: > > > - Original Message - > > On Thu, Oct 03, 2013 at 01:53:55PM +0200, Marc-André Lureau wrote: > > > palette_get() used to return a ref, and palette_release() used to > > > release that ref. > > > > > > Since ed877341, the palette is no longer refcount'ed, since its usage is > > > exclusively local in common/canvas code. > > > > > > palette_release() shouldn't remove the palette from the cache. > > > > Doesn't this mean we will keep some palettes in the cache forever? If yes, > > some guarantee that the memory used by these palettes is bounded? > > palette_get() / palette_release() always come in pair Ah right, looks like we can even go with removal then: diff --git a/common/canvas_base.c b/common/canvas_base.c index 2753fae..1fb89d2 100644 --- a/common/canvas_base.c +++ b/common/canvas_base.c @@ -942,10 +942,6 @@ static pixman_image_t *canvas_get_bits(CanvasBase *canvas, surface = canvas_bitmap_to_surface(canvas, bitmap, palette, want_original); -if (palette && (bitmap->flags & SPICE_BITMAP_FLAGS_PAL_FROM_CACHE)) { -canvas->palette_cache->ops->release(canvas->palette_cache, palette); -} - return surface; } diff --git a/common/canvas_base.h b/common/canvas_base.h index 637cdc1..10b855c 100644 --- a/common/canvas_base.h +++ b/common/canvas_base.h @@ -77,8 +77,6 @@ typedef struct { SpicePalette *palette); SpicePalette *(*get)(SpicePaletteCache *cache, uint64_t id); -void (*release)(SpicePaletteCache *cache, -SpicePalette *palette); } SpicePaletteCacheOps; struct _SpicePaletteCache { diff --git a/gtk/channel-display.c b/gtk/channel-display.c index 794f4eb..0a91a5e 100644 --- a/gtk/channel-display.c +++ b/gtk/channel-display.c @@ -559,11 +559,6 @@ static void palette_remove(SpicePaletteCache *cache, uint32 cache_remove(c->palettes, id); } -static void palette_release(SpicePaletteCache *cache, SpicePalette *palette) -{ -palette_remove(cache, palette->unique); -} - #ifdef SW_CANVAS_CACHE static void image_put_lossy(SpiceImageCache *cache, uint64_t id, pixman_image_t *surface) @@ -625,7 +620,6 @@ static SpiceImageCacheOps image_cache_ops = { static SpicePaletteCacheOps palette_cache_ops = { .put = palette_put, .get = palette_get, -.release = palette_release, }; > And a palette is remove from cache with > SPICE_MSG_DISPLAY_INVAL_{ALL_}PALETTE Hopefully canvas_get_bits() and handling of SPICE_MSG_DISPLAY_INVAL_ALL_PALETTE can't race with each other? Christophe pgpwnDtVpw2XE.pgp Description: PGP signature ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [PATCH spice-gtk 2/2] display: cache id is uint64_t
On Thu, Oct 03, 2013 at 01:53:56PM +0200, Marc-André Lureau wrote: > --- > gtk/channel-display.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gtk/channel-display.c b/gtk/channel-display.c > index e0f17eb..a57453f 100644 > --- a/gtk/channel-display.c > +++ b/gtk/channel-display.c > @@ -551,7 +551,7 @@ static SpicePalette *palette_get(SpicePaletteCache > *cache, uint64_t id) > return cache_find(c->palettes, id); > } > > -static void palette_remove(SpicePaletteCache *cache, uint32_t id) > +static void palette_remove(SpicePaletteCache *cache, uint64_t id) > { > SpiceDisplayChannelPrivate *c = > SPICE_CONTAINEROF(cache, SpiceDisplayChannelPrivate, palette_cache); ACK. I did not manage to get gcc to warn about the implicit cast from uint64_t to uint32_t in the palette_remove callers (tried -Wconversion) Christophe pgpeKxCNpocOY.pgp Description: PGP signature ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [spice-gtk] Use latest warnings.m4 from gnulib
On Fri, Sep 27, 2013 at 09:17:55AM +0200, Christophe Fergeau wrote: > The one we were using does not work properly with clang, causing > the build process to try to use -f/-W options that are not > supported by clang. > --- > > The same patch has already been ACKed and pushed in libvirt-glib/libosinfo/... > https://www.redhat.com/archives/libvir-list/2013-September/msg01599.html > > Christophe > > > m4/warnings.m4 | 82 > -- > 1 file changed, 62 insertions(+), 20 deletions(-) ACK, nobrainer. Daniel -- |: http://berrange.com -o-http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :| ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [Users] unable to start vm in 3.3 and f19 with gluster
On 10/03/2013 01:21 AM, Gianluca Cecchi wrote: On Wed, Oct 2, 2013 at 9:16 PM, Itamar Heim wrote: On 10/02/2013 12:57 AM, Gianluca Cecchi wrote: Today I was able to work again on this matter and it seems related to spice Every time I start the VM (that is defined with spice) it goes in and this doesn't happen if the VM is defined with vnc? No, reproduced both from oVirt and through virsh. with spice defined in boot options or in xml (for virsh) the vm remains in paused state and after a few minutes it seems the node hangs... with vnc the VM goes in runnign state I'm going to put same config on 2 physical nodes with only local storage and see what happens and report... Gianluca adding spice-devel mailing list as the VM only hangs if started with spice and not with vnc, from virsh as well. ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [PATCH spice-gtk 1/2] display: fix palette regression
- Original Message - > On Thu, Oct 03, 2013 at 01:53:55PM +0200, Marc-André Lureau wrote: > > palette_get() used to return a ref, and palette_release() used to > > release that ref. > > > > Since ed877341, the palette is no longer refcount'ed, since its usage is > > exclusively local in common/canvas code. > > > > palette_release() shouldn't remove the palette from the cache. > > Doesn't this mean we will keep some palettes in the cache forever? If yes, > some guarantee that the memory used by these palettes is bounded? palette_get() / palette_release() always come in pair, so it isn't used to remove a palette. And a palette is remove from cache with SPICE_MSG_DISPLAY_INVAL_{ALL_}PALETTE > Christophe > > ___ > Spice-devel mailing list > Spice-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/spice-devel > ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [PATCH spice-gtk 1/2] display: fix palette regression
On Thu, Oct 03, 2013 at 01:53:55PM +0200, Marc-André Lureau wrote: > palette_get() used to return a ref, and palette_release() used to > release that ref. > > Since ed877341, the palette is no longer refcount'ed, since its usage is > exclusively local in common/canvas code. > > palette_release() shouldn't remove the palette from the cache. Doesn't this mean we will keep some palettes in the cache forever? If yes, some guarantee that the memory used by these palettes is bounded? Christophe pgpptii48WM9f.pgp Description: PGP signature ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [spice-gtk PATCHv4 0/2] Use system CA store
Ping? Christophe On Tue, Sep 24, 2013 at 10:03:47AM +0200, Christophe Fergeau wrote: > Hey, here is a v4 of my series. > > Changes since v3: > - added a line at the end of configure indicating which CA store will be > used (if any), this was requested during review but I forgot to add it in v3 > - fix compilation when using --without-ca-certificates > > ___ > Spice-devel mailing list > Spice-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/spice-devel pgpYiRU16GVrR.pgp Description: PGP signature ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [spice-gtk] Use latest warnings.m4 from gnulib
Ping ? Christophe On Fri, Sep 27, 2013 at 09:17:55AM +0200, Christophe Fergeau wrote: > The one we were using does not work properly with clang, causing > the build process to try to use -f/-W options that are not > supported by clang. > --- > > The same patch has already been ACKed and pushed in libvirt-glib/libosinfo/... > https://www.redhat.com/archives/libvir-list/2013-September/msg01599.html > > Christophe > > > m4/warnings.m4 | 82 > -- > 1 file changed, 62 insertions(+), 20 deletions(-) > > diff --git a/m4/warnings.m4 b/m4/warnings.m4 > index 69d05a6..e3d239b 100644 > --- a/m4/warnings.m4 > +++ b/m4/warnings.m4 > @@ -1,5 +1,5 @@ > -# warnings.m4 serial 5 > -dnl Copyright (C) 2008-2012 Free Software Foundation, Inc. > +# warnings.m4 serial 11 > +dnl Copyright (C) 2008-2013 Free Software Foundation, Inc. > dnl This file is free software; the Free Software Foundation > dnl gives unlimited permission to copy and/or distribute it, > dnl with or without modifications, as long as this notice is preserved. > @@ -14,24 +14,66 @@ m4_ifdef([AS_VAR_APPEND], > [m4_define([gl_AS_VAR_APPEND], > [AS_VAR_SET([$1], [AS_VAR_GET([$1])$2])])]) > > -# gl_WARN_ADD(PARAMETER, [VARIABLE = WARN_CFLAGS]) > -# > -# Adds parameter to WARN_CFLAGS if the compiler supports it. For example, > -# gl_WARN_ADD([-Wparentheses]). > -AC_DEFUN([gl_WARN_ADD], > -dnl FIXME: gl_Warn must be used unquoted until we can assume > -dnl autoconf 2.64 or newer. > -[AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_$1])dnl > -AC_CACHE_CHECK([whether compiler handles $1], m4_defn([gl_Warn]), [ > - gl_save_CPPFLAGS="$CPPFLAGS" > - CPPFLAGS="${CPPFLAGS} $1" > - AC_PREPROC_IFELSE([AC_LANG_PROGRAM([])], > -[AS_VAR_SET(gl_Warn, [yes])], > -[AS_VAR_SET(gl_Warn, [no])]) > - CPPFLAGS="$gl_save_CPPFLAGS" > + > +# gl_COMPILER_OPTION_IF(OPTION, [IF-SUPPORTED], [IF-NOT-SUPPORTED], > +# [PROGRAM = AC_LANG_PROGRAM()]) > +# - > +# Check if the compiler supports OPTION when compiling PROGRAM. > +# > +# FIXME: gl_Warn must be used unquoted until we can assume Autoconf > +# 2.64 or newer. > +AC_DEFUN([gl_COMPILER_OPTION_IF], > +[AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_[]_AC_LANG_ABBREV[]_$1])dnl > +AS_VAR_PUSHDEF([gl_Flags], [_AC_LANG_PREFIX[]FLAGS])dnl > +AS_LITERAL_IF([$1], > + [m4_pushdef([gl_Positive], m4_bpatsubst([$1], [^-Wno-], [-W]))], > + [gl_positive="$1" > +case $gl_positive in > + -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;; > +esac > +m4_pushdef([gl_Positive], [$gl_positive])])dnl > +AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], m4_defn([gl_Warn]), [ > + gl_save_compiler_FLAGS="$gl_Flags" > + gl_AS_VAR_APPEND(m4_defn([gl_Flags]), > +[" $gl_unknown_warnings_are_errors ]m4_defn([gl_Positive])["]) > + AC_LINK_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([])])], > + [AS_VAR_SET(gl_Warn, [yes])], > + [AS_VAR_SET(gl_Warn, [no])]) > + gl_Flags="$gl_save_compiler_FLAGS" > ]) > -AS_VAR_IF(gl_Warn, [yes], > - [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]), [" $1"])]) > +AS_VAR_IF(gl_Warn, [yes], [$2], [$3]) > +m4_popdef([gl_Positive])dnl > +AS_VAR_POPDEF([gl_Flags])dnl > AS_VAR_POPDEF([gl_Warn])dnl > -m4_ifval([$2], [AS_LITERAL_IF([$2], [AC_SUBST([$2])], [])])dnl > ]) > + > +# gl_UNKNOWN_WARNINGS_ARE_ERRORS > +# -- > +# Clang doesn't complain about unknown warning options unless one also > +# specifies -Wunknown-warning-option -Werror. Detect this. > +AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS], > +[gl_COMPILER_OPTION_IF([-Werror -Wunknown-warning-option], > + [gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror'], > + [gl_unknown_warnings_are_errors=])]) > + > +# gl_WARN_ADD(OPTION, [VARIABLE = WARN_CFLAGS], > +# [PROGRAM = AC_LANG_PROGRAM()]) > +# - > +# Adds parameter to WARN_CFLAGS if the compiler supports it when > +# compiling PROGRAM. For example, gl_WARN_ADD([-Wparentheses]). > +# > +# If VARIABLE is a variable name, AC_SUBST it. > +AC_DEFUN([gl_WARN_ADD], > +[AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS]) > +gl_COMPILER_OPTION_IF([$1], > + [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]), [" $1"])], > + [], > + [$3]) > +m4_ifval([$2], > + [AS_LITERAL_IF([$2], [AC_SUBST([$2])])], > + [AC_SUBST([WARN_CFLAGS])])dnl > +]) > + > +# Local Variables: > +# mode: autoconf > +# End: > -- > 1.8.3.1 > > ___ > Spice-devel mailing list > Spice-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/spice-devel pgp6coMM2EK2C.pgp Description: PGP signature ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org h
[Spice-devel] [PATCH spice-gtk 2/2] display: cache id is uint64_t
--- gtk/channel-display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/channel-display.c b/gtk/channel-display.c index e0f17eb..a57453f 100644 --- a/gtk/channel-display.c +++ b/gtk/channel-display.c @@ -551,7 +551,7 @@ static SpicePalette *palette_get(SpicePaletteCache *cache, uint64_t id) return cache_find(c->palettes, id); } -static void palette_remove(SpicePaletteCache *cache, uint32_t id) +static void palette_remove(SpicePaletteCache *cache, uint64_t id) { SpiceDisplayChannelPrivate *c = SPICE_CONTAINEROF(cache, SpiceDisplayChannelPrivate, palette_cache); -- 1.8.3.1 ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel
[Spice-devel] [PATCH spice-gtk 1/2] display: fix palette regression
palette_get() used to return a ref, and palette_release() used to release that ref. Since ed877341, the palette is no longer refcount'ed, since its usage is exclusively local in common/canvas code. palette_release() shouldn't remove the palette from the cache. https://bugzilla.redhat.com/show_bug.cgi?id=1011936 --- gtk/channel-display.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gtk/channel-display.c b/gtk/channel-display.c index 794f4eb..e0f17eb 100644 --- a/gtk/channel-display.c +++ b/gtk/channel-display.c @@ -546,8 +546,8 @@ static SpicePalette *palette_get(SpicePaletteCache *cache, uint64_t id) SPICE_CONTAINEROF(cache, SpiceDisplayChannelPrivate, palette_cache); /* here the returned pointer is weak, no ref given to caller. it - * seems spice canvas usage is exclusively temporary, so it's ok - * (for now) */ + * seems spice canvas usage is exclusively temporary, so it's ok. + * palette_release is a noop. */ return cache_find(c->palettes, id); } @@ -561,7 +561,7 @@ static void palette_remove(SpicePaletteCache *cache, uint32_t id) static void palette_release(SpicePaletteCache *cache, SpicePalette *palette) { -palette_remove(cache, palette->unique); +/* there is no refcount of palette, see palette_get() */ } #ifdef SW_CANVAS_CACHE -- 1.8.3.1 ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel