qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] a16a79: nbd/server: Hoist nbd_reject_length()


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] a16a79: nbd/server: Hoist nbd_reject_length() earlier
Date: Thu, 18 Jan 2018 08:48:59 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: a16a7907707e08c09843297a6f707f5bfb8beb22
      
https://github.com/qemu/qemu/commit/a16a7907707e08c09843297a6f707f5bfb8beb22
  Author: Eric Blake <address@hidden>
  Date:   2018-01-17 (Wed, 17 Jan 2018)

  Changed paths:
    M nbd/server.c

  Log Message:
  -----------
  nbd/server: Hoist nbd_reject_length() earlier

No semantic change, but will make it easier for an upcoming patch
to refactor code without having to add forward declarations.  Fix
a poor comment while at it.

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


  Commit: 0cfae925d2e31a7d7613a6fb60aa58b38ec2b61e
      
https://github.com/qemu/qemu/commit/0cfae925d2e31a7d7613a6fb60aa58b38ec2b61e
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2018-01-17 (Wed, 17 Jan 2018)

  Changed paths:
    M nbd/server.c

  Log Message:
  -----------
  nbd/server: refactor negotiation functions parameters

Instead of passing currently negotiating option and its length to
many of negotiation functions let's just store them on NBDClient
struct to be state-variables of negotiation phase.

This unifies semantics of negotiation functions and allows
tracking changes of remaining option length in future patches.

Asssert that optlen is back to 0 after negotiation (including
old-style connections which don't negotiate), although we need
more patches before we can assert optlen is 0 between options
during negotiation.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
[eblake: rebase, commit message tweak, assert !optlen after
negotiation completes]
Signed-off-by: Eric Blake <address@hidden>


  Commit: 32f158a63509656f95922ce28d1b4a4e06a2cbf2
      
https://github.com/qemu/qemu/commit/32f158a63509656f95922ce28d1b4a4e06a2cbf2
  Author: Eric Blake <address@hidden>
  Date:   2018-01-17 (Wed, 17 Jan 2018)

  Changed paths:
    M nbd/server.c

  Log Message:
  -----------
  nbd/server: Better error for NBD_OPT_EXPORT_NAME failure

When a client abruptly disconnects before we've finished reading
the name sent with NBD_OPT_EXPORT_NAME, we are better off logging
the failure as EIO (we can't communicate with the client), rather
than EINVAL (the client sent bogus data).

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


  Commit: 41f5dfafbb158d2bed0b6abcb7d16b77c56ea5a1
      
https://github.com/qemu/qemu/commit/41f5dfafbb158d2bed0b6abcb7d16b77c56ea5a1
  Author: Eric Blake <address@hidden>
  Date:   2018-01-17 (Wed, 17 Jan 2018)

  Changed paths:
    M nbd/server.c

  Log Message:
  -----------
  nbd/server: Add va_list form of nbd_negotiate_send_rep_err()

This will be useful for the next patch.

Based on a patch by Vladimir Sementsov-Ogievskiy

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


  Commit: 894e02804c862c6940b43a0a488164655d3fb3f0
      
https://github.com/qemu/qemu/commit/894e02804c862c6940b43a0a488164655d3fb3f0
  Author: Eric Blake <address@hidden>
  Date:   2018-01-17 (Wed, 17 Jan 2018)

  Changed paths:
    M nbd/server.c

  Log Message:
  -----------
  nbd/server: Add helper functions for parsing option payload

Rather than making every callsite perform length sanity checks
and error reporting, add the helper functions nbd_opt_read()
and nbd_opt_drop() that use the length stored in the client
struct; also add an assertion that optlen is 0 before any
option (ie. any previous option was fully handled), complementing
the assertion added in an earlier patch that optlen is 0 after
all negotiation completes.

Note that the call in nbd_negotiate_handle_export_name() does
not use the new helper (in part because the server cannot
reply to NBD_OPT_EXPORT_NAME - it either succeeds or the
connection drops).

Based on patches by Vladimir Sementsov-Ogievskiy.

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


  Commit: 1d17922a28f5b9a8adcea3c93f49086e0a751e86
      
https://github.com/qemu/qemu/commit/1d17922a28f5b9a8adcea3c93f49086e0a751e86
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2018-01-17 (Wed, 17 Jan 2018)

  Changed paths:
    M nbd/server.c

  Log Message:
  -----------
  nbd/server: structurize option reply sending

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


  Commit: b4d6ed1c5ae519d3efb5297be3ef6625ca2a20f4
      
https://github.com/qemu/qemu/commit/b4d6ed1c5ae519d3efb5297be3ef6625ca2a20f4
  Author: Peter Maydell <address@hidden>
  Date:   2018-01-18 (Thu, 18 Jan 2018)

  Changed paths:
    M nbd/server.c

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

pull-nbd-2018-01-17

- Vladimir Sementsov-Ogievskiy/Eric Blake: 0/6 NBD server refactoring

# gpg: Signature made Thu 18 Jan 2018 02:21:55 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-2018-01-17:
  nbd/server: structurize option reply sending
  nbd/server: Add helper functions for parsing option payload
  nbd/server: Add va_list form of nbd_negotiate_send_rep_err()
  nbd/server: Better error for NBD_OPT_EXPORT_NAME failure
  nbd/server: refactor negotiation functions parameters
  nbd/server: Hoist nbd_reject_length() earlier

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


Compare: https://github.com/qemu/qemu/compare/5cad8ca51601...b4d6ed1c5ae5

reply via email to

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