On Fri, Oct 15, 2021 at 10:12:26AM -0500, Eric Blake wrote:
On Fri, Oct 15, 2021 at 03:17:16PM +0100, Richard W.M. Jones wrote:
+static void * +retry_request_open (nbdkit_next_open *next, nbdkit_context *nxdata, + int readonly, const char *exportname, int is_tls) +{ + int r; + + if (retry_open_call) { + int *err = &errno; /* used by the RETRY* macros */ + + RETRY_START + r = next (nxdata, readonly, exportname); + RETRY_END;
Most other calls into the plugin are obviously safe, but there are lots of asserts around calls into nbdkit_next_open obeying expectations - if you didn't trip any when .open happened to hit the bad mirror out of the round robin, then I think we're okay here on life-cycle.
I was apprehensive about this one too, but it seems to work. See proposed test & output attached. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top