Message ID | 20170811023759.26390-3-eblake@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/nbd/server.c b/nbd/server.c index 82a78bf439..d6fbd46370 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -919,6 +919,17 @@ static int nbd_send_reply(QIOChannel *ioc, NBDReply *reply, Error **errp) stl_be_p(buf + 4, reply->error); stq_be_p(buf + 8, reply->handle); + static int debug; + static int count; + if (!count++) { + const char *str = getenv("NBD_SERVER_DEBUG"); + if (str) { + debug = atoi(str); + } + } + if (debug && !(count % debug)) { + buf[0] = 0; + } return nbd_write(ioc, buf, sizeof(buf), errp); }