X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fvconn.c;h=6ea93667a85fdd0e6abe17d61280b485cf554fc2;hb=84c5d450aaefb73b944506afe9f2fe05fa0612bf;hp=d6d2bf42e5291420445da00b8c7115f8d331c516;hpb=33af7dcad396cb9bfc7d09622d47be853bf662dd;p=openvswitch diff --git a/lib/vconn.c b/lib/vconn.c index d6d2bf42..6ea93667 100644 --- a/lib/vconn.c +++ b/lib/vconn.c @@ -283,7 +283,7 @@ vconn_open_block(const char *name, int min_version, struct vconn **vconnp) error = vconn_open(name, min_version, &vconn); if (!error) { - while ((error == vconn_connect(vconn)) == EAGAIN) { + while ((error = vconn_connect(vconn)) == EAGAIN) { vconn_run(vconn); vconn_run_wait(vconn); vconn_connect_wait(vconn); @@ -775,6 +775,31 @@ vconn_transact_noreply(struct vconn *vconn, struct ofpbuf *request, } } +/* vconn_transact_noreply() for a list of "struct ofpbuf"s, sent one by one. + * All of the requests on 'requests' are always destroyed, regardless of the + * return value. */ +int +vconn_transact_multiple_noreply(struct vconn *vconn, struct list *requests, + struct ofpbuf **replyp) +{ + struct ofpbuf *request, *next; + + LIST_FOR_EACH_SAFE (request, next, list_node, requests) { + int error; + + list_remove(&request->list_node); + + error = vconn_transact_noreply(vconn, request, replyp); + if (error || *replyp) { + ofpbuf_list_delete(requests); + return error; + } + } + + *replyp = NULL; + return 0; +} + void vconn_wait(struct vconn *vconn, enum vconn_wait_type wait) {