qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] e7a78d: nbd: Include error names in trace mes


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] e7a78d: nbd: Include error names in trace messages
Date: Tue, 31 Oct 2017 07:21:53 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: e7a78d0eff820b56d33be31af1bb49e2948374fd
      
https://github.com/qemu/qemu/commit/e7a78d0eff820b56d33be31af1bb49e2948374fd
  Author: Eric Blake <address@hidden>
  Date:   2017-10-30 (Mon, 30 Oct 2017)

  Changed paths:
    M nbd/client.c
    M nbd/common.c
    M nbd/nbd-internal.h
    M nbd/server.c
    M nbd/trace-events

  Log Message:
  -----------
  nbd: Include error names in trace messages

NBD errors were originally sent over the wire based on Linux errno
values; but not all the world is Linux, and not all platforms share
the same values.  Since a number isn't very easy to decipher on all
platforms, update the trace messages to include the name of NBD
errors being sent/received over the wire.  Tweak the trace messages
to be at the point where we are using the NBD error, not the
translation to the host errno values.

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


  Commit: dd6894404947d39a724ea265389fe0f2d6d5ecb7
      
https://github.com/qemu/qemu/commit/dd6894404947d39a724ea265389fe0f2d6d5ecb7
  Author: Eric Blake <address@hidden>
  Date:   2017-10-30 (Mon, 30 Oct 2017)

  Changed paths:
    M include/block/nbd.h
    M nbd/client.c
    M nbd/common.c
    M nbd/nbd-internal.h
    M nbd/trace-events

  Log Message:
  -----------
  nbd: Move nbd_errno_to_system_errno() to public header

This is needed in preparation for structured reply handling,
as we will be performing the translation from NBD error to
system errno value higher in the stack at block/nbd-client.c.

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


  Commit: bae245d19a7fae77410cb8b09350b672df689a66
      
https://github.com/qemu/qemu/commit/bae245d19a7fae77410cb8b09350b672df689a66
  Author: Eric Blake <address@hidden>
  Date:   2017-10-30 (Mon, 30 Oct 2017)

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

  Log Message:
  -----------
  nbd: Expose constants and structs for structured read

Upcoming patches will implement the NBD structured reply
extension [1] for both client and server roles.  Declare the
constants, structs, and lookup routines that will be valuable
whether the server or client code is backported in isolation.

This includes moving one constant from an internal header to
the public header, as part of the structured read processing
will be done in block/nbd-client.c rather than nbd/client.c.

[1]https://github.com/NetworkBlockDevice/nbd/blob/extension-structured-reply/doc/proto.md

Based on patches from Vladimir Sementsov-Ogievskiy.

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


  Commit: 8fb48b8b38a895cbb17a601829603365c4938f60
      
https://github.com/qemu/qemu/commit/8fb48b8b38a895cbb17a601829603365c4938f60
  Author: Eric Blake <address@hidden>
  Date:   2017-10-30 (Mon, 30 Oct 2017)

  Changed paths:
    M nbd/server.c

  Log Message:
  -----------
  nbd/server: Report error for write to read-only export

When the server is read-only, we were already reporting an error
message for NBD_CMD_WRITE_ZEROES, but failed to set errp for a
similar NBD_CMD_WRITE.  This will matter more once structured
replies allow the server to propagate the errp information back
to the client.  While at it, use an error message that makes a
bit more sense if viewed on the client side.

Note that when using qemu-io to test qemu-nbd behavior, it is
rather difficult to convince qemu-io to send protocol violations
(such as a read beyond bounds), because we have a lot of active
checking on the client side that a qemu-io request makes sense
before it ever goes over the wire to the server.  The case of a
client attempting a write when the server is started as
'qemu-nbd -r' is one of the few places where we can easily test
error path handling, without having to resort to hacking in known
temporary bugs to either the server or client.  [Maybe we want a
future patch to the client to do up-front checking on writes to a
read-only export, the way it does up-front bounds checking; but I
don't see anything in the NBD spec that points to a protocol
violation in our current behavior.]

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


  Commit: 8cbee49ed7348e9b2b708d75c8ff8941032cb488
      
https://github.com/qemu/qemu/commit/8cbee49ed7348e9b2b708d75c8ff8941032cb488
  Author: Eric Blake <address@hidden>
  Date:   2017-10-30 (Mon, 30 Oct 2017)

  Changed paths:
    M nbd/server.c

  Log Message:
  -----------
  nbd/server: Simplify nbd_negotiate_options loop

Instead of making each caller check whether a transmission error
occurred, we can sink a common error check to the end of the loop.

Signed-off-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
[eblake: squash in compiler warning fix]
Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>


  Commit: e68c35cfb8088a11300371751e3987f67cac15b1
      
https://github.com/qemu/qemu/commit/e68c35cfb8088a11300371751e3987f67cac15b1
  Author: Eric Blake <address@hidden>
  Date:   2017-10-30 (Mon, 30 Oct 2017)

  Changed paths:
    M nbd/server.c

  Log Message:
  -----------
  nbd/server: Refactor zero-length option check

Consolidate the response for a non-zero-length option payload
into a new function, nbd_reject_length().  This check will
also be used when introducing support for structured replies.

Note that STARTTLS response differs based on time: if the connection
is still unencrypted, we set fatal to true (a client that can't
request TLS correctly may still think that we are ready to start
the TLS handshake, so we must disconnect); while if the connection
is already encrypted, the client is sending a bogus request but
is no longer at risk of being confused by continuing the connection.

Signed-off-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
[eblake: correct return value on STARTTLS]
Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>


  Commit: 5c54e7fa714fdee68ede764610adda806162080f
      
https://github.com/qemu/qemu/commit/5c54e7fa714fdee68ede764610adda806162080f
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-10-30 (Mon, 30 Oct 2017)

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

  Log Message:
  -----------
  nbd: Minimal structured read for server

Minimal implementation of structured read: one structured reply chunk,
no segmentation.
Minimal structured error implementation: no text message.
Support DF flag, but just ignore it, as there is no segmentation any
way.

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


  Commit: a57f6dea02cdcf7733786f15bab6665ecfc1033b
      
https://github.com/qemu/qemu/commit/a57f6dea02cdcf7733786f15bab6665ecfc1033b
  Author: Eric Blake <address@hidden>
  Date:   2017-10-30 (Mon, 30 Oct 2017)

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

  Log Message:
  -----------
  nbd/server: Include human-readable message in structured errors

The NBD spec permits including a human-readable error string if
structured replies are in force, so we might as well send the
client the message that we logged on any error.

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


  Commit: d795299bf497a6155f6cecff83a5e41bb37aba2c
      
https://github.com/qemu/qemu/commit/d795299bf497a6155f6cecff83a5e41bb37aba2c
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-10-30 (Mon, 30 Oct 2017)

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

  Log Message:
  -----------
  nbd/client: refactor nbd_receive_starttls

Split out nbd_request_simple_option to be reused for structured reply
option.

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


  Commit: d2febedb45729d1fe431ca7c1ed9519acfb454c4
      
https://github.com/qemu/qemu/commit/d2febedb45729d1fe431ca7c1ed9519acfb454c4
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-10-30 (Mon, 30 Oct 2017)

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

  Log Message:
  -----------
  nbd/client: prepare nbd_receive_reply for structured reply

In following patch nbd_receive_reply will be used both for simple
and structured reply header receiving.
NBDReply is altered into union of simple reply header and structured
reply chunk header, simple error translation moved to block/nbd-client
to be consistent with further structured reply error translation.

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


  Commit: 56dc682bf5e3a64b64a658c0aeec37570719c929
      
https://github.com/qemu/qemu/commit/56dc682bf5e3a64b64a658c0aeec37570719c929
  Author: Eric Blake <address@hidden>
  Date:   2017-10-30 (Mon, 30 Oct 2017)

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

  Log Message:
  -----------
  nbd: Move nbd_read() to common header

An upcoming change to block/nbd-client.c will want to read the
tail of a structured reply chunk directly from the wire.  Move
this function to make it easier.

Based on a patch from Vladimir Sementsov-Ogievskiy.

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


  Commit: f140e3000371e67ff4e00df3213e2d576d9c91be
      
https://github.com/qemu/qemu/commit/f140e3000371e67ff4e00df3213e2d576d9c91be
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2017-10-30 (Mon, 30 Oct 2017)

  Changed paths:
    M block/nbd-client.c
    M block/nbd-client.h
    M include/block/nbd.h
    M nbd/client.c
    M nbd/nbd-internal.h
    M tests/qemu-iotests/083.out

  Log Message:
  -----------
  nbd: Minimal structured read for client

Minimal implementation: for structured error only error_report error
message.

Note that test 83 is now more verbose, because the implementation
prints more warnings about unexpected communication errors; perhaps
future patches should tone things down by using trace messages
instead of traces, but the common case of successful communication
is no noisier than before.

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


  Commit: 92c7ec5cd4d15c76218703f7bd3ca75bd46353b7
      
https://github.com/qemu/qemu/commit/92c7ec5cd4d15c76218703f7bd3ca75bd46353b7
  Author: Peter Maydell <address@hidden>
  Date:   2017-10-31 (Tue, 31 Oct 2017)

  Changed paths:
    M block/nbd-client.c
    M block/nbd-client.h
    M include/block/nbd.h
    M nbd/client.c
    M nbd/common.c
    M nbd/nbd-internal.h
    M nbd/server.c
    M nbd/trace-events
    M tests/qemu-iotests/083.out

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2017-10-30' into 
staging

nbd patches for 2017-10-30

Vladimir Sementsov-Ogievskiy (some patches co-authored by Eric Blake):
00/12 nbd minimal structured read

# gpg: Signature made Mon 30 Oct 2017 20:54:54 GMT
# gpg:                using RSA key 0xA7A16B4A2527436A
# 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-2017-10-30:
  nbd: Minimal structured read for client
  nbd: Move nbd_read() to common header
  nbd/client: prepare nbd_receive_reply for structured reply
  nbd/client: refactor nbd_receive_starttls
  nbd/server: Include human-readable message in structured errors
  nbd: Minimal structured read for server
  nbd/server: Refactor zero-length option check
  nbd/server: Simplify nbd_negotiate_options loop
  nbd/server: Report error for write to read-only export
  nbd: Expose constants and structs for structured read
  nbd: Move nbd_errno_to_system_errno() to public header
  nbd: Include error names in trace messages

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


Compare: https://github.com/qemu/qemu/compare/d2b9d7143268...92c7ec5cd4d1

reply via email to

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