X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fovsdb-idl.c;h=42c53b831c60e9044731af6dd4cdedb69ba46b38;hb=7feb4503e0cacb8db445ed51593046d92d046473;hp=ba58895af6e1e2ddff3698addf5c8f4670b7e541;hpb=1e86ae6f51bcc91d2fa36e4154bc6e540251eaf8;p=openvswitch diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c index ba58895a..42c53b83 100644 --- a/lib/ovsdb-idl.c +++ b/lib/ovsdb-idl.c @@ -914,13 +914,22 @@ ovsdb_idl_txn_create(struct ovsdb_idl *idl) return txn; } +/* Appends 's', which is treated as a printf()-type format string, to the + * comments that will be passed to the OVSDB server when 'txn' is committed. + * (The comment will be committed to the OVSDB log, which "ovsdb-tool + * show-log" can print in a relatively human-readable form.) */ void -ovsdb_idl_txn_add_comment(struct ovsdb_idl_txn *txn, const char *s) +ovsdb_idl_txn_add_comment(struct ovsdb_idl_txn *txn, const char *s, ...) { + va_list args; + if (txn->comment.length) { ds_put_char(&txn->comment, '\n'); } - ds_put_cstr(&txn->comment, s); + + va_start(args, s); + ds_put_format_valist(&txn->comment, s, args); + va_end(args); } void