[Spice-commits] 5 commits - doc/reference gtk/channel-smartcard.c gtk/channel-smartcard.h gtk/smartcard-manager.c gtk/smartcard-manager.h gtk/spice-session.c gtk/spicy.c
Marc-André Lureau
elmarco at kemper.freedesktop.org
Wed Jul 13 10:02:25 PDT 2011
doc/reference/spice-gtk-docs.xml | 2
doc/reference/spice-gtk-sections.txt | 48 +++++++++++++++++
doc/reference/spice-gtk.types | 5 +
gtk/channel-smartcard.c | 14 ++++-
gtk/channel-smartcard.h | 2
gtk/smartcard-manager.c | 55 ++++++++++++++++++--
gtk/smartcard-manager.h | 4 +
gtk/spice-session.c | 94 +++++++++++++++++++++++++++++++++++
gtk/spicy.c | 4 +
9 files changed, 218 insertions(+), 10 deletions(-)
New commits:
commit fd0c76a889fe0aefb37df5e044f9f5286022e32a
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date: Wed Jul 13 19:00:29 2011 +0200
gtk/doc: improve the generated gtk-doc a bit
diff --git a/doc/reference/spice-gtk-docs.xml b/doc/reference/spice-gtk-docs.xml
index 57ef701..1308041 100644
--- a/doc/reference/spice-gtk-docs.xml
+++ b/doc/reference/spice-gtk-docs.xml
@@ -35,7 +35,6 @@
<xi:include href="xml/channel-playback.xml"/>
<xi:include href="xml/channel-record.xml"/>
<xi:include href="xml/channel-smartcard.xml"/>
- <xi:include href="xml/smartcard-manager.xml"/>
</chapter>
<chapter>
@@ -46,6 +45,7 @@
<chapter id="application-support">
<title>Application Support, from spice-client-glib</title>
<xi:include href="xml/spice-audio.xml"/>
+ <xi:include href="xml/smartcard-manager.xml"/>
<xi:include href="xml/spice-util.xml"/>
</chapter>
diff --git a/doc/reference/spice-gtk-sections.txt b/doc/reference/spice-gtk-sections.txt
index 715a3ba..9467faa 100644
--- a/doc/reference/spice-gtk-sections.txt
+++ b/doc/reference/spice-gtk-sections.txt
@@ -45,6 +45,7 @@ spice_session_verify_get_type
<TITLE>SpiceMainChannel</TITLE>
SpiceMainChannel
SpiceMainChannelClass
+<SUBSECTION>
spice_main_channel
spice_main_set_display
spice_main_clipboard_grab
@@ -68,6 +69,7 @@ SpiceChannelEvent
SpiceChannelVerify
SpiceChannel
SpiceChannelClass
+<SUBSECTION>
spice_channel_new
spice_channel_destroy
spice_channel_connect
@@ -96,6 +98,7 @@ spice_msg_out
<TITLE>SpiceAudio</TITLE>
SpiceAudio
SpiceAudioClass
+<SUBSECTION>
spice_audio_new
<SUBSECTION Standard>
SPICE_AUDIO
@@ -146,6 +149,7 @@ spice_cursor_channel
<TITLE>SpiceRecordChannel</TITLE>
SpiceRecordChannel
SpiceRecordChannelClass
+<SUBSECTION>
spice_record_send_data
<SUBSECTION Standard>
SPICE_RECORD_CHANNEL
@@ -165,6 +169,7 @@ spice_record_channel
SpiceInputsChannel
SpiceInputsChannelClass
SpiceInputsLock
+<SUBSECTION>
spice_inputs_motion
spice_inputs_position
spice_inputs_button_press
@@ -189,7 +194,6 @@ spice_inputs_channel
<SECTION>
<FILE>channel-smartcard</FILE>
<TITLE>SpiceSmartcardChannel</TITLE>
-spice_smartcard_channel
SpiceSmartcardChannel
SpiceSmartcardChannelClass
<SUBSECTION Standard>
@@ -200,21 +204,22 @@ spice_smartcard_channel_get_type
SPICE_SMARTCARD_CHANNEL_CLASS
SPICE_IS_SMARTCARD_CHANNEL_CLASS
SPICE_SMARTCARD_CHANNEL_GET_CLASS
+<SUBSECTION Private>
+spice_smartcard_channel
</SECTION>
<SECTION>
<FILE>smartcard-manager</FILE>
<TITLE>SpiceSmartcardManager</TITLE>
-SPICE_TYPE_SMARTCARD_READER
-spice_smartcard_manager
SpiceSmartcardManager
SpiceSmartcardManagerClass
-spice_smartcard_reader_get_type
+SpiceSmartcardReader
+<SUBSECTION>
spice_smartcard_manager_get
spice_smartcard_manager_insert_card
spice_smartcard_manager_remove_card
+<SUBSECTION>
spice_smartcard_reader_is_software
-SpiceSmartcardReader
<SUBSECTION Standard>
SPICE_SMARTCARD_MANAGER
SPICE_IS_SMARTCARD_MANAGER
@@ -223,6 +228,10 @@ spice_smartcard_manager_get_type
SPICE_SMARTCARD_MANAGER_CLASS
SPICE_IS_SMARTCARD_MANAGER_CLASS
SPICE_SMARTCARD_MANAGER_GET_CLASS
+SPICE_TYPE_SMARTCARD_READER
+spice_smartcard_reader_get_type
+<SUBSECTION Private>
+spice_smartcard_manager
</SECTION>
<SECTION>
diff --git a/doc/reference/spice-gtk.types b/doc/reference/spice-gtk.types
index 51dcef4..6639730 100644
--- a/doc/reference/spice-gtk.types
+++ b/doc/reference/spice-gtk.types
@@ -11,8 +11,10 @@
#include "channel-inputs.h"
#include "channel-playback.h"
#include "channel-record.h"
+#include "channel-smartcard.h"
#include "spice-widget.h"
#include "spice-grabsequence.h"
+#include "smartcard-manager.h"
spice_audio_get_type
spice_channel_event_get_type
@@ -28,3 +30,6 @@ spice_playback_channel_get_type
spice_record_channel_get_type
spice_session_get_type
spice_session_verify_get_type
+spice_smartcard_channel_get_type
+spice_smartcard_manager_get_type
+spice_session_verify_get_type
diff --git a/gtk/channel-smartcard.c b/gtk/channel-smartcard.c
index 511152e..4d4ddac 100644
--- a/gtk/channel-smartcard.c
+++ b/gtk/channel-smartcard.c
@@ -34,7 +34,7 @@
* @title: Smartcard Channel
* @section_id:
* @see_also: #SpiceSmartcardManager, #SpiceSession
- * @stability: In Development
+ * @stability: API Stable (channel in development)
* @include: channel-smartcard.h
*
* The Spice protocol defines a set of messages to forward smartcard
diff --git a/gtk/channel-smartcard.h b/gtk/channel-smartcard.h
index 03c110f..d2e9a27 100644
--- a/gtk/channel-smartcard.h
+++ b/gtk/channel-smartcard.h
@@ -35,6 +35,8 @@ typedef struct spice_smartcard_channel spice_smartcard_channel;
struct _SpiceSmartcardChannel {
SpiceChannel parent;
+
+ /*< private >*/
spice_smartcard_channel *priv;
/* Do not add fields to this struct */
};
diff --git a/gtk/smartcard-manager.c b/gtk/smartcard-manager.c
index 72c8177..0ff96b1 100644
--- a/gtk/smartcard-manager.c
+++ b/gtk/smartcard-manager.c
@@ -34,7 +34,7 @@
/**
* SECTION:smartcard-manager
* @short_description: smartcard management
- * @title: Spice SmartcardManager
+ * @title: Spice Smartcard Manager
* @section_id:
* @see_also:
* @stability: Stable
diff --git a/gtk/smartcard-manager.h b/gtk/smartcard-manager.h
index ccdaf6c..d1f8b88 100644
--- a/gtk/smartcard-manager.h
+++ b/gtk/smartcard-manager.h
@@ -41,6 +41,8 @@ typedef struct _SpiceSmartcardReader SpiceSmartcardReader;
struct _SpiceSmartcardManager
{
GObject parent;
+
+ /*< private >*/
spice_smartcard_manager *priv;
/* Do not add fields to this struct */
};
@@ -54,6 +56,8 @@ struct _SpiceSmartcardManagerClass
void (*reader_removed)(SpiceSmartcardManager *manager, SpiceSmartcardReader *reader);
void (*card_inserted)(SpiceSmartcardManager *manager, SpiceSmartcardReader *reader);
void (*card_removed)(SpiceSmartcardManager *manager, SpiceSmartcardReader *reader );
+
+ /*< private >*/
/*
* If adding fields to this struct, remove corresponding
* amount of padding to avoid changing overall struct size
commit 2f7b91ae9969ae5f21e3510c5d6046200b5e1085
Merge: d9d19e2... 1139abe...
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date: Wed Jul 13 18:18:07 2011 +0200
Merge remote-tracking branch 'teuf/master'
commit 1139abe99f3de1d75c3790a491ee163a56e7a7d2
Author: Christophe Fergeau <cfergeau at redhat.com>
Date: Wed Jul 13 12:09:13 2011 +0200
document SpiceSession properties
diff --git a/gtk/spice-session.c b/gtk/spice-session.c
index 7270ab7..824eff0 100644
--- a/gtk/spice-session.c
+++ b/gtk/spice-session.c
@@ -482,6 +482,12 @@ static void spice_session_class_init(SpiceSessionClass *klass)
gobject_class->get_property = spice_session_get_property;
gobject_class->set_property = spice_session_set_property;
+ /**
+ * SpiceSession:host:
+ *
+ * URL of the SPICE host to connect to
+ *
+ **/
g_object_class_install_property
(gobject_class, PROP_HOST,
g_param_spec_string("host",
@@ -492,6 +498,12 @@ static void spice_session_class_init(SpiceSessionClass *klass)
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_STRINGS));
+ /**
+ * SpiceSession:port:
+ *
+ * Port to connect to for unencrypted sessions
+ *
+ **/
g_object_class_install_property
(gobject_class, PROP_PORT,
g_param_spec_string("port",
@@ -501,6 +513,12 @@ static void spice_session_class_init(SpiceSessionClass *klass)
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
+ /**
+ * SpiceSession:tls-port:
+ *
+ * Port to connect to for TLS sessions
+ *
+ **/
g_object_class_install_property
(gobject_class, PROP_TLS_PORT,
g_param_spec_string("tls-port",
@@ -510,6 +528,12 @@ static void spice_session_class_init(SpiceSessionClass *klass)
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
+ /**
+ * SpiceSession:password:
+ *
+ * TLS password to use
+ *
+ **/
g_object_class_install_property
(gobject_class, PROP_PASSWORD,
g_param_spec_string("password",
@@ -519,6 +543,13 @@ static void spice_session_class_init(SpiceSessionClass *klass)
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
+ /**
+ * SpiceSession:ca-file:
+ *
+ * File holding the CA certificates for the host the client is
+ * connecting to
+ *
+ **/
g_object_class_install_property
(gobject_class, PROP_CA_FILE,
g_param_spec_string("ca-file",
@@ -528,6 +559,10 @@ static void spice_session_class_init(SpiceSessionClass *klass)
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
+ /**
+ * SpiceSession:ciphers:
+ *
+ **/
g_object_class_install_property
(gobject_class, PROP_CIPHERS,
g_param_spec_string("ciphers",
@@ -537,6 +572,12 @@ static void spice_session_class_init(SpiceSessionClass *klass)
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
+ /**
+ * SpiceSession:protocol:
+ *
+ * Version of the SPICE protocol to use
+ *
+ **/
g_object_class_install_property
(gobject_class, PROP_PROTOCOL,
g_param_spec_int("protocol",
@@ -547,6 +588,13 @@ static void spice_session_class_init(SpiceSessionClass *klass)
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_STRINGS));
+ /**
+ * SpiceSession:uri:
+ *
+ * URI of the SPICE host to connect to. The URI is of the form
+ * spice://hostname?port=XXX or spice://hostname?tls_port=XXX
+ *
+ **/
g_object_class_install_property
(gobject_class, PROP_URI,
g_param_spec_string("uri",
@@ -556,6 +604,10 @@ static void spice_session_class_init(SpiceSessionClass *klass)
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
+ /**
+ * SpiceSession:client-sockets:
+ *
+ **/
g_object_class_install_property
(gobject_class, PROP_CLIENT_SOCKETS,
g_param_spec_boolean("client-sockets",
@@ -565,6 +617,10 @@ static void spice_session_class_init(SpiceSessionClass *klass)
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
+ /**
+ * SpiceSession:pubkey:
+ *
+ **/
g_object_class_install_property
(gobject_class, PROP_PUBKEY,
g_param_spec_boxed("pubkey",
@@ -574,6 +630,10 @@ static void spice_session_class_init(SpiceSessionClass *klass)
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
+ /**
+ * SpiceSession:cert-subject:
+ *
+ **/
g_object_class_install_property
(gobject_class, PROP_CERT_SUBJECT,
g_param_spec_string("cert-subject",
@@ -583,6 +643,12 @@ static void spice_session_class_init(SpiceSessionClass *klass)
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
+ /**
+ * SpiceSession:verify:
+ *
+ * #SpiceSessionVerify bit field indicating which parts of the peer
+ * certificate should be checked
+ **/
g_object_class_install_property
(gobject_class, PROP_VERIFY,
g_param_spec_flags("verify",
@@ -594,6 +660,13 @@ static void spice_session_class_init(SpiceSessionClass *klass)
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_STRINGS));
+ /**
+ * SpiceSession:migration-state:
+ *
+ * #SpiceSessionMigration bit field indicating if a migration is in
+ * progress
+ *
+ **/
g_object_class_install_property
(gobject_class, PROP_MIGRATION_STATE,
g_param_spec_enum("migration-state",
@@ -604,6 +677,12 @@ static void spice_session_class_init(SpiceSessionClass *klass)
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
+ /**
+ * SpiceSession:enable-smartcard:
+ *
+ * If set to TRUE, the smartcard channel will be enabled and smartcard
+ * events will be forwarded to the guest
+ **/
g_object_class_install_property
(gobject_class, PROP_SMARTCARD,
g_param_spec_boolean("enable-smartcard",
@@ -613,6 +692,15 @@ static void spice_session_class_init(SpiceSessionClass *klass)
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
+ /**
+ * SpiceSession:smartcard-certificates:
+ *
+ * This property is used when one wants to simulate a smartcard with no
+ * hardware smartcard reader. If it's set to a NULL-terminated string
+ * array containing the names of 3 valid certificates, these will be
+ * used to simulate a smartcard in the guest
+ * @see_also: spice_smartcard_manager_insert_card()
+ **/
g_object_class_install_property
(gobject_class, PROP_SMARTCARD_CERTIFICATES,
g_param_spec_boxed("smartcard-certificates",
@@ -623,6 +711,12 @@ static void spice_session_class_init(SpiceSessionClass *klass)
G_PARAM_WRITABLE |
G_PARAM_STATIC_STRINGS));
+ /**
+ * SpiceSession:smartcard-db:
+ *
+ * Path to the NSS certificate database containing the certificates to
+ * use to simulate a software smartcard
+ **/
g_object_class_install_property
(gobject_class, PROP_SMARTCARD_DB,
g_param_spec_string("smartcard-db",
commit f3c48f998533daf504c518b0b11272f1b3efc777
Author: Christophe Fergeau <cfergeau at redhat.com>
Date: Tue Jul 12 19:40:14 2011 +0200
smartcard: add smartcard API doc
diff --git a/doc/reference/spice-gtk-docs.xml b/doc/reference/spice-gtk-docs.xml
index 2938960..57ef701 100644
--- a/doc/reference/spice-gtk-docs.xml
+++ b/doc/reference/spice-gtk-docs.xml
@@ -34,6 +34,8 @@
<xi:include href="xml/channel-main.xml"/>
<xi:include href="xml/channel-playback.xml"/>
<xi:include href="xml/channel-record.xml"/>
+ <xi:include href="xml/channel-smartcard.xml"/>
+ <xi:include href="xml/smartcard-manager.xml"/>
</chapter>
<chapter>
diff --git a/doc/reference/spice-gtk-sections.txt b/doc/reference/spice-gtk-sections.txt
index 8ae04ba..715a3ba 100644
--- a/doc/reference/spice-gtk-sections.txt
+++ b/doc/reference/spice-gtk-sections.txt
@@ -187,6 +187,45 @@ spice_inputs_channel
</SECTION>
<SECTION>
+<FILE>channel-smartcard</FILE>
+<TITLE>SpiceSmartcardChannel</TITLE>
+spice_smartcard_channel
+SpiceSmartcardChannel
+SpiceSmartcardChannelClass
+<SUBSECTION Standard>
+SPICE_SMARTCARD_CHANNEL
+SPICE_IS_SMARTCARD_CHANNEL
+SPICE_TYPE_SMARTCARD_CHANNEL
+spice_smartcard_channel_get_type
+SPICE_SMARTCARD_CHANNEL_CLASS
+SPICE_IS_SMARTCARD_CHANNEL_CLASS
+SPICE_SMARTCARD_CHANNEL_GET_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>smartcard-manager</FILE>
+<TITLE>SpiceSmartcardManager</TITLE>
+SPICE_TYPE_SMARTCARD_READER
+spice_smartcard_manager
+SpiceSmartcardManager
+SpiceSmartcardManagerClass
+spice_smartcard_reader_get_type
+spice_smartcard_manager_get
+spice_smartcard_manager_insert_card
+spice_smartcard_manager_remove_card
+spice_smartcard_reader_is_software
+SpiceSmartcardReader
+<SUBSECTION Standard>
+SPICE_SMARTCARD_MANAGER
+SPICE_IS_SMARTCARD_MANAGER
+SPICE_TYPE_SMARTCARD_MANAGER
+spice_smartcard_manager_get_type
+SPICE_SMARTCARD_MANAGER_CLASS
+SPICE_IS_SMARTCARD_MANAGER_CLASS
+SPICE_SMARTCARD_MANAGER_GET_CLASS
+</SECTION>
+
+<SECTION>
<FILE>spice-widget</FILE>
<TITLE>SpiceDisplay</TITLE>
SpiceDisplay
diff --git a/gtk/channel-smartcard.c b/gtk/channel-smartcard.c
index 1591716..511152e 100644
--- a/gtk/channel-smartcard.c
+++ b/gtk/channel-smartcard.c
@@ -33,11 +33,19 @@
* @short_description: smartcard authentication
* @title: Smartcard Channel
* @section_id:
- * @see_also: #SpiceChannel
+ * @see_also: #SpiceSmartcardManager, #SpiceSession
* @stability: In Development
* @include: channel-smartcard.h
*
- * TODO
+ * The Spice protocol defines a set of messages to forward smartcard
+ * information from the Spice client to the VM. This channel handles
+ * these messages. While it's mainly focus on smartcard readers and
+ * smartcards, it's also possible to use it with a software smartcard
+ * (ie a set of 3 certificates from the client machine).
+ * This class doesn't provide useful methods, see #SpiceSession properties
+ * for a way to enable/disable this channel, and #SpiceSmartcardManager
+ * if you want to detect smartcard reader hotplug/unplug, and smartcard
+ * insertion/removal.
*/
#define SPICE_SMARTCARD_CHANNEL_GET_PRIVATE(obj) \
diff --git a/gtk/smartcard-manager.c b/gtk/smartcard-manager.c
index 003b563..72c8177 100644
--- a/gtk/smartcard-manager.c
+++ b/gtk/smartcard-manager.c
@@ -32,17 +32,18 @@
#include "spice-marshal.h"
/**
- * SECTION:spice-smartcard-manager
- * @short_description: the base smartcard-manager class
+ * SECTION:smartcard-manager
+ * @short_description: smartcard management
* @title: Spice SmartcardManager
* @section_id:
* @see_also:
* @stability: Stable
* @include: spice-smartcard-manager.h
*
- * #SpiceSmartcardManager is the base class for the different kind of Spice
- * smartcard_manager connections, such as #SpiceMainSmartcardManager, or
- * #SpiceInputsSmartcardManager.
+ * #SpiceSmartcardManager monitors smartcard reader plugging/unplugging,
+ * and smartcard insertions/removals. It also provides methods to handle
+ * software smartcards (to emulate a smartcard reader/smartcard on the
+ * guest using 3 certificates available to the client).
*/
/* ------------------------------------------------------------------ */
@@ -236,6 +237,15 @@ static SpiceSmartcardManager *spice_smartcard_manager_new(void)
/* ------------------------------------------------------------------ */
/* public api */
+/**
+ * spice_smartcard_manager_get
+ *
+ * #SpiceSmartcardManager is a singleton, use this function to get a pointer
+ * to it. A new SpiceSmartcardManager instance will be created the first
+ * time this function is called
+ *
+ * Returns: a pointer to the #SpiceSmartcardManager singleton
+ */
SpiceSmartcardManager *spice_smartcard_manager_get(void)
{
static GOnce manager_singleton_once = G_ONCE_INIT;
@@ -385,6 +395,15 @@ static guint smartcard_monitor_add(SmartcardSourceFunc callback,
#define SPICE_SOFTWARE_READER_NAME "Spice Software Smartcard"
+/**
+ * spice_smartcard_reader_is_software
+ * @reader: a #SpiceSmartcardReader
+ *
+ * Tests if @reader is a software (emulated) smartcard reader.
+ *
+ * Returns: TRUE if @reader is a software (emulated) smartcard reader,
+ * FALSE otherwise
+ */
gboolean spice_smartcard_reader_is_software(SpiceSmartcardReader *reader)
{
g_return_val_if_fail(reader != NULL, FALSE);
@@ -507,6 +526,19 @@ gboolean spice_smartcard_manager_init_finish(SpiceSession *session,
return TRUE;
}
+/**
+ * spice_smartcard_manager_insert_card
+ * @manager: a #SpiceSmartcardManager
+ *
+ * Simulates the insertion of a smartcard in the guest. Valid certificates
+ * must have been set in #SpiceSession::smartcard-certificates for software
+ * smartcard support to work. At the moment, only one software smartcard
+ * reader is supported, that's why there is no parameter to indicate which
+ * reader to insert the card in.
+ *
+ * Returns: TRUE if smartcard insertion was successfully simulated, FALSE
+ * if this failed, or if software smartcard support isn't enabled.
+ */
gboolean spice_smartcard_manager_insert_card(SpiceSmartcardManager *manager)
{
VCardEmulError status;
@@ -518,6 +550,17 @@ gboolean spice_smartcard_manager_insert_card(SpiceSmartcardManager *manager)
return (status == VCARD_EMUL_OK);
}
+/**
+ * spice_smartcard_manager_remove_card
+ * @manager: a #SpiceSmartcardManager
+ *
+ * Simulates the removal of a smartcard in the guest. At the moment, only
+ * one software smartcard reader is supported, that's why there is no
+ * parameter to indicate which reader to insert the card in.
+ *
+ * Returns: TRUE if smartcard removal was successfully simulated, FALSE
+ * if this failed, or if software smartcard support isn't enabled.
+ */
gboolean spice_smartcard_manager_remove_card(SpiceSmartcardManager *manager)
{
VCardEmulError status;
commit d9d19e25243eaeddf49c14c255e846b7dcc67914
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date: Tue Jul 12 13:21:30 2011 +0200
gtk/spicy: remove false warning
diff --git a/gtk/spicy.c b/gtk/spicy.c
index 8e2cc56..62a1732 100644
--- a/gtk/spicy.c
+++ b/gtk/spicy.c
@@ -1308,7 +1308,9 @@ static void display_mark(SpiceChannel *channel, gint mark, spice_window *win)
static gboolean strv_contains(const GStrv strv, gchar *str)
{
int i = 0;
- g_return_val_if_fail(strv != NULL, FALSE);
+
+ if (strv == NULL)
+ return FALSE;
while (strv[i] != NULL) {
if (g_str_equal(strv[i], str))
More information about the Spice-commits
mailing list