Displaying 16 results from an estimated 16 matches for "g_source_remove".
2019 Jul 15
2
[PATCH libnbd] examples: Include an example of integrating with the glibc main loop.
** NOT WORKING **
This patch shows how to integrate libnbd and the glib main loop.
Posted mainly as a point of discussion as it doesn't quite work yet.
Rich.
2016 Aug 24
2
[PATCH 2/3] qemu: Implement virtio-pstore device
...elem->in_num, 0, &res, sizeof(res));
> + iov_from_buf(elem->in_sg, elem->in_num, sizeof(res), info, sizeof(*info));
> +
> + len += offset;
> + virtqueue_push(vps->rvq, elem, len);
> + virtio_notify(VIRTIO_DEVICE(vps), vps->rvq);
> +
> + return G_SOURCE_REMOVE;
G_SOURCE_REMOVE was added in glib 2.32, but QEMU only permits
stuff that is present in 2.22. Just use "FALSE" instead.
> +static ssize_t virtio_pstore_do_read(VirtIOPstore *s, VirtQueueElement *elem)
> +{
> + char *filename = NULL;
> + int fd, idx;
> + struct st...
2016 Aug 24
2
[PATCH 2/3] qemu: Implement virtio-pstore device
...elem->in_num, 0, &res, sizeof(res));
> + iov_from_buf(elem->in_sg, elem->in_num, sizeof(res), info, sizeof(*info));
> +
> + len += offset;
> + virtqueue_push(vps->rvq, elem, len);
> + virtio_notify(VIRTIO_DEVICE(vps), vps->rvq);
> +
> + return G_SOURCE_REMOVE;
G_SOURCE_REMOVE was added in glib 2.32, but QEMU only permits
stuff that is present in 2.22. Just use "FALSE" instead.
> +static ssize_t virtio_pstore_do_read(VirtIOPstore *s, VirtQueueElement *elem)
> +{
> + char *filename = NULL;
> + int fd, idx;
> + struct st...
2019 Jul 17
1
Re: [PATCH libnbd] examples: Include an example of integrating with the glib main loop.
...!= 0)
> + nbd_aio_notify_write (source->nbd);
No error checking?
> +
> + return TRUE;
https://developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html#GSourceFuncs
says dispatch() should return G_SOURCE_CONTINUE (which I assume is an
alias of TRUE?). Should this ever return G_SOURCE_REMOVE (perhaps when
we detect that the connection has moved to CLOSED)?
> +}
> +
> +static void
> +finalize (GSource *sp)
> +{
> + struct NBDSource *source = (struct NBDSource *) sp;
> +
> + DEBUG (source, "finalize");
> +
> + nbd_close (source->nbd);
> +...
2019 Jul 17
0
[PATCH libnbd v2] examples: Include an example of integrating with the glib main loop.
..._)
+{
+ struct NBDSource *source = (struct NBDSource *) sp;
+ int new_fd;
+ int events;
+
+ /* The poll file descriptor can change or become invalid at any
+ * time.
+ */
+ new_fd = nbd_aio_get_fd (source->nbd);
+ if (source->fd != new_fd) {
+ if (source->tag != NULL) {
+ g_source_remove_unix_fd ((GSource *) source, source->tag);
+ source->fd = -1;
+ source->tag = NULL;
+ }
+ if (new_fd >= 0) {
+ source->fd = new_fd;
+ source->tag = g_source_add_unix_fd ((GSource *) source, new_fd, 0);
+ }
+ }
+
+ if (!source->tag)
+ return FAL...
2016 Aug 26
0
[PATCH 2/3] qemu: Implement virtio-pstore device
...of(res));
> > + iov_from_buf(elem->in_sg, elem->in_num, sizeof(res), info, sizeof(*info));
> > +
> > + len += offset;
> > + virtqueue_push(vps->rvq, elem, len);
> > + virtio_notify(VIRTIO_DEVICE(vps), vps->rvq);
> > +
> > + return G_SOURCE_REMOVE;
>
> G_SOURCE_REMOVE was added in glib 2.32, but QEMU only permits
> stuff that is present in 2.22. Just use "FALSE" instead.
Didn't know that, will change.
>
> > +static ssize_t virtio_pstore_do_read(VirtIOPstore *s, VirtQueueElement *elem)
> > +{
> >...
2019 Jul 17
2
[PATCH libnbd v2] examples: Include an example of integrating with glib main loop.
This is working now, and incorporates all of the changes in Eric's
review, *except* that it still doesn't retire commands (although this
seems to make no obvious difference, except possibly a performance and
memory impact).
Rich.
2019 Jul 15
0
[PATCH libnbd] examples: Include an example of integrating with the glib main loop.
...rting reader");
+ g_idle_add (read_data, NULL);
+ reader_paused = false;
+ }
+
+ /* If the reader has finished and there are no more buffers then we
+ * have done.
+ */
+ if (finished && nr_buffers == 0) {
+ DEBUG (gsdest, "finished_write: all finished");
+ g_source_remove (g_source_get_id ((GSource *) gssrc));
+ g_source_unref ((GSource *) gssrc);
+ gssrc = NULL;
+ g_source_remove (g_source_get_id ((GSource *) gsdest));
+ g_source_unref ((GSource *) gsdest);
+ gsdest = NULL;
+ g_main_loop_quit (loop);
+ }
+
+ return 0;
+}
--
2.22.0
2007 Mar 21
0
4 commits - libswfdec/swfdec_js_movie.c libswfdec/swfdec_script.c player/swfdec_slow_loader.c
...;
+ }
+}
+
+static void
swfdec_slow_loader_dispose (GObject *object)
{
SwfdecSlowLoader *slow = SWFDEC_SLOW_LOADER (object);
+ g_signal_handlers_disconnect_by_func (slow->loader, swfdec_slow_loader_notify_cb, slow);
g_object_unref (slow->loader);
if (slow->timeout_id) {
g_source_remove (slow->timeout_id);
@@ -96,7 +105,11 @@ swfdec_slow_loader_tick (gpointer data)
return TRUE;
}
- if (slow->loader->eof) {
+ if (slow->loader->error) {
+ swfdec_loader_error (SWFDEC_LOADER (slow), slow->loader->error);
+ slow->timeout_id = 0;
+ return F...
2016 Aug 20
0
[PATCH 2/3] qemu: Implement virtio-pstore device
.../
+ iov_from_buf(elem->in_sg, elem->in_num, 0, &res, sizeof(res));
+ iov_from_buf(elem->in_sg, elem->in_num, sizeof(res), info, sizeof(*info));
+
+ len += offset;
+ virtqueue_push(vps->rvq, elem, len);
+ virtio_notify(VIRTIO_DEVICE(vps), vps->rvq);
+
+ return G_SOURCE_REMOVE;
+}
+
+static void free_rarg_fn(gpointer data)
+{
+ struct pstore_read_arg *rarg = data;
+
+ qio_channel_close(rarg->ioc, NULL);
+
+ g_free(rarg->elem);
+ g_free(rarg);
+}
+
+static ssize_t virtio_pstore_do_read(VirtIOPstore *s, VirtQueueElement *elem)
+{
+ char *filename = NUL...
2016 Nov 10
0
[PATCH 2/3] qemu: Implement virtio-pstore device
...rom_buf(elem->in_sg, elem->in_num, sizeof(res), info, sizeof(*info));
> > > +
> > > + len += offset;
> > > + virtqueue_push(vps->rvq, elem, len);
> > > + virtio_notify(VIRTIO_DEVICE(vps), vps->rvq);
> > > +
> > > + return G_SOURCE_REMOVE;
> > > +}
> > > +
> > > +static void free_rarg_fn(gpointer data)
> > > +{
> > > + struct pstore_read_arg *rarg = data;
> > > +
> > > + qio_channel_close(rarg->ioc, NULL);
> > > +
> > > + g_free(rarg->ele...
2016 Aug 20
7
[RFC/PATCHSET 0/3] virtio: Implement virtio pstore device (v3)
Hello,
This is another iteration of the virtio-pstore work. In this patchset
I addressed most of feedbacks from previous version and drooped the
support for PSTORE_TYPE_CONSOLE for simplicity. It'll be added once the basic implementation
* changes in v3)
- use QIOChannel API (Stefan, Daniel)
- add bound check for malcious guests (Daniel)
- drop support PSTORE_TYPE_CONSOLE for now
2016 Aug 20
7
[RFC/PATCHSET 0/3] virtio: Implement virtio pstore device (v3)
Hello,
This is another iteration of the virtio-pstore work. In this patchset
I addressed most of feedbacks from previous version and drooped the
support for PSTORE_TYPE_CONSOLE for simplicity. It'll be added once the basic implementation
* changes in v3)
- use QIOChannel API (Stefan, Daniel)
- add bound check for malcious guests (Daniel)
- drop support PSTORE_TYPE_CONSOLE for now
2007 Aug 17
0
Branch 'vivi' - 13 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_debugger.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_script_function.c test/trace vivified/core vivified/ui
...dle_add_full (-100, vivi_application_step_forward, app, NULL);
}
break;
default:
@@ -391,6 +399,12 @@ vivi_application_quit (ViviApplication *
return;
app->playback_state = VIVI_APPLICATION_EXITING;
app->playback_count = 1;
+ if (app->step_source) {
+ if (!g_source_remove (app->step_source)) {
+ g_assert_not_reached ();
+ }
+ app->step_source = 0;
+ }
g_object_notify (G_OBJECT (app), "quit");
vivi_application_check (app);
}
diff --git a/vivified/core/vivi_application.h b/vivified/core/vivi_application.h
index 33694bf..1a8c68a 1006...
2007 Aug 22
0
163 commits - autogen.sh configure.ac doc/swfdec-sections.txt libswfdec-gtk/swfdec_gtk_player.c libswfdec-gtk/swfdec_gtk_player.h libswfdec-gtk/swfdec_gtk_widget.c libswfdec-gtk/swfdec_source.c libswfdec/Makefile.am libswfdec/swfdec_as_array.c
...dle_add_full (-100, vivi_application_step_forward, app, NULL);
}
break;
default:
@@ -391,6 +399,12 @@ vivi_application_quit (ViviApplication *
return;
app->playback_state = VIVI_APPLICATION_EXITING;
app->playback_count = 1;
+ if (app->step_source) {
+ if (!g_source_remove (app->step_source)) {
+ g_assert_not_reached ();
+ }
+ app->step_source = 0;
+ }
g_object_notify (G_OBJECT (app), "quit");
vivi_application_check (app);
}
diff --git a/vivified/core/vivi_application.h b/vivified/core/vivi_application.h
index 33694bf..1a8c68a 1006...
2008 Jan 21
0
70 commits - configure.ac libswfdec-gtk/Makefile.am libswfdec-gtk/swfdec-gtk.h libswfdec-gtk/swfdec_gtk_loader.c libswfdec-gtk/swfdec_gtk_player.c libswfdec-gtk/swfdec_gtk_socket.c libswfdec-gtk/swfdec_gtk_socket.h libswfdec-gtk/swfdec_playback_alsa.c
...;
- }
-}
-
-static void
-swfdec_slow_loader_dispose (GObject *object)
-{
- SwfdecSlowLoader *slow = SWFDEC_SLOW_LOADER (object);
-
- g_signal_handlers_disconnect_by_func (slow->loader, swfdec_slow_loader_notify_cb, slow);
- g_object_unref (slow->loader);
- if (slow->timeout_id) {
- g_source_remove (slow->timeout_id);
- slow->timeout_id = 0;
- }
-
- G_OBJECT_CLASS (swfdec_slow_loader_parent_class)->dispose (object);
-}
-
-static gboolean
-swfdec_slow_loader_tick (gpointer data)
-{
- SwfdecSlowLoader *slow = data;
- SwfdecBuffer *buffer;
- guint total, amount;
-
- amount = sw...