qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 757a0d: nbd: publish _lookup functions


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 757a0d: nbd: publish _lookup functions
Date: Mon, 07 Jan 2019 06:11:23 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 757a0d05ea22d63e667db08a80b6ec6f1d53a12f
      
https://github.com/qemu/qemu/commit/757a0d05ea22d63e667db08a80b6ec6f1d53a12f
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2019-01-04 (Fri, 04 Jan 2019)

  Changed paths:
    M include/block/nbd.h
    M nbd/nbd-internal.h

  Log Message:
  -----------
  nbd: publish _lookup functions

These functions are used for formatting pretty trace points. We are
going to add some in block/nbd-client, so, let's publish all these
functions at once. Note, that nbd_reply_type_lookup is already
published, and constants, "named" by these functions live in
include/block/nbd.h too.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Eric Blake <address@hidden>


  Commit: bee21ef0950c8b109d3bad05a3c3f2d94ec1a3af
      
https://github.com/qemu/qemu/commit/bee21ef0950c8b109d3bad05a3c3f2d94ec1a3af
  Author: Eric Blake <address@hidden>
  Date:   2019-01-04 (Fri, 04 Jan 2019)

  Changed paths:
    M nbd/client.c
    M nbd/trace-events

  Log Message:
  -----------
  nbd/client: Trace all server option error messages

Not all servers send free-form text alongside option error replies, but
for servers that do (such as qemu), we pass the server's message as a
hint alongside our own error reporting.  However, it would also be
useful to trace such server messages, since we can't guarantee how the
hint may be consumed.

Signed-off-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>


  Commit: d8b4bad846f08ff0f167b46dc156a5310b750484
      
https://github.com/qemu/qemu/commit/d8b4bad846f08ff0f167b46dc156a5310b750484
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2019-01-04 (Fri, 04 Jan 2019)

  Changed paths:
    M block/nbd-client.c
    M block/trace-events
    M tests/qemu-iotests/083.out

  Log Message:
  -----------
  block/nbd-client: use traces instead of noisy error_report_err

Reduce extra noise of nbd-client, change 083 correspondingly.

In various commits (be41c100 in 2.10, f140e300 in 2.11, 78a33ab
in 2.12), we added spots where qemu as an NBD client would report
problems communicating with the server to stderr, because there
was no where else to send the error to.  However, this is racy,
particularly since the most common source of these errors is when
either the client or the server abruptly hangs up, leaving one
coroutine to report the error only if it wins (or loses) the
race in attempting the read from the server before another
thread completes its cleanup of a protocol error that caused the
disconnect in the first place.  The race is also apparent in the
fact that differences in the flush behavior of the server can
alter the frequency of encountering the race in the client (see
commit 6d39db96).

Rather than polluting stderr, it's better to just trace these
situations, for use by developers debugging a flaky connection,
particularly since the real error that either triggers the abrupt
disconnection in the first place, or that results from the EIO
when a request can't receive a reply, DOES make it back to the
user in the normal Error propagation channels.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Message-Id: <address@hidden>
[eblake: drop depedence on error hint, enhance commit message]
Signed-off-by: Eric Blake <address@hidden>


  Commit: 3ba1b7baf4b2518e8efdbe50175d909b79c21596
      
https://github.com/qemu/qemu/commit/3ba1b7baf4b2518e8efdbe50175d909b79c21596
  Author: Eric Blake <address@hidden>
  Date:   2019-01-04 (Fri, 04 Jan 2019)

  Changed paths:
    M qemu-nbd.c
    M tests/qemu-iotests/233.out

  Log Message:
  -----------
  qemu-nbd: Use program name in error messages

This changes output from:

$ qemu-nbd nosuch
Failed to blk_new_open 'nosuch': Could not open 'nosuch': No such file or 
directory

to something more consistent with qemu-img and qemu:

$ qemu-nbd nosuch
qemu-nbd: Failed to blk_new_open 'nosuch': Could not open 'nosuch': No such 
file or directory

Update the lone affected test to match.  (Hmm - is it sad that we don't
do much testing of expected failures?)

Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: Richard W.M. Jones <address@hidden>
Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Message-Id: <address@hidden>


  Commit: ba2d3b3ab217784822e4232f0acd71fc523d571f
      
https://github.com/qemu/qemu/commit/ba2d3b3ab217784822e4232f0acd71fc523d571f
  Author: Eric Blake <address@hidden>
  Date:   2019-01-04 (Fri, 04 Jan 2019)

  Changed paths:
    M docs/interop/nbd.txt

  Log Message:
  -----------
  nbd: Document timeline of various features

It can be useful to figure out which NBD protocol features are
exposed by a server, as well as what features a client will
take advantage of if available, for a given qemu release.  It's
not always precise to base features on version numbers (thanks
to downstream backports), but any documentation is better than
making users search through git logs themselves.

This patch originally stemmed from a request to document that
pristine 3.0 has a known bug where NBD_OPT_LIST_META_CONTEXT
with 0 queries forgot to advertise an available
"qemu:dirty-bitmap" context, but documenting bugs like this (or
the fact that 3.0 also botched NBD_CMD_CACHE) gets to be too
much details, especially since buggy releases will be less
likely connection targets over time.  Instead, I chose to just
remind users to check stable release branches.

Suggested-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Signed-off-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Richard W.M. Jones <address@hidden>
Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>


  Commit: 6c5c035138218a384a229e7b6b9cf51451621c6a
      
https://github.com/qemu/qemu/commit/6c5c035138218a384a229e7b6b9cf51451621c6a
  Author: Eric Blake <address@hidden>
  Date:   2019-01-05 (Sat, 05 Jan 2019)

  Changed paths:
    M nbd/client.c

  Log Message:
  -----------
  nbd/client: More consistent error messages

Consolidate on using decimal (not hex), on outputting the
option reply name (not just value), and a consistent comma between
clauses, when the client reports protocol discrepancies from the
server.  While it won't affect normal operation, it makes
debugging additions easier.

Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: Richard W.M. Jones <address@hidden>
Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Message-Id: <address@hidden>


  Commit: 3c1fa35d74aabe9c3ab642d2591b087e53d7a616
      
https://github.com/qemu/qemu/commit/3c1fa35d74aabe9c3ab642d2591b087e53d7a616
  Author: Eric Blake <address@hidden>
  Date:   2019-01-05 (Sat, 05 Jan 2019)

  Changed paths:
    M nbd/client.c
    M qemu-nbd.c

  Log Message:
  -----------
  qemu-nbd: Fail earlier for -c/-d on non-linux

Connecting to a /dev/nbdN device is a Linux-specific action.
We were already masking -c and -d from 'qemu-nbd --help' on
non-linux.  However, while -d fails with a sensible error
message, it took hunting through a couple of files to prove
that.  What's more, the code for -c doesn't fail until after
it has created a pthread and tried to open a device - possibly
even printing an error message with %m on a non-Linux platform
in spite of the comment that %m is glibc-specific.  Make the
failure happen sooner, then get rid of stubs that are no
longer needed because of the early exits.

While at it: tweak the blank newlines in --help output to be
consistent, whether or not built on Linux.

Signed-off-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Richard W.M. Jones <address@hidden>
Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>


  Commit: ef2e35fcc8e14bcc9366df5fdf53f65d679f8dca
      
https://github.com/qemu/qemu/commit/ef2e35fcc8e14bcc9366df5fdf53f65d679f8dca
  Author: Eric Blake <address@hidden>
  Date:   2019-01-05 (Sat, 05 Jan 2019)

  Changed paths:
    M nbd/client.c
    M nbd/nbd-internal.h

  Log Message:
  -----------
  nbd/client: Drop pointless buf variable

There's no need to read into a temporary buffer (oversized
since commit 7d3123e1) followed by a byteswap into a uint64_t
to check for a magic number via memcmp(), when the code
immediately below demonstrates reading into the uint64_t then
byteswapping in place and checking for a magic number via
integer math.  What's more, having a different error message
when the server's first reply byte is 0 is unusual - it's no
different from any other wrong magic number, and we already
detected short reads. That whole strlen() issue has been
present and useless since commit 1d45f8b5 in 2010; perhaps it
was leftover debugging (since the correct magic number happens
to be ASCII)?  Make the error messages more consistent and
detailed while touching things.

Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: Richard W.M. Jones <address@hidden>
Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Message-Id: <address@hidden>


  Commit: a29644590f95166c8a13e5797f8e7701134b31d0
      
https://github.com/qemu/qemu/commit/a29644590f95166c8a13e5797f8e7701134b31d0
  Author: Peter Maydell <address@hidden>
  Date:   2019-01-07 (Mon, 07 Jan 2019)

  Changed paths:
    M block/nbd-client.c
    M block/trace-events
    M docs/interop/nbd.txt
    M include/block/nbd.h
    M nbd/client.c
    M nbd/nbd-internal.h
    M nbd/trace-events
    M qemu-nbd.c
    M tests/qemu-iotests/083.out
    M tests/qemu-iotests/233.out

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2019-01-05' into 
staging

nbd patches for 2019-01-05

Error and trace improvements in NBD code, such as less noise for
common disconnect scenarios.

- Vladimir Sementsov-Ogievskiy: 0/3 nbd-client: drop extra error noise
- Eric Blake: portions of 0/22 nbd: add qemu-nbd --list

# gpg: Signature made Sat 05 Jan 2019 13:58:54 GMT
# gpg:                using RSA key A7A16B4A2527436A
# gpg: Good signature from "Eric Blake <address@hidden>"
# gpg:                 aka "Eric Blake (Free Software Programmer) 
<address@hidden>"
# gpg:                 aka "[jpeg image of size 6874]"
# Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A

* remotes/ericb/tags/pull-nbd-2019-01-05:
  nbd/client: Drop pointless buf variable
  qemu-nbd: Fail earlier for -c/-d on non-linux
  nbd/client: More consistent error messages
  nbd: Document timeline of various features
  qemu-nbd: Use program name in error messages
  block/nbd-client: use traces instead of noisy error_report_err
  nbd/client: Trace all server option error messages
  nbd: publish _lookup functions

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/e59dbbac0364...a29644590f95
      **NOTE:** This service has been marked for deprecation: 
https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]