Re: [Qemu-block] [Qemu-devel] [PATCH 6/6] tests: exercise NBD server in TLS mode

2018-11-19 Thread Eric Blake
On 11/19/18 4:37 AM, Daniel P. Berrangé wrote: Actually, I tracked this message down to using socat (which actually connects and then abruptly exits) when probing whether the socket is up and listening. That is, the message is being produced as a side effect of nbd_server_wait_for_tcp_socket

Re: [Qemu-block] [PATCH 7/6] iotests: Also test I/O over NBD TLS

2018-11-19 Thread Eric Blake
On 11/19/18 4:40 AM, Daniel P. Berrangé wrote: On Sat, Nov 17, 2018 at 08:24:03PM -0600, Eric Blake wrote: Enhance test 233 to also perform I/O beyond the initial handshake. Signed-off-by: Eric Blake --- Depends on my tweak to 2/6 to suppress an EIO error message on a failed read after

Re: [Qemu-block] [Qemu-devel] [PATCH for-3.1] iotests: Enhance 223 to cover multiple bitmap granularities

2018-11-19 Thread Eric Blake
On 11/19/18 11:29 AM, Eric Blake wrote: Testing granularity at the same size as the cluster isn't quite as fun as what happens when it is larger or smaller. This enhancement also shows that qemu's nbd server can server the s/server/serve/ same disk over multiple exports simultaneously.

Re: [Qemu-block] [Qemu-devel] [PATCH for-3.1] nvme: fix out-of-bounds access to the CMB

2018-11-19 Thread Paolo Bonzini
On 19/11/18 16:23, Mark Kanda wrote: > For CVE-2018-16847, I just noticed Kevin pulled in Li's previous fix (as > opposed to this one). Was this done in error? Probably. Kevin, can you revert and apply this one instead? I don't care if 3.1 or 3.2, but the previous fix is pointless complication.

[Qemu-block] [PATCH for-3.1] iotests: Enhance 223 to cover multiple bitmap granularities

2018-11-19 Thread Eric Blake
Testing granularity at the same size as the cluster isn't quite as fun as what happens when it is larger or smaller. This enhancement also shows that qemu's nbd server can server the same disk over multiple exports simultaneously. Signed-off-by: Eric Blake --- Just a testsuite enhancement, so

Re: [Qemu-block] KVM Forum block no[td]es

2018-11-19 Thread Alberto Garcia
On Fri 16 Nov 2018 04:18:34 PM CET, Kevin Wolf wrote: > Am 16.11.2018 um 16:03 hat Alberto Garcia geschrieben: >> > I don't think anything needs a way to generally block graph changes >> > around some node. We only need to prevent changes to very specific >> > sets of edges. This is something

Re: [Qemu-block] [PATCH 6/6] tests: exercise NBD server in TLS mode

2018-11-19 Thread Eric Blake
On 11/16/18 9:53 AM, Daniel P. Berrangé wrote: Add tests that validate it is possible to connect to an NBD server running TLS mode. Also test mis-matched TLS vs non-TLS connections correctly fail. --- +++ b/tests/qemu-iotests/common.nbd +function nbd_server_wait_for_tcp_socket() +{ +

Re: [Qemu-block] [Qemu-devel] [PATCH for-3.1] nvme: fix out-of-bounds access to the CMB

2018-11-19 Thread Kevin Wolf
Am 19.11.2018 um 18:09 hat Paolo Bonzini geschrieben: > On 19/11/18 16:23, Mark Kanda wrote: > > For CVE-2018-16847, I just noticed Kevin pulled in Li's previous fix (as > > opposed to this one). Was this done in error? > > Probably. Kevin, can you revert and apply this one instead? I don't >

Re: [Qemu-block] [PATCH for-3.1? v2 1/3] block: Always abort reopen after prepare succeeded

2018-11-19 Thread Alberto Garcia
On Fri 16 Nov 2018 05:45:24 PM CET, Max Reitz wrote: > bdrv_reopen_multiple() does not invoke bdrv_reopen_abort() for the > element of the reopen queue for which bdrv_reopen_prepare() failed, > because it assumes that the prepare function will have rolled back all > changes already. > > However,

Re: [Qemu-block] [PATCH for-3.1? v2 3/3] iotests: Test file-posix locking and reopen

2018-11-19 Thread Alberto Garcia
On Fri 16 Nov 2018 05:45:26 PM CET, Max Reitz wrote: > Signed-off-by: Max Reitz Reviewed-by: Alberto Garcia Berto

Re: [Qemu-block] [PATCH for-3.1? v2 2/3] file-posix: Fix shared locks on reopen commit

2018-11-19 Thread Alberto Garcia
On Fri 16 Nov 2018 05:45:25 PM CET, Max Reitz wrote: > s->locked_shared_perm is the set of bits locked in the file, which is > the inverse of the permissions actually shared. So we need to pass them > as they are to raw_apply_lock_bytes() instead of inverting them again. > > Reported-by: Alberto

[Qemu-block] [PATCH for-next? 2/2] qemu-img: Fix leak

2018-11-19 Thread Max Reitz
create_opts was leaked here. This is not too bad since the process is about to exit anyway, but relying on that does not make the code nicer to read. Fixes: d402b6a21a825a5c07aac9251990860723d49f5d Reported-by: Kevin Wolf Cc: qemu-sta...@nongnu.org Signed-off-by: Max Reitz --- qemu-img.c | 1

[Qemu-block] [PATCH for-next? 1/2] qemu-img: Fix typo

2018-11-19 Thread Max Reitz
Fixes: d402b6a21a825a5c07aac9251990860723d49f5d Reported-by: Kevin Wolf Cc: qemu-sta...@nongnu.org Signed-off-by: Max Reitz --- qemu-img.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-img.c b/qemu-img.c index 13a6ca31b4..a9a2470e1a 100644 --- a/qemu-img.c +++

[Qemu-block] [PATCH for-next? 0/2] qemu-img: Minor fixes to an amend error path

2018-11-19 Thread Max Reitz
One of the amend error paths has two issues that are fixed by this series. Since they are relatively minor and have been present in 3.0 already, I think there is no need to get them into 3.1. OTOH they are bug fixes, so they could go into 3.1 if you, dear reader, insist. Max Reitz (2):

Re: [Qemu-block] [PATCH 3/6] tests: pull qemu-nbd iotest helpers into common.nbd file

2018-11-19 Thread Daniel P . Berrangé
On Fri, Nov 16, 2018 at 03:43:16PM -0600, Eric Blake wrote: > On 11/16/18 3:41 PM, Eric Blake wrote: > > > > +#!/bin/bash > > > > I know we're using bash, > > > > > + > > > +function nbd_server_stop() > > > +{ > > > > > +function nbd_server_wait_for_unix_socket() > > > > and bash supports

Re: [Qemu-block] [PATCH 4/6] tests: check if qemu-nbd is still alive before waiting

2018-11-19 Thread Daniel P . Berrangé
On Fri, Nov 16, 2018 at 10:24:54AM -0600, Eric Blake wrote: > On 11/16/18 9:53 AM, Daniel P. Berrangé wrote: > > If the qemu-nbd UNIX socket has not shown up, the tests will sleep a bit > > and then check again repeatedly for upto 30 seconds. This is pointless > > s/upto/up to/ > > > if the

Re: [Qemu-block] [PATCH 5/6] tests: add iotests helpers for dealing with TLS certificates

2018-11-19 Thread Daniel P . Berrangé
On Fri, Nov 16, 2018 at 10:39:03AM -0600, Eric Blake wrote: > On 11/16/18 9:53 AM, Daniel P. Berrangé wrote: > > Add helpers to common.tls for creating TLS certificates for a CA, > > server and client. > > MUCH appreciated! We NEED this coverage, easily automated. > > > > > Signed-off-by:

Re: [Qemu-block] [PATCH 2/6 for-3.1] nbd: stop waiting for a NBD response with NBD_CMD_DISC

2018-11-19 Thread Daniel P . Berrangé
On Sat, Nov 17, 2018 at 08:19:10PM -0600, Eric Blake wrote: > On 11/16/18 9:53 AM, Daniel P. Berrangé wrote: > > When sending a NBD_CMD_DISC message there is no reply expected, > > however, the nbd_read_eof() coroutine is still waiting for a reply. > > In a plain NBD connection this doesn't matter

Re: [Qemu-block] [PATCH 3/6] tests: pull qemu-nbd iotest helpers into common.nbd file

2018-11-19 Thread Daniel P . Berrangé
On Sat, Nov 17, 2018 at 09:01:57PM -0600, Eric Blake wrote: > On 11/16/18 9:53 AM, Daniel P. Berrangé wrote: > > The helpers for starting/stopping qemu-nbd in 058 will be useful in > > other test cases, so move them into a common.nbd file. > > > > Signed-off-by: Daniel P. Berrangé > > --- > > >

Re: [Qemu-block] [PATCH 6/6] tests: exercise NBD server in TLS mode

2018-11-19 Thread Daniel P . Berrangé
On Fri, Nov 16, 2018 at 11:20:26AM -0600, Eric Blake wrote: > On 11/16/18 9:53 AM, Daniel P. Berrangé wrote: > > Add tests that validate it is possible to connect to an NBD server > > running TLS mode. Also test mis-matched TLS vs non-TLS connections > > correctly fail. > > --- > >

Re: [Qemu-block] [Qemu-devel] [PATCH 6/6] tests: exercise NBD server in TLS mode

2018-11-19 Thread Daniel P . Berrangé
On Sat, Nov 17, 2018 at 03:31:34PM -0600, Eric Blake wrote: > On 11/16/18 11:20 AM, Eric Blake wrote: > > On 11/16/18 9:53 AM, Daniel P. Berrangé wrote: > > > Add tests that validate it is possible to connect to an NBD server > > > running TLS mode. Also test mis-matched TLS vs non-TLS connections

Re: [Qemu-block] [PATCH 6/6] tests: exercise NBD server in TLS mode

2018-11-19 Thread Daniel P . Berrangé
On Sat, Nov 17, 2018 at 02:49:22PM -0600, Eric Blake wrote: > On 11/16/18 9:53 AM, Daniel P. Berrangé wrote: > > Add tests that validate it is possible to connect to an NBD server > > running TLS mode. Also test mis-matched TLS vs non-TLS connections > > correctly fail. > > --- > > Missing your

Re: [Qemu-block] [PATCH 1.5/6] nbd/server: Ignore write errors when replying to NBD_OPT_ABORT

2018-11-19 Thread Daniel P . Berrangé
On Sat, Nov 17, 2018 at 04:32:21PM -0600, Eric Blake wrote: > Commit 37ec36f6 intentionally ignores errors when trying to reply > to an NBD_OPT_ABORT request for plaintext clients, but did not make > the same change for a TLS server. Since NBD_OPT_ABORT is > documented as being a potential for an

Re: [Qemu-block] [PATCH 7/6] iotests: Also test I/O over NBD TLS

2018-11-19 Thread Daniel P . Berrangé
On Sat, Nov 17, 2018 at 08:24:03PM -0600, Eric Blake wrote: > Enhance test 233 to also perform I/O beyond the initial handshake. > > Signed-off-by: Eric Blake > --- > > Depends on my tweak to 2/6 to suppress an EIO error message > on a failed read after NBD_CMD_DISC. > >

Re: [Qemu-block] [Qemu-devel] [PATCH] iotests: Drop use of bash keyword 'function'

2018-11-19 Thread Daniel P . Berrangé
On Fri, Nov 16, 2018 at 03:50:02PM -0600, Eric Blake wrote: > Bash allows functions to be declared with or without the leading > keyword 'function'; but including the keyword does not comply with > POSIX syntax, and is confusing to ksh users where the use of the > keyword changes the scoping rules

Re: [Qemu-block] [PATCH 5/6] tests: add iotests helpers for dealing with TLS certificates

2018-11-19 Thread Max Reitz
On 19.11.18 11:27, Daniel P. Berrangé wrote: > On Fri, Nov 16, 2018 at 10:39:03AM -0600, Eric Blake wrote: >> On 11/16/18 9:53 AM, Daniel P. Berrangé wrote: >>> Add helpers to common.tls for creating TLS certificates for a CA, >>> server and client. >> >> MUCH appreciated! We NEED this coverage,

Re: [Qemu-block] [Qemu-devel] [PATCH] iotests: Drop use of bash keyword 'function'

2018-11-19 Thread Philippe Mathieu-Daudé
On 16/11/18 22:50, Eric Blake wrote: Bash allows functions to be declared with or without the leading keyword 'function'; but including the keyword does not comply with POSIX syntax, and is confusing to ksh users where the use of the keyword changes the scoping rules for functions. Stick to the

Re: [Qemu-block] [PATCH] migration/block-dirty-bitmap: fix Coverity CID1390625

2018-11-19 Thread Vladimir Sementsov-Ogievskiy
16.11.2018 17:29, Stefan Hajnoczi wrote: > On Tue, Oct 16, 2018 at 04:20:18PM +0300, Vladimir Sementsov-Ogievskiy wrote: >> Theoretically possible that we finish the skipping loop with bs = NULL >> and the following code will crash trying to dereference it. Fix that. >> >> Signed-off-by: Vladimir

Re: [Qemu-block] [Qemu-devel] [PATCH for-3.1] fdc: fix segfault in fdctrl_stop_transfer() when DMA is disabled

2018-11-19 Thread Kevin Wolf
Am 18.11.2018 um 13:32 hat Mark Cave-Ayland geschrieben: > On 13/11/2018 20:29, John Snow wrote: > > > On 11/13/18 8:16 AM, Kevin Wolf wrote: > >> Am 12.11.2018 um 20:58 hat John Snow geschrieben: > >>> > >>> > >>> On 11/11/18 4:40 AM, Mark Cave-Ayland wrote: > Commit c8a35f1cf0f "fdc: use

Re: [Qemu-block] Change in qemu 2.12 causes qemu-img convert to NBD to write more data

2018-11-19 Thread Kevin Wolf
Am 17.11.2018 um 21:59 hat Nir Soffer geschrieben: > On Fri, Nov 16, 2018 at 5:26 PM Kevin Wolf wrote: > > > Am 15.11.2018 um 23:27 hat Nir Soffer geschrieben: > > > On Sun, Nov 11, 2018 at 6:11 PM Nir Soffer wrote: > > > > > > > On Wed, Nov 7, 2018 at 7:55 PM Nir Soffer wrote: > > > > > > >

[Qemu-block] [PATCH 00/22] QOM'ify SysBusDeviceClass->init

2018-11-19 Thread Mao Zhongyi
The SysBusDeviceClass::init() interface is considered as a legacy interface and there are currently some efforts going on to get rid of it. Thus convert SysBusDeviceClass::init to DeviceClass::realize. Cc: alistair.fran...@wdc.com Cc: anthony.per...@citrix.com Cc: arm...@redhat.com Cc:

[Qemu-block] [PATCH 02/22] block/noenand: Convert sysbus init function to realize function

2018-11-19 Thread Mao Zhongyi
Use DeviceClass rather than SysBusDeviceClass in onenand_class_init(). Cc: kw...@redhat.com Cc: mre...@redhat.com Cc: qemu-block@nongnu.org Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju --- hw/block/onenand.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-)

Re: [Qemu-block] [PATCH 00/22] QOM'ify SysBusDeviceClass->init

2018-11-19 Thread Cornelia Huck
On Mon, 19 Nov 2018 20:07:58 +0800 Mao Zhongyi wrote: > The SysBusDeviceClass::init() interface is considered > as a legacy interface and there are currently some > efforts going on to get rid of it. Thus convert > SysBusDeviceClass::init to DeviceClass::realize. In case my comment to the s390

Re: [Qemu-block] [PATCH for-3.1? v2 0/3] block: Fix two minor reopen issues

2018-11-19 Thread Kevin Wolf
Am 16.11.2018 um 17:45 hat Max Reitz geschrieben: > These are fixes for issues I found when looking after something Berto > has reported. The second patch fixes that issue Berto found, the first > one is only kind of related. > > For the first patch: bdrv_reopen_abort() or bdrv_reopen_commit()

Re: [Qemu-block] [PATCH 2/6 for-3.1] nbd: stop waiting for a NBD response with NBD_CMD_DISC

2018-11-19 Thread Daniel P . Berrangé
On Sat, Nov 17, 2018 at 08:19:10PM -0600, Eric Blake wrote: > On 11/16/18 9:53 AM, Daniel P. Berrangé wrote: > > When sending a NBD_CMD_DISC message there is no reply expected, > > however, the nbd_read_eof() coroutine is still waiting for a reply. > > In a plain NBD connection this doesn't matter

Re: [Qemu-block] [PATCH 2/6 for-3.1] nbd: stop waiting for a NBD response with NBD_CMD_DISC

2018-11-19 Thread Eric Blake
On 11/19/18 4:23 AM, Daniel P. Berrangé wrote: Simply setting the 'quit' flag after sending NBD_CMD_DISC is enough to get the coroutine to stop waiting for a reply and thus supress the error message. Actually, it's not quite enough - once you actually start performing I/O, enough coroutines

Re: [Qemu-block] [PATCH 5/6] tests: add iotests helpers for dealing with TLS certificates

2018-11-19 Thread Eric Blake
On 11/19/18 5:04 AM, Max Reitz wrote: +tls_dir="${TEST_DIR}/tls" + +function tls_x509_cleanup() +{ +rm -f ${tls_dir}/*.pem +rm -f ${tls_dir}/*/*.pem +rmdir ${tls_dir}/* +rmdir ${tls_dir} Why not just: rm -rf $tls_dir Yeah, I guess we could do that for simplicity Also, the

[Qemu-block] [PULL 3/9] vvfat: Fix memory leak

2018-11-19 Thread Kevin Wolf
Don't leak 'cluster' in the mapping == NULL case. Found by Coverity (CID 1055918). Fixes: 8d9401c2791ee2d2805b741b1ee3006041edcd3e Signed-off-by: Kevin Wolf Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Liam Merwick Tested-by: Philippe Mathieu-Daudé --- block/vvfat.c | 6 +++--- 1 file

[Qemu-block] [PULL 2/9] fdc: fix segfault in fdctrl_stop_transfer() when DMA is disabled

2018-11-19 Thread Kevin Wolf
From: Mark Cave-Ayland Commit c8a35f1cf0f "fdc: use IsaDma interface instead of global DMA_* functions" accidentally introduced a segfault in fdctrl_stop_transfer() for non-DMA transfers. If fdctrl->dma_chann has not been configured then the fdctrl->dma interface reference isn't initialised

[Qemu-block] [PULL 0/9] Block layer patches

2018-11-19 Thread Kevin Wolf
The following changes since commit 9436e082de18b2fb2ceed2e9d1beef641ae64f23: MAINTAINERS: clarify some of the tags (2018-11-19 11:19:23 +) are available in the Git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream for you to fetch changes up to

[Qemu-block] [PULL 1/9] nvme: fix oob access issue(CVE-2018-16847)

2018-11-19 Thread Kevin Wolf
From: Li Qiang Currently, the nvme_cmb_ops mr doesn't check the addr and size. This can lead an oob access issue. This is triggerable in the guest. Add check to avoid this issue. Fixes CVE-2018-16847. Reported-by: Li Qiang Reviewed-by: Paolo Bonzini Signed-off-by: Li Qiang Signed-off-by:

[Qemu-block] [PULL 4/9] qcow2: Document some maximum size constraints

2018-11-19 Thread Kevin Wolf
From: Eric Blake Although off_t permits up to 63 bits (8EB) of file offsets, in practice, we're going to hit other limits first. Document some of those limits in the qcow2 spec (some are inherent, others are implementation choices of qemu), and how choice of cluster size can influence some of

[Qemu-block] [PULL 5/9] qcow2: Don't allow overflow during cluster allocation

2018-11-19 Thread Kevin Wolf
From: Eric Blake Our code was already checking that we did not attempt to allocate more clusters than what would fit in an INT64 (the physical maximimum if we can access a full off_t's worth of data). But this does not catch smaller limits enforced by various spots in the qcow2 image

[Qemu-block] [PULL 7/9] block: Always abort reopen after prepare succeeded

2018-11-19 Thread Kevin Wolf
From: Max Reitz bdrv_reopen_multiple() does not invoke bdrv_reopen_abort() for the element of the reopen queue for which bdrv_reopen_prepare() failed, because it assumes that the prepare function will have rolled back all changes already. However, bdrv_reopen_prepare() does not do this in every

[Qemu-block] [PULL 8/9] file-posix: Fix shared locks on reopen commit

2018-11-19 Thread Kevin Wolf
From: Max Reitz s->locked_shared_perm is the set of bits locked in the file, which is the inverse of the permissions actually shared. So we need to pass them as they are to raw_apply_lock_bytes() instead of inverting them again. Reported-by: Alberto Garcia Signed-off-by: Max Reitz

[Qemu-block] [PULL 9/9] iotests: Test file-posix locking and reopen

2018-11-19 Thread Kevin Wolf
From: Max Reitz Signed-off-by: Max Reitz Reviewed-by: Alberto Garcia Signed-off-by: Kevin Wolf --- tests/qemu-iotests/182 | 71 ++ tests/qemu-iotests/182.out | 9 + 2 files changed, 80 insertions(+) diff --git a/tests/qemu-iotests/182

[Qemu-block] [PULL 6/9] iotests: Add new test 220 for max compressed cluster offset

2018-11-19 Thread Kevin Wolf
From: Eric Blake If you have a capable file system (tmpfs is good, ext4 not so much; run ./check with TEST_DIR pointing to a good location so as not to skip the test), it's actually possible to create a qcow2 file that expands to a sparse 512T image with just over 38M of content. The test is not

Re: [Qemu-block] [PATCH 5/6] tests: add iotests helpers for dealing with TLS certificates

2018-11-19 Thread Daniel P . Berrangé
On Mon, Nov 19, 2018 at 08:27:56AM -0600, Eric Blake wrote: > On 11/19/18 5:04 AM, Max Reitz wrote: > > > > > > +tls_dir="${TEST_DIR}/tls" > > > > > + > > > > > +function tls_x509_cleanup() > > > > > +{ > > > > > +rm -f ${tls_dir}/*.pem > > > > > +rm -f ${tls_dir}/*/*.pem > > > > > +

Re: [Qemu-block] [PULL 0/9] Block layer patches

2018-11-19 Thread Peter Maydell
On 19 November 2018 at 14:29, Kevin Wolf wrote: > The following changes since commit 9436e082de18b2fb2ceed2e9d1beef641ae64f23: > > MAINTAINERS: clarify some of the tags (2018-11-19 11:19:23 +) > > are available in the Git repository at: > > git://repo.or.cz/qemu/kevin.git

Re: [Qemu-block] [Qemu-devel] [PATCH for-3.1] nvme: fix out-of-bounds access to the CMB

2018-11-19 Thread Mark Kanda
For CVE-2018-16847, I just noticed Kevin pulled in Li's previous fix (as opposed to this one). Was this done in error? Thanks, -Mark On 11/16/2018 3:31 AM, Paolo Bonzini wrote: Because the CMB BAR has a min_access_size of 2, if you read the last byte it will try to memcpy *2* bytes from

[Qemu-block] [PULL 04/12] nbd: fix whitespace in server error message

2018-11-19 Thread Eric Blake
From: Daniel P. Berrangé A space was missing after the option number was printed: Option 0x8not permitted before TLS becomes Option 0x8 not permitted before TLS This fixes commit 3668328303429f3bc93ab3365c66331600b06a2d Author: Eric Blake Date: Fri Oct 14 13:33:09 2016 -0500

[Qemu-block] [PULL 03/12] qemu-iotests: Modern shell scripting (use $() instead of ``)

2018-11-19 Thread Eric Blake
From: Mao Zhongyi Various shell files contain a mix between obsolete `` and modern $(); It would be nice to convert to using $() everywhere. For now, just do the qemu-iotests directory. Cc: kw...@redhat.com Cc: mre...@redhat.com Cc: ebl...@redhat.com Suggested-by: Eric Blake Signed-off-by:

[Qemu-block] [PULL 02/12] qemu-iotests: convert `pwd` and $(pwd) to $PWD

2018-11-19 Thread Eric Blake
From: Mao Zhongyi POSIX requires $PWD to be reliable, and we expect all shells used by qemu scripts to be relatively close to POSIX. Thus, it is smarter to avoid forking the pwd executable for something that is already available in the environment. So replace it with the following: sed -i

[Qemu-block] [PULL 07/12] tests: pull qemu-nbd iotest helpers into common.nbd file

2018-11-19 Thread Eric Blake
From: Daniel P. Berrangé The helpers for starting/stopping qemu-nbd in 058 will be useful in other test cases, so move them into a common.nbd file. Signed-off-by: Daniel P. Berrangé Message-Id: <20181116155325.22428-4-berra...@redhat.com> Reviewed-by: Eric Blake [eblake: fix shell quoting]

[Qemu-block] [PULL 05/12] nbd/server: Ignore write errors when replying to NBD_OPT_ABORT

2018-11-19 Thread Eric Blake
Commit 37ec36f6 intentionally ignores errors when trying to reply to an NBD_OPT_ABORT request for plaintext clients, but did not make the same change for a TLS server. Since NBD_OPT_ABORT is documented as being a potential for an EPIPE when the client hangs up without waiting for our reply, we

[Qemu-block] [PULL 11/12] iotests: Also test I/O over NBD TLS

2018-11-19 Thread Eric Blake
Enhance test 233 to also perform I/O beyond the initial handshake. Signed-off-by: Eric Blake Message-Id: <20181118022403.2211483-1-ebl...@redhat.com> Reviewed-by: Daniel P. Berrangé --- tests/qemu-iotests/233 | 12 +++- tests/qemu-iotests/233.out | 10 ++ 2 files changed,

[Qemu-block] [PULL 08/12] tests: check if qemu-nbd is still alive before waiting

2018-11-19 Thread Eric Blake
From: Daniel P. Berrangé If the qemu-nbd UNIX socket has not shown up, the tests will sleep a bit and then check again repeatedly for up to 30 seconds. This is pointless if the qemu-nbd process has quit due to an error, so check whether the pid is still alive before waiting and retrying.

[Qemu-block] [PULL 01/12] qemu-iotests: remove unused variable 'here'

2018-11-19 Thread Eric Blake
From: Mao Zhongyi Running git grep '\$here' tests/qemu-iotests has 0 hits, which means we are setting a variable that has no use. It appears that commit e8f8624d removed the last use. So execute the following cmd to remove all of the 'here=...' lines as dead code. sed -i '/^here=/d' $(git

[Qemu-block] [PULL 10/12] tests: exercise NBD server in TLS mode

2018-11-19 Thread Eric Blake
From: Daniel P. Berrangé Add tests that validate it is possible to connect to an NBD server running TLS mode. Also test mis-matched TLS vs non-TLS connections correctly fail. Signed-off-by: Daniel P. Berrangé Message-Id: <20181116155325.22428-7-berra...@redhat.com> Reviewed-by: Eric Blake

[Qemu-block] [PULL 09/12] tests: add iotests helpers for dealing with TLS certificates

2018-11-19 Thread Eric Blake
From: Daniel P. Berrangé Add helpers to common.tls for creating TLS certificates for a CA, server and client. Signed-off-by: Daniel P. Berrangé Message-Id: <20181116155325.22428-6-berra...@redhat.com> Reviewed-by: Eric Blake [eblake: spelling and quoting touchups] Signed-off-by: Eric Blake

[Qemu-block] [PULL 12/12] iotests: Drop use of bash keyword 'function'

2018-11-19 Thread Eric Blake
Bash allows functions to be declared with or without the leading keyword 'function'; but including the keyword does not comply with POSIX syntax, and is confusing to ksh users where the use of the keyword changes the scoping rules for functions. Stick to the POSIX form through iotests. Done