return NULL;
}
-static const struct ovsdb_idl_table_class *
-pre_get_table(struct ctl_context *ctx, const char *table_name)
+static char * OVS_WARN_UNUSED_RESULT
+pre_get_table(struct ctl_context *ctx, const char *table_name,
+ const struct ovsdb_idl_table_class **tablep)
{
const struct ovsdb_idl_table_class *table;
- die_if_error(get_table(table_name, &table));
+ char *error = get_table(table_name, &table);
+ if (error) {
+ return error;
+ }
ovsdb_idl_add_table(ctx->idl, table);
const struct ctl_table_class *ctl = &ctl_classes[table - idl_classes];
}
}
- return table;
+ if (tablep) {
+ *tablep = table;
+ }
+ return NULL;
}
static char *
"possibly erroneous");
}
- table = pre_get_table(ctx, table_name);
+ die_if_error(pre_get_table(ctx, table_name, &table));
for (i = 3; i < ctx->argc; i++) {
if (!strcasecmp(ctx->argv[i], "_uuid")
|| !strcasecmp(ctx->argv[i], "-uuid")) {
const char *table_name = ctx->argv[1];
const struct ovsdb_idl_table_class *table;
- table = pre_get_table(ctx, table_name);
+ die_if_error(pre_get_table(ctx, table_name, &table));
pre_list_columns(ctx, table, column_names);
}
const struct ovsdb_idl_table_class *table;
int i;
- table = pre_get_table(ctx, table_name);
+ die_if_error(pre_get_table(ctx, table_name, &table));
pre_list_columns(ctx, table, column_names);
for (i = 2; i < ctx->argc; i++) {
pre_parse_column_key_value(ctx, ctx->argv[i], table);
const struct ovsdb_idl_table_class *table;
int i;
- table = pre_get_table(ctx, table_name);
+ die_if_error(pre_get_table(ctx, table_name, &table));
for (i = 3; i < ctx->argc; i++) {
pre_parse_column_key_value(ctx, ctx->argv[i], table);
}
const struct ovsdb_idl_table_class *table;
const struct ovsdb_idl_column *column;
- table = pre_get_table(ctx, table_name);
+ die_if_error(pre_get_table(ctx, table_name, &table));
die_if_error(pre_get_column(ctx, table, column_name, &column));
}
const struct ovsdb_idl_table_class *table;
const struct ovsdb_idl_column *column;
- table = pre_get_table(ctx, table_name);
+ die_if_error(pre_get_table(ctx, table_name, &table));
die_if_error(pre_get_column(ctx, table, column_name, &column));
}
const struct ovsdb_idl_table_class *table;
int i;
- table = pre_get_table(ctx, table_name);
+ die_if_error(pre_get_table(ctx, table_name, &table));
for (i = 3; i < ctx->argc; i++) {
const struct ovsdb_idl_column *column;
{
const char *table_name = ctx->argv[1];
- pre_get_table(ctx, table_name);
+ die_if_error(pre_get_table(ctx, table_name, NULL));
}
static void
const struct ovsdb_idl_table_class *table;
int i;
- table = pre_get_table(ctx, table_name);
+ die_if_error(pre_get_table(ctx, table_name, &table));
for (i = 3; i < ctx->argc; i++) {
pre_parse_column_key_value(ctx, ctx->argv[i], table);