[virt-tools-list] [libosinfo PATCHv3 4/9] Deprecate osinfo_db_guess_os_from_media

Christophe Fergeau cfergeau at redhat.com
Wed Dec 12 14:26:33 UTC 2012


---
 osinfo/osinfo_db.c | 39 ++++++++++++++++++++++++---------------
 osinfo/osinfo_db.h |  1 +
 2 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/osinfo/osinfo_db.c b/osinfo/osinfo_db.c
index e236cad..e73d739 100644
--- a/osinfo/osinfo_db.c
+++ b/osinfo/osinfo_db.c
@@ -458,20 +458,10 @@ static gint media_volume_compare (gconstpointer a, gconstpointer b)
         return 1;
 }
 
-/**
- * osinfo_db_guess_os_from_media:
- * @db: the database
- * @media: the installation media
- * @matched_media: (out) (transfer none) (allow-none): the matched operating
- * system media
- *
- * Guess operating system given a #OsinfoMedia object.
- *
- * Returns: (transfer none): the operating system, or NULL if guessing failed
- */
-OsinfoOs *osinfo_db_guess_os_from_media(OsinfoDb *db,
-                                        OsinfoMedia *media,
-                                        OsinfoMedia **matched_media)
+static OsinfoOs *
+osinfo_db_guess_os_from_media_internal(OsinfoDb *db,
+                                       OsinfoMedia *media,
+                                       OsinfoMedia **matched_media)
 {
     OsinfoOs *ret = NULL;
     GList *oss = NULL;
@@ -527,6 +517,24 @@ OsinfoOs *osinfo_db_guess_os_from_media(OsinfoDb *db,
 
     return ret;
 }
+/**
+ * osinfo_db_guess_os_from_media:
+ * @db: the database
+ * @media: the installation media
+ * @matched_media: (out) (transfer none) (allow-none): the matched operating
+ * system media
+ *
+ * Guess operating system given a #OsinfoMedia object.
+ *
+ * Returns: (transfer none): the operating system, or NULL if guessing failed
+ * Deprecated: 0.2.3: Use osinfo_db_identify_media() instead.
+ */
+OsinfoOs *osinfo_db_guess_os_from_media(OsinfoDb *db,
+                                        OsinfoMedia *media,
+                                        OsinfoMedia **matched_media)
+{
+    return osinfo_db_guess_os_from_media_internal(db, media, matched_media);
+}
 
 static void fill_media (OsinfoMedia *media, OsinfoMedia *matched_media, OsinfoOs *os)
 {
@@ -588,7 +596,8 @@ gboolean osinfo_db_identify_media(OsinfoDb *db, OsinfoMedia *media)
     g_return_val_if_fail(OSINFO_IS_MEDIA(media), FALSE);
     g_return_val_if_fail(OSINFO_IS_DB(db), FALSE);
 
-    matched_os = osinfo_db_guess_os_from_media(db, media, &matched_media);
+    matched_os = osinfo_db_guess_os_from_media_internal(db, media,
+                                                        &matched_media);
     if (matched_os == NULL) {
         return FALSE;
     }
diff --git a/osinfo/osinfo_db.h b/osinfo/osinfo_db.h
index 09a58f0..bad3c6d 100644
--- a/osinfo/osinfo_db.h
+++ b/osinfo/osinfo_db.h
@@ -100,6 +100,7 @@ void osinfo_db_add_deployment(OsinfoDb *db, OsinfoDeployment *deployment);
 void osinfo_db_add_datamap(OsinfoDb *db, OsinfoDatamap *datamap);
 void osinfo_db_add_install_script(OsinfoDb *db, OsinfoInstallScript *script);
 
+G_DEPRECATED_FOR(osinfo_db_identify_media)
 OsinfoOs *osinfo_db_guess_os_from_media(OsinfoDb *db,
                                         OsinfoMedia *media,
                                         OsinfoMedia **matched_media);
-- 
1.8.0.1




More information about the virt-tools-list mailing list