On 7/30/19 12:19 PM, Richard W.M. Jones wrote:
--- configure.ac | 4 ++-- plugins/nbd/nbd.c | 12 +++++++++--- README | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-)
+++ b/plugins/nbd/nbd.c @@ -57,6 +57,7 @@
/* The per-transaction details */ struct transaction { + int64_t cookie;
Reinstating this, but only for...
sem_t sem; uint32_t early_err; uint32_t err; @@ -353,15 +354,19 @@ nbdplug_prepare (struct transaction *trans) }
static int -nbdplug_notify (unsigned valid_flag, void *opaque, int64_t cookie, int *error) +nbdplug_notify (unsigned valid_flag, void *opaque, int *error) { struct transaction *trans = opaque;
if (!(valid_flag & LIBNBD_CALLBACK_VALID)) return 0;
+ /* There's a possible race here where trans->cookie has not yet been + * updated by nbdplug_register, but it's only an informational + * message. + */ nbdkit_debug ("cookie %" PRId64 " completed state machine, status %d", - cookie, *error); + trans->cookie, *error);
...debug purposes. It doesn't have to exist for actual behavior, but we may find the debug messages worthwhile down the road, so the change makes sense. ACK; changes are correct. And hopefully we don't have very many more API/ABI changes to deal with. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org