]> git.ipfire.org Git - thirdparty/qemu.git/commit
nbd: Improve error messages
authorMax Reitz <mreitz@redhat.com>
Tue, 27 Jan 2015 02:02:59 +0000 (21:02 -0500)
committerKevin Wolf <kwolf@redhat.com>
Fri, 6 Feb 2015 16:24:22 +0000 (17:24 +0100)
commit1ce52846d3ce0e4b58caebcae84719bef6401fbb
tree47f86eff873a997ea9eb11e0804cd6b4b5757b61
parenta231cb272611c758d45135f6a35a4dd1beaf5585
nbd: Improve error messages

This patch makes use of the Error object for nbd_receive_negotiate() so
that errors during negotiation look nicer.

Furthermore, this patch adds an additional error message if the received
magic was wrong, but would be correct for the other protocol version,
respectively: So if an export name was specified, but the NBD server
magic corresponds to an old handshake, this condition is explicitly
signaled to the user, and vice versa.

As these messages are now part of the "Could not open image" error
message, additional filtering has to be employed in iotest 083, which
this patch does as well.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/nbd-client.c
block/nbd-client.h
block/nbd.c
include/block/nbd.h
nbd.c
qemu-nbd.c
tests/qemu-iotests/083
tests/qemu-iotests/083.out