>From Vadim Yanitskiy <axilirator(a)gmail.com>:
Vadim Yanitskiy has uploaded a new change for review.
https://gerrit.osmocom.org/62
Change subject: db.c: implemented incremental migration
......................................................................
db.c: implemented incremental migration
In the past, normal migration was possible only if the actual
schema version differed from the version used in DB by 1. For
example, if DB uses an old version 3 and you need to use it
with the code written for version 5, the check_db_revision()
will convert it to 4 and DB will still use incompatible schema
version during Osmo-NITB running time. After next run it will
be converted to version 5.
This patch replaces a set of 'else-if' checks by a 'switch'
without 'break' statements between 'case' labels (waterfall).
It makes you able to migrate from current version to the
latest despite any difference between them.
Change-Id: Ia9c2aa86f96b88ad8a710d0a23879ce219bc82dc
---
M openbsc/src/libmsc/db.c
1 file changed, 35 insertions(+), 18 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/62/62/1
diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c
index e5017ae..b3235bb 100644
--- a/openbsc/src/libmsc/db.c
+++ b/openbsc/src/libmsc/db.c
@@ -374,9 +374,13 @@
{
dbi_result result;
const char *rev_s;
+ int db_rev = 0;
+ /* Make a query */
result = dbi_conn_query(conn,
- "SELECT value FROM Meta WHERE key='revision'");
+ "SELECT value FROM Meta "
+ "WHERE key = 'revision'");
+
if (!result)
return -EINVAL;
@@ -384,33 +388,46 @@
dbi_result_free(result);
return -EINVAL;
}
+
+ /* Fetch the DB schema revision */
rev_s = dbi_result_get_string(result, "value");
if (!rev_s) {
dbi_result_free(result);
return -EINVAL;
}
- if (!strcmp(rev_s, "2")) {
- if (update_db_revision_2()) {
- LOGP(DDB, LOGL_FATAL, "Failed to update database from schema revision '%s'.\n", rev_s);
- dbi_result_free(result);
- return -EINVAL;
- }
- } else if (!strcmp(rev_s, "3")) {
- if (update_db_revision_3()) {
- LOGP(DDB, LOGL_FATAL, "Failed to update database from schema revision '%s'.\n", rev_s);
- dbi_result_free(result);
- return -EINVAL;
- }
- } else if (!strcmp(rev_s, SCHEMA_REVISION)) {
- /* everything is fine */
- } else {
- LOGP(DDB, LOGL_FATAL, "Invalid database schema revision '%s'.\n", rev_s);
+
+ if (!strcmp(rev_s, SCHEMA_REVISION)) {
+ /* Everything is fine */
dbi_result_free(result);
+ return 0;
+ }
+
+ db_rev = atoi(rev_s);
+ dbi_result_free(result);
+
+ /* Incremental migration waterfall */
+ switch (db_rev) {
+ case 2:
+ if (update_db_revision_2())
+ goto error;
+ case 3:
+ if (update_db_revision_3())
+ goto error;
+
+ /* The end of waterfall */
+ break;
+ default:
+ LOGP(DDB, LOGL_FATAL,
+ "Invalid database schema revision '%d'.\n", db_rev);
return -EINVAL;
}
- dbi_result_free(result);
return 0;
+
+error:
+ LOGP(DDB, LOGL_FATAL, "Failed to update database "
+ "from schema revision '%d'.\n", db_rev);
+ return -EINVAL;
}
static int db_configure(void)
--
To view, visit https://gerrit.osmocom.org/62
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia9c2aa86f96b88ad8a710d0a23879ce219bc82dc
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilirator(a)gmail.com>
>From Holger Freyther <holger(a)freyther.de>:
Holger Freyther has uploaded a new change for review.
https://gerrit.osmocom.org/64
Change subject: misc: Drop oRTP dependency as there is nothing using it
......................................................................
misc: Drop oRTP dependency as there is nothing using it
This seems to be a copy of paste of libsomo-abis. Let us just drop
it here and be done with it.
Change-Id: Ia5cb2b572fb5597605284d1c3f657d548aa790f2
---
M configure.ac
M debian/control
2 files changed, 1 insertion(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/64/64/1
diff --git a/configure.ac b/configure.ac
index 19f7d18..64a7a1e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,7 +39,6 @@
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.0)
dnl FIXME: We depend on libosmoabis by now until we can move LAPD code here
PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.0.7)
-PKG_CHECK_MODULES(ORTP, ortp >= 0.15.0)
old_LIBS=$LIBS
AC_SEARCH_LIBS([sctp_send], [sctp], [
diff --git a/debian/control b/debian/control
index c5bcb43..3953414 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@
Section: libs
Priority: optional
Maintainer: Holger Hans Peter Freyther <holger(a)moiji-mobile.com>
-Build-Depends: debhelper (>= 9), autotools-dev, autoconf, automake, libtool, dh-autoreconf, libdpkg-perl, git, libosmocore-dev, libosmo-abis-dev, pkg-config, libortp-dev, libsctp-dev
+Build-Depends: debhelper (>= 9), autotools-dev, autoconf, automake, libtool, dh-autoreconf, libdpkg-perl, git, libosmocore-dev, libosmo-abis-dev, pkg-config, libsctp-dev
Standards-Version: 3.9.6
Vcs-Git: git://git.osmocom.org/libosmo-netif.git
Vcs-Browser: http://git.osmocom.org/gitweb?p=libosmo-netif.git;a=summary
--
To view, visit https://gerrit.osmocom.org/64
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia5cb2b572fb5597605284d1c3f657d548aa790f2
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther <holger(a)freyther.de>
>From Holger Freyther <holger(a)freyther.de>:
Holger Freyther has submitted this change and it was merged.
Change subject: todo: Add another of my wishlist items
......................................................................
todo: Add another of my wishlist items
Change-Id: I5a6c473a97d04aecae8101a024edb734bbe24401
Reviewed-on: https://gerrit.osmocom.org/27
Tested-by: Jenkins Builder
Reviewed-by: Harald Welte <laforge(a)gnumonks.org>
---
M TODO
1 file changed, 2 insertions(+), 0 deletions(-)
Approvals:
Harald Welte: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/TODO b/TODO
index 6e39bc9..83f81ae 100644
--- a/TODO
+++ b/TODO
@@ -19,4 +19,6 @@
* Make the max size and rotate file configurable
+* Add a streaming option so one can pipe each packet into tshark
+ or a similar utility.
--
To view, visit https://gerrit.osmocom.org/27
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I5a6c473a97d04aecae8101a024edb734bbe24401
Gerrit-PatchSet: 2
Gerrit-Project: osmo-pcap
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther <holger(a)freyther.de>
Gerrit-Reviewer: Harald Welte <laforge(a)gnumonks.org>
Gerrit-Reviewer: Holger Freyther <holger(a)freyther.de>
Gerrit-Reviewer: Jenkins Builder