X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ovsdb%2Fovsdb-tool.c;h=1c9e9206a154afb130e976c0fa6e10c71b7d4d60;hb=169e3808f7c510a048589d8e658336919079a6a0;hp=b2e200cbb8df38614e7b91208ee1112cb01ecbc0;hpb=aebfc8693746682c6c2c02b6cc4d0c580fab0039;p=openvswitch diff --git a/ovsdb/ovsdb-tool.c b/ovsdb/ovsdb-tool.c index b2e200cb..1c9e9206 100644 --- a/ovsdb/ovsdb-tool.c +++ b/ovsdb/ovsdb-tool.c @@ -207,7 +207,7 @@ compact_or_convert(const char *src_name, const char *dst_name, /* Save a copy. */ check_ovsdb_error(new_schema ? ovsdb_file_open_as_schema(src_name, new_schema, &db) - : ovsdb_file_open(src_name, true, &db)); + : ovsdb_file_open(src_name, true, &db, NULL)); check_ovsdb_error(ovsdb_file_save_copy(dst_name, false, comment, db)); ovsdb_destroy(db); @@ -248,7 +248,7 @@ transact(bool read_only, const char *db_file_name, const char *transaction) struct json *request, *result; struct ovsdb *db; - check_ovsdb_error(ovsdb_file_open(db_file_name, read_only, &db)); + check_ovsdb_error(ovsdb_file_open(db_file_name, read_only, &db, NULL)); request = parse_json(transaction); result = ovsdb_execute(db, request, 0, NULL); @@ -337,8 +337,13 @@ print_db_changes(struct shash *tables, struct shash *names) : xmemdup0(row_uuid, 8))); } } else if (columns->type == JSON_NULL) { + struct shash_node *node; + printf("\t\tdelete row\n"); - shash_delete(names, shash_find(names, row_uuid)); + node = shash_find(names, row_uuid); + if (node) { + shash_delete(names, node); + } free(old_name); }