[Spice-devel] [spice-gtk v1 0/2] tests: fix warnings and set name prefix

2016-10-05 Thread Victor Toso
Hi,

First patch fixes a few harmless compiler warnings. I put it in a single
patch as I did not see a strong reason to split.
Second patch sets the test binaries to have 'test-' as prefix.

Make check result:

PASS: test-util
PASS: test-coroutine
PASS: test-session
PASS: test-spice-uri
PASS: test-pipe
PASS: test-file-transfer
PASS: test-usb-acl-helper

Testsuite summary for spice-gtk 0.32.96-6ce2-dirty

# TOTAL: 7
# PASS:  7
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0


folder files with test prefix now are:
$ ls -l tests/test*
 tests/test-coroutine*
 tests/test-coroutine.log
 tests/test-coroutine.trs
 tests/test-file-transfer*
 tests/test-file-transfer.log
 tests/test-file-transfer.trs
 tests/test-mock-acl-helper*
 tests/test-pipe*
 tests/test-pipe.log
 tests/test-pipe.trs
 tests/test-session*
 tests/test-session.log
 tests/test-session.trs
 tests/test-spice-uri*
 tests/test-spice-uri.log
 tests/test-spice-uri.trs
 tests/test-suite.log
 tests/test-usb-acl-helper*
 tests/test-usb-acl-helper.log
 tests/test-usb-acl-helper.trs
 tests/test_usb_acl_helper-usb-acl-helper.o
 tests/test-util*
 tests/test-util.log
 tests/test-util.trs

Cheers,
  toso

Victor Toso (2):
  tests: fix some compiler warnings
  tests: set binaries to have 'test' name prefix

 tests/Makefile.am   | 26 +-
 tests/file-transfer.c   |  1 -
 tests/mock-acl-helper.c |  2 --
 tests/pipe.c|  5 -
 tests/usb-acl-helper.c  |  2 +-
 5 files changed, 18 insertions(+), 18 deletions(-)

-- 
2.9.3

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [spice-gtk v1 2/2] tests: set binaries to have 'test' name prefix

2016-10-05 Thread Victor Toso
To follow test-spice-uri and test-file-transfer standard.
---
 tests/Makefile.am  | 26 +-
 tests/usb-acl-helper.c |  2 +-
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 6d9cfeb..3a0188d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,20 +1,20 @@
 NULL =
 
 noinst_PROGRAMS =
-TESTS = coroutine  \
-   util\
-   session \
+TESTS = test-coroutine \
+   test-util   \
+   test-session\
test-spice-uri  \
test-file-transfer  \
$(NULL)
 
 if WITH_PHODAV
-TESTS += pipe
+TESTS += test-pipe
 endif
 
 if WITH_POLKIT
-TESTS += usb-acl-helper
-noinst_PROGRAMS += mock-acl-helper
+TESTS += test-usb-acl-helper
+noinst_PROGRAMS += test-mock-acl-helper
 endif
 
 noinst_PROGRAMS += $(TESTS)
@@ -34,14 +34,14 @@ LDADD = 
\
$(top_builddir)/src/libspice-client-glib-2.0.la \
$(NULL)
 
-util_SOURCES = util.c
-coroutine_SOURCES = coroutine.c
-session_SOURCES = session.c
-pipe_SOURCES = pipe.c
+test_util_SOURCES = util.c
+test_coroutine_SOURCES = coroutine.c
+test_session_SOURCES = session.c
+test_pipe_SOURCES = pipe.c
 test_spice_uri_SOURCES = uri.c
 test_file_transfer_SOURCES = file-transfer.c
-usb_acl_helper_SOURCES = usb-acl-helper.c
-usb_acl_helper_CFLAGS = -DTESTDIR=\"$(abs_builddir)\"
-mock_acl_helper_SOURCES = mock-acl-helper.c
+test_usb_acl_helper_SOURCES = usb-acl-helper.c
+test_usb_acl_helper_CFLAGS = -DTESTDIR=\"$(abs_builddir)\"
+test_mock_acl_helper_SOURCES = mock-acl-helper.c
 
 -include $(top_srcdir)/git.mk
diff --git a/tests/usb-acl-helper.c b/tests/usb-acl-helper.c
index 41dda5d..6cbc548 100644
--- a/tests/usb-acl-helper.c
+++ b/tests/usb-acl-helper.c
@@ -42,7 +42,7 @@ gboolean cancel_test(gpointer user_data)
 
 static void data_setup(Fixture *fixture, gconstpointer user_data)
 {
-g_setenv("SPICE_USB_ACL_BINARY", TESTDIR"/mock-acl-helper", TRUE);
+g_setenv("SPICE_USB_ACL_BINARY", TESTDIR"/test-mock-acl-helper", TRUE);
 fixture->cancellable = g_cancellable_new();
 fixture->acl_helper = spice_usb_acl_helper_new();
 fixture->loop = g_main_loop_new(NULL, FALSE);
-- 
2.9.3

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [spice-gtk v1 1/2] tests: fix some compiler warnings

2016-10-05 Thread Victor Toso
file-transfer.c: In function ‘transfer_on_init_async_cb_agent_cancel’:
file-transfer.c:316:19: warning: unused variable ‘cancellable’ 
[-Wunused-variable]
GCancellable *cancellable;
  ^~~
pipe.c: In function ‘test_pipe_readblock’:
pipe.c:91:12: warning: variable ‘size’ set but not used 
[-Wunused-but-set-variable]
gssize size;
   ^~~~
pipe.c: In function ‘test_pipe_writeblock’:
pipe.c:105:12: warning: variable ‘size’ set but not used 
[-Wunused-but-set-variable]
gssize size;
   ^~~~
pipe.c: In function ‘readclose_cb’:
pipe.c:205:12: warning: variable ‘nbytes’ set but not used 
[-Wunused-but-set-variable]
gssize nbytes;
   ^~
pipe.c: In function ‘readcancel_cb’:
pipe.c:244:12: warning: variable ‘nbytes’ set but not used 
[-Wunused-but-set-variable]
gssize nbytes;
   ^~
pipe.c: In function ‘test_pipe_zombie_sources’:
pipe.c:457:10: warning: unused variable ‘i’ [-Wunused-variable]
gint i;
 ^
mock-acl-helper.c:26:13: warning: ‘path’ defined but not used 
[-Wunused-variable]
static char path[PATH_MAX];
^~~~
mock-acl-helper.c:25:20: warning: ‘devnum’ defined but not used 
[-Wunused-variable]
static int busnum, devnum;
   ^~
mock-acl-helper.c:25:12: warning: ‘busnum’ defined but not used 
[-Wunused-variable]
static int busnum, devnum;
   ^~
---
 tests/file-transfer.c   | 1 -
 tests/mock-acl-helper.c | 2 --
 tests/pipe.c| 5 -
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/file-transfer.c b/tests/file-transfer.c
index a27b9cf..13bd352 100644
--- a/tests/file-transfer.c
+++ b/tests/file-transfer.c
@@ -313,7 +313,6 @@ transfer_on_init_async_cb_agent_cancel(GObject *obj, 
GAsyncResult *res, gpointer
 GFileInfo *info;
 SpiceFileTransferTask *xfer_task;
 GError *error = NULL;
-GCancellable *cancellable;
 
 xfer_task = SPICE_FILE_TRANSFER_TASK(obj);
 info = spice_file_transfer_task_init_task_finish(xfer_task, res, &error);
diff --git a/tests/mock-acl-helper.c b/tests/mock-acl-helper.c
index 782ebaf..58d2211 100644
--- a/tests/mock-acl-helper.c
+++ b/tests/mock-acl-helper.c
@@ -22,8 +22,6 @@
 #include 
 
 static int exit_status;
-static int busnum, devnum;
-static char path[PATH_MAX];
 static GMainLoop *loop;
 static GDataInputStream *stdin_stream;
 
diff --git a/tests/pipe.c b/tests/pipe.c
index 01629da..a8c45f5 100644
--- a/tests/pipe.c
+++ b/tests/pipe.c
@@ -93,6 +93,7 @@ test_pipe_readblock(Fixture *f, gconstpointer user_data)
 size = g_input_stream_read(f->ip2, f->buf, 1,
f->cancellable, &error);
 
+g_assert_cmpint(size, ==, -1);
 g_assert_error(error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK);
 
 g_clear_error(&error);
@@ -107,6 +108,7 @@ test_pipe_writeblock(Fixture *f, gconstpointer user_data)
 size = g_output_stream_write(f->op1, "", 1,
  f->cancellable, &error);
 
+g_assert_cmpint(size, ==, -1);
 g_assert_error(error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK);
 
 g_clear_error(&error);
@@ -207,6 +209,7 @@ readclose_cb(GObject *source, GAsyncResult *result, 
gpointer user_data)
 
 nbytes = g_input_stream_read_finish(G_INPUT_STREAM(source), result, 
&error);
 
+g_assert_cmpint(nbytes, ==, -1);
 g_assert_error(error, G_IO_ERROR, G_IO_ERROR_CLOSED);
 g_clear_error(&error);
 
@@ -246,6 +249,7 @@ readcancel_cb(GObject *source, GAsyncResult *result, 
gpointer user_data)
 
 nbytes = g_input_stream_read_finish(G_INPUT_STREAM(source), result, 
&error);
 
+g_assert_cmpint(nbytes, ==, -1);
 g_assert_error(error, G_IO_ERROR, G_IO_ERROR_CLOSED);
 g_clear_error(&error);
 
@@ -454,7 +458,6 @@ read_chunk_cb_and_do_zombie(GObject *source, GAsyncResult 
*result, gpointer user
 static void
 test_pipe_zombie_sources(Fixture *f, gconstpointer user_data)
 {
-gint i;
 f->data_len = 64;
 f->data = get_test_data(f->data_len);
 f->read_size = 16;
-- 
2.9.3

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [spice-gtk v1 0/2] tests: fix warnings and set name prefix

2016-10-05 Thread Victor Toso
Ops,

This was blocked because I sent it with an email not registered in the
ml. First patch was pushed, second patch I sent a v2.

Feel free to ignore this series.

On Fri, Sep 30, 2016 at 05:10:01PM +0200, Victor Toso wrote:
> Hi,
> 
> First patch fixes a few harmless compiler warnings. I put it in a single
> patch as I did not see a strong reason to split.
> Second patch sets the test binaries to have 'test-' as prefix.
> 
> Make check result:
> 
> PASS: test-util
> PASS: test-coroutine
> PASS: test-session
> PASS: test-spice-uri
> PASS: test-pipe
> PASS: test-file-transfer
> PASS: test-usb-acl-helper
> 
> Testsuite summary for spice-gtk 0.32.96-6ce2-dirty
> 
> # TOTAL: 7
> # PASS:  7
> # SKIP:  0
> # XFAIL: 0
> # FAIL:  0
> # XPASS: 0
> # ERROR: 0
> 
> 
> folder files with test prefix now are:
> $ ls -l tests/test*
>  tests/test-coroutine*
>  tests/test-coroutine.log
>  tests/test-coroutine.trs
>  tests/test-file-transfer*
>  tests/test-file-transfer.log
>  tests/test-file-transfer.trs
>  tests/test-mock-acl-helper*
>  tests/test-pipe*
>  tests/test-pipe.log
>  tests/test-pipe.trs
>  tests/test-session*
>  tests/test-session.log
>  tests/test-session.trs
>  tests/test-spice-uri*
>  tests/test-spice-uri.log
>  tests/test-spice-uri.trs
>  tests/test-suite.log
>  tests/test-usb-acl-helper*
>  tests/test-usb-acl-helper.log
>  tests/test-usb-acl-helper.trs
>  tests/test_usb_acl_helper-usb-acl-helper.o
>  tests/test-util*
>  tests/test-util.log
>  tests/test-util.trs
> 
> Cheers,
>   toso
> 
> Victor Toso (2):
>   tests: fix some compiler warnings
>   tests: set binaries to have 'test' name prefix
> 
>  tests/Makefile.am   | 26 +-
>  tests/file-transfer.c   |  1 -
>  tests/mock-acl-helper.c |  2 --
>  tests/pipe.c|  5 -
>  tests/usb-acl-helper.c  |  2 +-
>  5 files changed, 18 insertions(+), 18 deletions(-)
> 
> -- 
> 2.9.3
> 
> ___
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel


signature.asc
Description: PGP signature
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [spice-gtk v2] tests: fix -Wall -Wextra compiler warnings

2016-10-05 Thread Pavel Grunt
On Mon, 2016-10-03 at 15:23 +0200, Victor Toso wrote:
> From: Victor Toso 
> 
> With -Wall a few -Wunused-variable and -Wunused-but-set-variable;
> With -Wextra lots of -Wunused-parameter and a few -Wsign-compare.
> 
> Signed-off-by: Victor Toso 
Acked-by: Pavel Grunt 
> ---
>  tests/coroutine.c   |  2 +-
>  tests/file-transfer.c   | 27 +--
>  tests/mock-acl-helper.c |  4 +---
>  tests/pipe.c| 33 ++---
>  tests/session.c |  2 +-
>  tests/usb-acl-helper.c  | 18 +-
>  6 files changed, 43 insertions(+), 43 deletions(-)
> 
> diff --git a/tests/coroutine.c b/tests/coroutine.c
> index bded593..7701277 100644
> --- a/tests/coroutine.c
> +++ b/tests/coroutine.c
> @@ -44,7 +44,7 @@ static void test_coroutine_simple(void)
>  g_assert(coroutine_self_is_main());
>  }
>  
> -static gpointer co_entry_two(gpointer data)
> +static gpointer co_entry_two(gpointer data G_GNUC_UNUSED)
>  {
>  struct coroutine *self = coroutine_self();
>  struct coroutine co = {
> diff --git a/tests/file-transfer.c b/tests/file-transfer.c
> index a27b9cf..0cfe9ff 100644
> --- a/tests/file-transfer.c
> +++ b/tests/file-transfer.c
> @@ -26,7 +26,7 @@ const gchar content[] = "0123456789_spice-file-
> transfer-task";
>  static void
>  f_setup(Fixture *f, gconstpointer user_data)
>  {
> -gint i;
> +guint i;
>  GError *err = NULL;
>  
>  f->loop = g_main_loop_new(NULL, FALSE);
> @@ -51,9 +51,9 @@ f_setup(Fixture *f, gconstpointer user_data)
>  }
>  
>  static void
> -f_teardown(Fixture *f, gconstpointer user_data)
> +f_teardown(Fixture *f, gconstpointer user_data G_GNUC_UNUSED)
>  {
> -gint i;
> +guint i;
>  GError *err = NULL;
>  
>  g_main_loop_unref(f->loop);
> @@ -72,8 +72,8 @@ f_teardown(Fixture *f, gconstpointer user_data)
>   * TEST SIMPLE TRANSFER
>  
> 
> **/
>  static void
> -transfer_xfer_task_on_finished(SpiceFileTransferTask *xfer_task,
> -   GError *error,
> +transfer_xfer_task_on_finished(SpiceFileTransferTask *xfer_task
> G_GNUC_UNUSED,
> +   GError *error G_GNUC_UNUSED,
> gpointer user_data)
>  {
>  Fixture *f = user_data;
> @@ -86,7 +86,7 @@
> transfer_xfer_task_on_finished(SpiceFileTransferTask *xfer_task,
>  static void
>  transfer_read_async_cb(GObject *source_object,
> GAsyncResult *res,
> -   gpointer user_data)
> +   gpointer user_data G_GNUC_UNUSED)
>  {
>  SpiceFileTransferTask *xfer_task;
>  gssize count;
> @@ -106,7 +106,7 @@ transfer_read_async_cb(GObject *source_object,
>  }
>  
>  static void
> -transfer_init_async_cb(GObject *obj, GAsyncResult *res, gpointer
> data)
> +transfer_init_async_cb(GObject *obj, GAsyncResult *res, gpointer
> data G_GNUC_UNUSED)
>  {
>  GFileInfo *info;
>  SpiceFileTransferTask *xfer_task;
> @@ -123,7 +123,7 @@ transfer_init_async_cb(GObject *obj,
> GAsyncResult *res, gpointer data)
>  }
>  
>  static void
> -test_simple_transfer(Fixture *f, gconstpointer user_data)
> +test_simple_transfer(Fixture *f, gconstpointer user_data
> G_GNUC_UNUSED)
>  {
>  GHashTableIter iter;
>  gpointer key, value;
> @@ -158,7 +158,7 @@ transfer_cancelled_on_init_async_cb(GObject
> *obj, GAsyncResult *res, gpointer da
>  }
>  
>  static void
> -test_cancel_before_task_init(Fixture *f, gconstpointer user_data)
> +test_cancel_before_task_init(Fixture *f, gconstpointer user_data
> G_GNUC_UNUSED)
>  {
>  GHashTableIter iter;
>  gpointer key, value;
> @@ -175,7 +175,7 @@ test_cancel_before_task_init(Fixture *f,
> gconstpointer user_data)
>  }
>  
>  static void
> -test_cancel_after_task_init(Fixture *f, gconstpointer user_data)
> +test_cancel_after_task_init(Fixture *f, gconstpointer user_data
> G_GNUC_UNUSED)
>  {
>  GHashTableIter iter;
>  gpointer key, value;
> @@ -253,7 +253,7 @@
> transfer_on_init_async_cb_after_read_cancel(GObject *obj,
> GAsyncResult *res, gpo
>  }
>  
>  static void
> -test_cancel_before_read_async(Fixture *f, gconstpointer user_data)
> +test_cancel_before_read_async(Fixture *f, gconstpointer user_data
> G_GNUC_UNUSED)
>  {
>  GHashTableIter iter;
>  gpointer key, value;
> @@ -269,7 +269,7 @@ test_cancel_before_read_async(Fixture *f,
> gconstpointer user_data)
>  }
>  
>  static void
> -test_cancel_after_read_async(Fixture *f, gconstpointer user_data)
> +test_cancel_after_read_async(Fixture *f, gconstpointer user_data
> G_GNUC_UNUSED)
>  {
>  GHashTableIter iter;
>  gpointer key, value;
> @@ -313,7 +313,6 @@ transfer_on_init_async_cb_agent_cancel(GObject
> *obj, GAsyncResult *res, gpointer
>  GFileInfo *info;
>  SpiceFileTransferTask *xfer_task;
>  GError *error = NULL;
> -GCancellable *cancellable;
>  
>  xfer_task = SPICE_FILE_TRANSFER_TASK(obj);
>  inf

Re: [Spice-devel] [PATCH v2 0/4] Protocol file syntax documentation

2016-10-05 Thread Victor Toso
Hi,

On Tue, Oct 04, 2016 at 04:58:29AM -0400, Frediano Ziglio wrote:
> >
> > On Fri, Sep 30, 2016 at 01:13:04PM +0200, Victor Toso wrote:
> > > On Fri, Sep 30, 2016 at 07:08:55AM -0400, Frediano Ziglio wrote:
> > > > Just to make it clear... do you mean spice-server repository?
> > >
> > > Yes. We already have the (old) docs there and I don't see a reason to
> > > move it to protocol/common/website git...
> >
> > For what it's worth, once upon a time, there was no spice-common
> > submodule, and there was no spice-gtk either, everything (client and
> > server) was in spice/, so the docs were there too. Then spice-gtk was
> > created, and spice-common/ was split up as a submodule to share code
> > between the 2. The doc stayed in spice/, but I would not say this was an
> > explicit decision :)
> >
> > I still think that the .proto files (and so this doc) belongs to
> > spice-protocol, but at this point this has not happened :)

I did not follow too close the discussion around merging spice-protocol
and spice-common... so, I'm not sure if there was an agreement or if
some discussion is pending to set this matter.

> >
> > With that said, no strong feeling where it belongs, along with the
> > existing documentation works for me even if a bit odd, in spice-common
> > makes sense to me too.
> >
> > Christophe
> >
>
> I think choices proposed was:
>
> - spice-common
>   pro: files documented (.proto and python) are there
>   cons: there are no doc directory

(pro/cons ?): as it is a submodule, docs will be shared between spice
and spice-gtk.

> - spice-procotol
>   pro: looks a good repository name
>   cons: no files
>   cons: no doc directory
> - spice-server
>   pro: already documentation
>   cons: not strictly related
> - website
>   pro: easy to publish
>   cons: website should contain released state, not development
>
> My choice order is:
> - spice-server
> - spice-common

+1

> - website
> - spice-protocol
>
> Frediano

  toso


signature.asc
Description: PGP signature
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH v2 0/4] Protocol file syntax documentation

2016-10-05 Thread Christophe Fergeau
On Wed, Oct 05, 2016 at 03:08:58PM +0200, Victor Toso wrote:
> Hi,
> 
> On Tue, Oct 04, 2016 at 04:58:29AM -0400, Frediano Ziglio wrote:
> > >
> > > On Fri, Sep 30, 2016 at 01:13:04PM +0200, Victor Toso wrote:
> > > > On Fri, Sep 30, 2016 at 07:08:55AM -0400, Frediano Ziglio wrote:
> > > > > Just to make it clear... do you mean spice-server repository?
> > > >
> > > > Yes. We already have the (old) docs there and I don't see a reason to
> > > > move it to protocol/common/website git...
> > >
> > > For what it's worth, once upon a time, there was no spice-common
> > > submodule, and there was no spice-gtk either, everything (client and
> > > server) was in spice/, so the docs were there too. Then spice-gtk was
> > > created, and spice-common/ was split up as a submodule to share code
> > > between the 2. The doc stayed in spice/, but I would not say this was an
> > > explicit decision :)
> > >
> > > I still think that the .proto files (and so this doc) belongs to
> > > spice-protocol, but at this point this has not happened :)
> 
> I did not follow too close the discussion around merging spice-protocol
> and spice-common... so, I'm not sure if there was an agreement or if
> some discussion is pending to set this matter.

Mostly no strong agreement, failed attempt at moving the code
generation/spice.proto to spice-protocol, ... More work/thinking needed
:)

Christophe


signature.asc
Description: PGP signature
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [PATCH 2/2] fixup! Convert RedChannelClient hierarchy to GObject

2016-10-05 Thread Jonathon Jongsma
Remove a couple unimplemented gobject vfuncs
---
 server/cursor-channel-client.c |  9 -
 server/main-channel-client.c   | 12 
 2 files changed, 21 deletions(-)

diff --git a/server/cursor-channel-client.c b/server/cursor-channel-client.c
index 51fef19..19ac8e7 100644
--- a/server/cursor-channel-client.c
+++ b/server/cursor-channel-client.c
@@ -52,19 +52,10 @@ struct CursorChannelClientPrivate
 uint32_t cursor_cache_items;
 };
 
-static void cursor_channel_client_constructed(GObject *object)
-{
-G_OBJECT_CLASS(cursor_channel_client_parent_class)->constructed(object);
-}
-
 static void
 cursor_channel_client_class_init(CursorChannelClientClass *klass)
 {
-GObjectClass *object_class = G_OBJECT_CLASS(klass);
-
 g_type_class_add_private(klass, sizeof(CursorChannelClientPrivate));
-
-object_class->constructed = cursor_channel_client_constructed;
 }
 
 static void
diff --git a/server/main-channel-client.c b/server/main-channel-client.c
index ec9c3e1..cff50c1 100644
--- a/server/main-channel-client.c
+++ b/server/main-channel-client.c
@@ -162,16 +162,6 @@ static void main_channel_client_set_property(GObject 
*object,
 }
 }
 
-static void main_channel_client_dispose(GObject *object)
-{
-G_OBJECT_CLASS(main_channel_client_parent_class)->dispose(object);
-}
-
-static void main_channel_client_finalize(GObject *object)
-{
-G_OBJECT_CLASS(main_channel_client_parent_class)->finalize(object);
-}
-
 static void ping_timer_cb(void *opaque);
 static void main_channel_client_constructed(GObject *object)
 {
@@ -196,8 +186,6 @@ static void 
main_channel_client_class_init(MainChannelClientClass *klass)
 
 object_class->get_property = main_channel_client_get_property;
 object_class->set_property = main_channel_client_set_property;
-object_class->dispose = main_channel_client_dispose;
-object_class->finalize = main_channel_client_finalize;
 object_class->constructed = main_channel_client_constructed;
 
 g_object_class_install_property(object_class,
-- 
2.7.4

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [PATCH 1/2] fixup! Convert RedChannelClient hierarchy to GObject

2016-10-05 Thread Jonathon Jongsma
Allocate DisplayChannelClientPrivate manually to avoid changing all
arrays to dynamically allocated.
---
 server/dcc-private.h |  6 +++---
 server/dcc.c | 17 +
 2 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/server/dcc-private.h b/server/dcc-private.h
index 0901045..de6ea92 100644
--- a/server/dcc-private.h
+++ b/server/dcc-private.h
@@ -51,10 +51,10 @@ struct DisplayChannelClientPrivate
 int num_pixmap_cache_items;
 } send_data;
 
-uint8_t *surface_client_created;
-QRegion *surface_client_lossy_region;
+uint8_t surface_client_created[NUM_SURFACES];
+QRegion surface_client_lossy_region[NUM_SURFACES];
 
-StreamAgent *stream_agents;
+StreamAgent stream_agents[NUM_STREAMS];
 int use_video_encoder_rate_control;
 uint32_t streams_max_latency;
 uint64_t streams_max_bit_rate;
diff --git a/server/dcc.c b/server/dcc.c
index 08866c9..64a6f5e 100644
--- a/server/dcc.c
+++ b/server/dcc.c
@@ -26,8 +26,6 @@
 
 G_DEFINE_TYPE(DisplayChannelClient, display_channel_client, 
RED_TYPE_CHANNEL_CLIENT)
 
-#define DISPLAY_CHANNEL_CLIENT_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), 
TYPE_DISPLAY_CHANNEL_CLIENT, DisplayChannelClientPrivate))
-
 #define DISPLAY_CLIENT_SHORT_TIMEOUT 150ULL //nano
 #define DISPLAY_FREE_LIST_DEFAULT_SIZE 128
 
@@ -99,18 +97,13 @@ display_channel_client_constructed(GObject *object)
 dcc_init_stream_agents(self);
 
 image_encoders_init(&self->priv->encoders, 
&DCC_TO_DC(self)->priv->encoder_shared_data);
-
-self->priv->surface_client_created = g_new0(uint8_t, NUM_SURFACES);
-self->priv->surface_client_lossy_region = g_new0(QRegion, NUM_SURFACES);
 }
 
 static void
 display_channel_client_finalize(GObject *object)
 {
 DisplayChannelClient *self = DISPLAY_CHANNEL_CLIENT(object);
-g_free(self->priv->stream_agents);
-g_free(self->priv->surface_client_created);
-g_free(self->priv->surface_client_lossy_region);
+g_free(self->priv);
 
 G_OBJECT_CLASS(display_channel_client_parent_class)->finalize(object);
 }
@@ -120,8 +113,6 @@ display_channel_client_class_init(DisplayChannelClientClass 
*klass)
 {
 GObjectClass *object_class = G_OBJECT_CLASS(klass);
 
-g_type_class_add_private(klass, sizeof(DisplayChannelClientPrivate));
-
 object_class->get_property = display_channel_client_get_property;
 object_class->set_property = display_channel_client_set_property;
 object_class->constructed = display_channel_client_constructed;
@@ -160,7 +151,10 @@ 
display_channel_client_class_init(DisplayChannelClientClass *klass)
 
 static void display_channel_client_init(DisplayChannelClient *self)
 {
-self->priv = DISPLAY_CHANNEL_CLIENT_PRIVATE(self);
+/* we need to allocate the private data manually here since
+ * g_type_class_add_private() doesn't support private structs larger than
+ * 64k */
+self->priv = g_new0(DisplayChannelClientPrivate, 1);
 
 ring_init(&self->priv->palette_cache_lru);
 self->priv->palette_cache_available = CLIENT_PALETTE_CACHE_SIZE;
@@ -474,7 +468,6 @@ static void dcc_init_stream_agents(DisplayChannelClient 
*dcc)
 int i;
 DisplayChannel *display = DCC_TO_DC(dcc);
 
-dcc->priv->stream_agents = g_new0(StreamAgent, NUM_STREAMS);
 for (i = 0; i < NUM_STREAMS; i++) {
 StreamAgent *agent = &dcc->priv->stream_agents[i];
 agent->stream = &display->priv->streams_buf[i];
-- 
2.7.4

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [PATCH 0/2] A couple more fixups

2016-10-05 Thread Jonathon Jongsma
These should apply to the end of your fixup series

Jonathon Jongsma (2):
  fixup! Convert RedChannelClient hierarchy to GObject
  fixup! Convert RedChannelClient hierarchy to GObject

 server/cursor-channel-client.c |  9 -
 server/dcc-private.h   |  6 +++---
 server/dcc.c   | 17 +
 server/main-channel-client.c   | 12 
 4 files changed, 8 insertions(+), 36 deletions(-)

-- 
2.7.4

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH spice-server v2 0/7] Update proposed refactory merges

2016-10-05 Thread Jonathon Jongsma
These patches (including the two extra fixups I sent) look fine to me,
but I'll wait for somebody else to officially ACK them.

Jonathon


On Fri, 2016-09-30 at 14:21 +0100, Frediano Ziglio wrote:
> This patchset contains my split of the patches and some
> proposed changes to the second big patch.
> 
> Frediano Ziglio (7):
>   Split RedCharDeviceSmartcard and SmartCardChannelClient
>   Convert RedChannelClient hierarchy to GObject
>   fixup! Convert RedChannelClient hierarchy to GObject
>   fixup! Convert RedChannelClient hierarchy to GObject
>   fixup! Convert RedChannelClient hierarchy to GObject
>   fixup! Convert RedChannelClient hierarchy to GObject
>   fixup! Convert RedChannelClient hierarchy to GObject
> 
>  configure.ac|   4 +-
>  server/Makefile.am  |   4 +
>  server/cursor-channel-client.c  |  74 +++--
>  server/cursor-channel-client.h  |  34 ++-
>  server/dcc-private.h|  14 +-
>  server/dcc.c| 201 +++--
>  server/dcc.h|  37 ++-
>  server/display-channel.c|   4 +-
>  server/dummy-channel-client.c   | 156 ++
>  server/dummy-channel-client.h   |  59 
>  server/inputs-channel-client.c  |  56 ++--
>  server/inputs-channel-client.h  |  47 ++-
>  server/main-channel-client.c| 146 --
>  server/main-channel-client.h|  34 ++-
>  server/red-channel-client-private.h |   4 +-
>  server/red-channel-client.c | 551 
> 
>  server/red-channel-client.h |  80 --
>  server/red-channel.h|  31 +-
>  server/smartcard-channel-client.c   | 415
> +++
>  server/smartcard-channel-client.h   | 108 +++
>  server/smartcard.c  | 374 
>  server/smartcard.h  |  21 ++
>  server/sound.c  |   9 +-
>  server/spice-server.h   |  16 ++
>  server/spicevmc.c   |   6 +-
>  25 files changed, 1805 insertions(+), 680 deletions(-)
>  create mode 100644 server/dummy-channel-client.c
>  create mode 100644 server/dummy-channel-client.h
>  create mode 100644 server/smartcard-channel-client.c
>  create mode 100644 server/smartcard-channel-client.h
> 
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel