1. 07 1月, 2019 3 次提交
  2. 05 1月, 2019 9 次提交
    • E
      nbd/client: Drop pointless buf variable · ef2e35fc
      Eric Blake 提交于
      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: NEric Blake <eblake@redhat.com>
      Reviewed-by: NRichard W.M. Jones <rjones@redhat.com>
      Reviewed-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-Id: <20181215135324.152629-9-eblake@redhat.com>
      ef2e35fc
    • E
      qemu-nbd: Fail earlier for -c/-d on non-linux · 3c1fa35d
      Eric Blake 提交于
      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: NEric Blake <eblake@redhat.com>
      Message-Id: <20181215135324.152629-7-eblake@redhat.com>
      Reviewed-by: NRichard W.M. Jones <rjones@redhat.com>
      Reviewed-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      3c1fa35d
    • E
      nbd/client: More consistent error messages · 6c5c0351
      Eric Blake 提交于
      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: NEric Blake <eblake@redhat.com>
      Reviewed-by: NRichard W.M. Jones <rjones@redhat.com>
      Reviewed-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-Id: <20181215135324.152629-6-eblake@redhat.com>
      6c5c0351
    • E
      nbd: Document timeline of various features · ba2d3b3a
      Eric Blake 提交于
      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: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20181215135324.152629-3-eblake@redhat.com>
      Reviewed-by: NRichard W.M. Jones <rjones@redhat.com>
      Reviewed-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      ba2d3b3a
    • E
      qemu-nbd: Use program name in error messages · 3ba1b7ba
      Eric Blake 提交于
      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: NEric Blake <eblake@redhat.com>
      Reviewed-by: NRichard W.M. Jones <rjones@redhat.com>
      Reviewed-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-Id: <20181215135324.152629-2-eblake@redhat.com>
      3ba1b7ba
    • V
      block/nbd-client: use traces instead of noisy error_report_err · d8b4bad8
      Vladimir Sementsov-Ogievskiy 提交于
      Reduce extra noise of nbd-client, change 083 correspondingly.
      
      In various commits (be41c100 in 2.10, f140e300 in 2.11, 78a33ab5
      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: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-Id: <20181102151152.288399-4-vsementsov@virtuozzo.com>
      [eblake: drop depedence on error hint, enhance commit message]
      Signed-off-by: NEric Blake <eblake@redhat.com>
      d8b4bad8
    • E
      nbd/client: Trace all server option error messages · bee21ef0
      Eric Blake 提交于
      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: NEric Blake <eblake@redhat.com>
      Message-Id: <20181218225714.284495-3-eblake@redhat.com>
      Reviewed-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      bee21ef0
    • V
      nbd: publish _lookup functions · 757a0d05
      Vladimir Sementsov-Ogievskiy 提交于
      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: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-Id: <20181102151152.288399-3-vsementsov@virtuozzo.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      757a0d05
    • P
      Merge remote-tracking branch 'remotes/philmd/tags/fw_cfg-20190104-pull-request' into staging · e59dbbac
      Peter Maydell 提交于
      fw_cfg patches for 2019-01-04
      
      Two fixes from Li Qiang:
      - Improve error message when can't load splash file
      - Fix boot bootsplash and reboot-timeout error checking
      
      # gpg: Signature made Fri 04 Jan 2019 16:22:24 GMT
      # gpg:                using RSA key E3E32C2CDEADC0DE
      # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>"
      # Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE
      
      * remotes/philmd/tags/fw_cfg-20190104-pull-request:
        fw_cfg: Make qemu_extra_params_fw locally
        fw_cfg: Fix -boot reboot-timeout error checking
        fw_cfg: Fix -boot bootsplash error checking
        fw_cfg: Improve error message when can't load splash file
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      e59dbbac
  3. 04 1月, 2019 28 次提交