+}
+
+struct rmblob_data {
+ struct para_buffer pb;
+ unsigned num_removed;
+};
+
+static int remove_blob(struct osl_table *table, struct osl_row *row,
+ const char *name, void *data)
+{
+ struct rmblob_data *rmbd = data;
+ int ret = osl_del_row(table, row);
+ if (ret < 0) {
+ para_printf(&rmbd->pb, "%s: %s\n", name, PARA_STRERROR(-ret));
+ return ret;
+ }
+ rmbd->num_removed++;
+ return 1; /* return success to remove other matching blobs. */
+}
+
+static int com_rmblob_callback(struct osl_table *table,
+ const struct osl_object *query,
+ __a_unused struct osl_object *result)
+{
+ int ret;
+ struct rmblob_data rmbd = {.num_removed = 0};
+ struct pattern_match_data pmd = {
+ .table = table,
+ .patterns = *query,
+ .loop_col_num = BLOBCOL_NAME,
+ .match_col_num = BLOBCOL_NAME,
+ .pm_flags = PM_SKIP_EMPTY_NAME,
+ .data = &rmbd,
+ .action = remove_blob
+ };
+ result->data = NULL;
+ ret = for_each_matching_row(&pmd);
+ if (ret < 0)
+ para_printf(&rmbd.pb, "%s\n", PARA_STRERROR(-ret));
+ if (!rmbd.num_removed)
+ para_printf(&rmbd.pb, "no matches, nothing removed\n");
+ else
+ para_printf(&rmbd.pb, "removed %d blobs\n", rmbd.num_removed);
+ result->data = rmbd.pb.buf;
+ result->size = rmbd.pb.size;
+ return 1;
+}
+
+static int com_rmblob(callback_function *f, __a_unused int fd, int argc,
+ char * const * const argv)
+{
+ int ret;
+ struct osl_object result;