+static bool
+ovsdb_idl_txn_process_insert_reply(struct ovsdb_idl_txn_insert *insert,
+ const struct json_array *results)
+{
+ struct ovsdb_error *error;
+ struct json *json_uuid;
+ union ovsdb_atom uuid;
+ struct shash *reply;
+
+ if (insert->op_index >= results->n) {
+ VLOG_WARN_RL(&syntax_rl, "reply does not contain enough operations "
+ "for insert (has %u, needs %u)",
+ results->n, insert->op_index);
+ return false;
+ }
+
+ /* We know that this is a JSON object because the loop in
+ * ovsdb_idl_txn_process_reply() checked. */
+ reply = json_object(results->elems[insert->op_index]);
+ json_uuid = shash_find_data(reply, "uuid");
+ if (!check_json_type(json_uuid, JSON_ARRAY, "\"insert\" reply \"uuid\"")) {
+ return false;
+ }
+
+ error = ovsdb_atom_from_json(&uuid, OVSDB_TYPE_UUID, json_uuid, NULL);
+ if (error) {
+ char *s = ovsdb_error_to_string(error);
+ VLOG_WARN_RL(&syntax_rl, "\"insert\" reply \"uuid\" is not a JSON "
+ "UUID: %s", s);
+ free(s);
+ return false;
+ }
+
+ insert->real = uuid.uuid;
+
+ return true;
+}