+
+ if (key != SR_CONF_SCAN_OPTIONS && key != SR_CONF_DEVICE_OPTIONS && !sdi) {
+ sr_err("Config keys other than SR_CONF_SCAN_OPTIONS and "
+ "SR_CONF_DEVICE_OPTIONS always need an sdi.");
+ return SR_ERR_ARG;
+ }
+
+ if (cg && sdi && !sdi->channel_groups) {
+ sr_err("Can't list config for channel group, there are none.");
+ return SR_ERR_ARG;
+ }
+
+ if (cg && sdi && !g_slist_find(sdi->channel_groups, cg)) {
+ sr_err("If a channel group is specified, it must be a valid one.");
+ return SR_ERR_ARG;
+ }
+
+ if (cg && !sdi) {
+ sr_err("Need sdi when a channel group is specified.");
+ return SR_ERR_ARG;
+ }
+