[Spice-devel,spice-gtk,v1] Revert "win-usb-dev: report error to g_udev_client_new()"

Submitted by Victor Toso on Nov. 16, 2016, 5:59 p.m.

Details

Message ID 20161116175958.16708-1-victortoso@redhat.com
State Accepted
Commit ad95b8fd6eeb9ad4f57bc75ab57d42c3c7b65345
Headers show
Series "Revert "win-usb-dev: report error to g_udev_client_new()"" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Victor Toso Nov. 16, 2016, 5:59 p.m.
From: Victor Toso <me@victortoso.com>

This reverts commit eba83a7056d4213b60466f692a03e515115b0826.

This is breaking build in linux as it relies on the actual GUdevClient
API. Let's simply revert and find a different way to get the error.

Signed-off-by: Victor Toso <victortoso@redhat.com>
---
 src/usb-device-manager.c | 5 ++---
 src/win-usb-dev.c        | 4 ++--
 src/win-usb-dev.h        | 2 +-
 3 files changed, 5 insertions(+), 6 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c
index efb7454..6d10daa 100644
--- a/src/usb-device-manager.c
+++ b/src/usb-device-manager.c
@@ -320,10 +320,9 @@  static gboolean spice_usb_device_manager_initable_init(GInitable  *initable,
 
     /* Start listening for usb devices plug / unplug */
 #ifdef USE_GUDEV
-    priv->udev = g_udev_client_new(subsystems, err);
+    priv->udev = g_udev_client_new(subsystems);
     if (priv->udev == NULL) {
-        const gchar *msg = (err != NULL && *err != NULL) ? (*err)->message : "";
-        g_warning("Error initializing GUdevClient - %s", msg);
+        g_warning("Error initializing GUdevClient");
         return FALSE;
     }
     g_signal_connect(G_OBJECT(priv->udev), "uevent",
diff --git a/src/win-usb-dev.c b/src/win-usb-dev.c
index defa71e..ec3dd91 100644
--- a/src/win-usb-dev.c
+++ b/src/win-usb-dev.c
@@ -106,12 +106,12 @@  GQuark g_udev_client_error_quark(void)
     return g_quark_from_static_string("win-gudev-client-error-quark");
 }
 
-GUdevClient *g_udev_client_new(const gchar* const *subsystems, GError **error)
+GUdevClient *g_udev_client_new(const gchar* const *subsystems)
 {
     if (singleton != NULL)
         return g_object_ref(singleton);
 
-    singleton = g_initable_new(G_UDEV_TYPE_CLIENT, NULL, error, NULL);
+    singleton = g_initable_new(G_UDEV_TYPE_CLIENT, NULL, NULL, NULL);
     return singleton;
 }
 
diff --git a/src/win-usb-dev.h b/src/win-usb-dev.h
index a9562ab..b5c4fce 100644
--- a/src/win-usb-dev.h
+++ b/src/win-usb-dev.h
@@ -79,7 +79,7 @@  struct _GUdevClientClass
 };
 
 GType g_udev_client_get_type(void) G_GNUC_CONST;
-GUdevClient *g_udev_client_new(const gchar* const *subsystems, GError **error);
+GUdevClient *g_udev_client_new(const gchar* const *subsystems);
 GList *g_udev_client_query_by_subsystem(GUdevClient *client, const gchar *subsystem);
 
 GType g_udev_device_get_type(void) G_GNUC_CONST;

Comments

Personally, I think reverting a patch that breaks a build can probably
be done without review (although it should still be mentioned on the
mailing list).  But:

Acked-by: Jonathon Jongsma <jjongsma@redhat.com>



On Wed, 2016-11-16 at 18:59 +0100, Victor Toso wrote:
> From: Victor Toso <me@victortoso.com>
> 
> This reverts commit eba83a7056d4213b60466f692a03e515115b0826.
> 
> This is breaking build in linux as it relies on the actual
> GUdevClient
> API. Let's simply revert and find a different way to get the error.
> 
> Signed-off-by: Victor Toso <victortoso@redhat.com>
> ---
>  src/usb-device-manager.c | 5 ++---
>  src/win-usb-dev.c        | 4 ++--
>  src/win-usb-dev.h        | 2 +-
>  3 files changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c
> index efb7454..6d10daa 100644
> --- a/src/usb-device-manager.c
> +++ b/src/usb-device-manager.c
> @@ -320,10 +320,9 @@ static gboolean
> spice_usb_device_manager_initable_init(GInitable  *initable,
>  
>      /* Start listening for usb devices plug / unplug */
>  #ifdef USE_GUDEV
> -    priv->udev = g_udev_client_new(subsystems, err);
> +    priv->udev = g_udev_client_new(subsystems);
>      if (priv->udev == NULL) {
> -        const gchar *msg = (err != NULL && *err != NULL) ? (*err)-
> >message : "";
> -        g_warning("Error initializing GUdevClient - %s", msg);
> +        g_warning("Error initializing GUdevClient");
>          return FALSE;
>      }
>      g_signal_connect(G_OBJECT(priv->udev), "uevent",
> diff --git a/src/win-usb-dev.c b/src/win-usb-dev.c
> index defa71e..ec3dd91 100644
> --- a/src/win-usb-dev.c
> +++ b/src/win-usb-dev.c
> @@ -106,12 +106,12 @@ GQuark g_udev_client_error_quark(void)
>      return g_quark_from_static_string("win-gudev-client-error-
> quark");
>  }
>  
> -GUdevClient *g_udev_client_new(const gchar* const *subsystems,
> GError **error)
> +GUdevClient *g_udev_client_new(const gchar* const *subsystems)
>  {
>      if (singleton != NULL)
>          return g_object_ref(singleton);
>  
> -    singleton = g_initable_new(G_UDEV_TYPE_CLIENT, NULL, error,
> NULL);
> +    singleton = g_initable_new(G_UDEV_TYPE_CLIENT, NULL, NULL,
> NULL);
>      return singleton;
>  }
>  
> diff --git a/src/win-usb-dev.h b/src/win-usb-dev.h
> index a9562ab..b5c4fce 100644
> --- a/src/win-usb-dev.h
> +++ b/src/win-usb-dev.h
> @@ -79,7 +79,7 @@ struct _GUdevClientClass
>  };
>  
>  GType g_udev_client_get_type(void) G_GNUC_CONST;
> -GUdevClient *g_udev_client_new(const gchar* const *subsystems,
> GError **error);
> +GUdevClient *g_udev_client_new(const gchar* const *subsystems);
>  GList *g_udev_client_query_by_subsystem(GUdevClient *client, const
> gchar *subsystem);
>  
>  GType g_udev_device_get_type(void) G_GNUC_CONST;
Hi,

On Wed, Nov 16, 2016 at 12:07:45PM -0600, Jonathon Jongsma wrote:
> Personally, I think reverting a patch that breaks a build can probably
> be done without review (although it should still be mentioned on the
> mailing list).  But:

Ah, indeed.

>
> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>

Thanks,
  toso
> 
> 
> 
> On Wed, 2016-11-16 at 18:59 +0100, Victor Toso wrote:
> > From: Victor Toso <me@victortoso.com>
> > 
> > This reverts commit eba83a7056d4213b60466f692a03e515115b0826.
> > 
> > This is breaking build in linux as it relies on the actual
> > GUdevClient
> > API. Let's simply revert and find a different way to get the error.
> > 
> > Signed-off-by: Victor Toso <victortoso@redhat.com>
> > ---
> >  src/usb-device-manager.c | 5 ++---
> >  src/win-usb-dev.c        | 4 ++--
> >  src/win-usb-dev.h        | 2 +-
> >  3 files changed, 5 insertions(+), 6 deletions(-)
> > 
> > diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c
> > index efb7454..6d10daa 100644
> > --- a/src/usb-device-manager.c
> > +++ b/src/usb-device-manager.c
> > @@ -320,10 +320,9 @@ static gboolean
> > spice_usb_device_manager_initable_init(GInitable  *initable,
> >  
> >      /* Start listening for usb devices plug / unplug */
> >  #ifdef USE_GUDEV
> > -    priv->udev = g_udev_client_new(subsystems, err);
> > +    priv->udev = g_udev_client_new(subsystems);
> >      if (priv->udev == NULL) {
> > -        const gchar *msg = (err != NULL && *err != NULL) ? (*err)-
> > >message : "";
> > -        g_warning("Error initializing GUdevClient - %s", msg);
> > +        g_warning("Error initializing GUdevClient");
> >          return FALSE;
> >      }
> >      g_signal_connect(G_OBJECT(priv->udev), "uevent",
> > diff --git a/src/win-usb-dev.c b/src/win-usb-dev.c
> > index defa71e..ec3dd91 100644
> > --- a/src/win-usb-dev.c
> > +++ b/src/win-usb-dev.c
> > @@ -106,12 +106,12 @@ GQuark g_udev_client_error_quark(void)
> >      return g_quark_from_static_string("win-gudev-client-error-
> > quark");
> >  }
> >  
> > -GUdevClient *g_udev_client_new(const gchar* const *subsystems,
> > GError **error)
> > +GUdevClient *g_udev_client_new(const gchar* const *subsystems)
> >  {
> >      if (singleton != NULL)
> >          return g_object_ref(singleton);
> >  
> > -    singleton = g_initable_new(G_UDEV_TYPE_CLIENT, NULL, error,
> > NULL);
> > +    singleton = g_initable_new(G_UDEV_TYPE_CLIENT, NULL, NULL,
> > NULL);
> >      return singleton;
> >  }
> >  
> > diff --git a/src/win-usb-dev.h b/src/win-usb-dev.h
> > index a9562ab..b5c4fce 100644
> > --- a/src/win-usb-dev.h
> > +++ b/src/win-usb-dev.h
> > @@ -79,7 +79,7 @@ struct _GUdevClientClass
> >  };
> >  
> >  GType g_udev_client_get_type(void) G_GNUC_CONST;
> > -GUdevClient *g_udev_client_new(const gchar* const *subsystems,
> > GError **error);
> > +GUdevClient *g_udev_client_new(const gchar* const *subsystems);
> >  GList *g_udev_client_query_by_subsystem(GUdevClient *client, const
> > gchar *subsystem);
> >  
> >  GType g_udev_device_get_type(void) G_GNUC_CONST;
On Wed, Nov 16, 2016 at 12:07:45PM -0600, Jonathon Jongsma wrote:
> Personally, I think reverting a patch that breaks a build can probably
> be done without review (although it should still be mentioned on the
> mailing list).

Yup, I agree. Unless you are not sure the revert is not going to cause
more issues and prefer to have other eyes on it first.

Christophe