From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34038) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bw3MU-0005bd-A0 for qemu-devel@nongnu.org; Mon, 17 Oct 2016 04:33:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bw3MT-0005UN-JC for qemu-devel@nongnu.org; Mon, 17 Oct 2016 04:33:34 -0400 Date: Mon, 17 Oct 2016 10:33:24 +0200 From: Kevin Wolf Message-ID: <20161017083324.GA4821@noname.redhat.com> References: <20160928205602.17275-1-mreitz@redhat.com> <20160928205602.17275-10-mreitz@redhat.com> <20161013131115.GJ5803@noname.redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rwEMma7ioTxnRzrJ" Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v4 09/12] iotests.py: Add qemu_nbd function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org, Eric Blake , Paolo Bonzini , Markus Armbruster --rwEMma7ioTxnRzrJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Am 15.10.2016 um 19:17 hat Max Reitz geschrieben: > On 13.10.2016 15:11, Kevin Wolf wrote: > > Am 28.09.2016 um 22:55 hat Max Reitz geschrieben: > >> Signed-off-by: Max Reitz > >> --- > >> tests/qemu-iotests/iotests.py | 8 ++++++++ > >> 1 file changed, 8 insertions(+) > >> > >> diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotest= s.py > >> index 3329bc1..5a2678f 100644 > >> --- a/tests/qemu-iotests/iotests.py > >> +++ b/tests/qemu-iotests/iotests.py > >> @@ -39,6 +39,10 @@ qemu_io_args =3D [os.environ.get('QEMU_IO_PROG', 'q= emu-io')] > >> if os.environ.get('QEMU_IO_OPTIONS'): > >> qemu_io_args +=3D os.environ['QEMU_IO_OPTIONS'].strip().split(' ') > >> =20 > >> +qemu_nbd_args =3D [os.environ.get('QEMU_NBD_PROG', 'qemu-nbd')] > >> +if os.environ.get('QEMU_NBD_OPTIONS'): > >> + qemu_nbd_args +=3D os.environ['QEMU_NBD_OPTIONS'].strip().split('= ') > >> + > >> qemu_prog =3D os.environ.get('QEMU_PROG', 'qemu') > >> qemu_opts =3D os.environ.get('QEMU_OPTIONS', '').strip().split(' ') > >> =20 > >> @@ -87,6 +91,10 @@ def qemu_io(*args): > >> sys.stderr.write('qemu-io received signal %i: %s\n' % (-exitc= ode, ' '.join(args))) > >> return subp.communicate()[0] > >> =20 > >> +def qemu_nbd(*args): > >> + '''Run qemu-nbd in daemon mode and return the parent's exit code'= '' > >> + return subprocess.call(qemu_nbd_args + ['--fork'] + list(args)) > >=20 > > Wouldn't it be better to always use -t, track the PID and shut it down > > explicitly when the test exits? >=20 > Probably. It's a lot more complicated, though. I'll see what I can do > but I'm not sure if I can do a lot before 2.8. In that case, I'd prefer to have this series in 2.8 and improve the test case later, so don't let this stop you from sending the next version. Kevin --rwEMma7ioTxnRzrJ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJYBIzTAAoJEH8JsnLIjy/WnksP/0ZlK/Qr4QfoyFxdOovO+tsG 4CKcdHBkWr/2JNsAmuB7QavY9p2UhP55pzOOO1bx/RhIy+56XXyYqSdV1dclwf// cFI8x7Y5LkYqOj4X/EwrLniU4ISkamjPgDvgcrMmr6Q6MJ6/GPR2qHxvhmRZwg8M fAcvq7Au2MxsGMhMX8wuAEN5xL0BWbb5wac5mTQ6/xqEsTXpDBKhsr/Ge4s8jiBK 7rWCWhjbM6VhzuMlgmidy5MQ7jhL6O2miNNZGXT59l6utEL95lUlvkntu77aZxsZ YbRZSEQfCp+yOg6biL7YKV07MZfdQ95+BQGGwDE+Ul0711FoB+yzcx8gOC2Tjzsj SbrOB1AhEm12FTJvR88u7FdnxmccZ6DB9NUVVYUqrxDUXjyNuxE4ra/IAhob8/7d cso9LB/YqEmltuS13luSST8vsEkWygMi/0pgvlbgKmtvTWwr/A2j6+EafNjQU65A 0qGrbbrFcA/hxZXjuzDb8yuPX8M6b3Vx+AdftuRFk3xA75zEhY1YBVCwWPJLHK5f mZaw5wdAtaHNJuLEy5qzHyEfHSJHif9iYlCQrsFJcKdJsfKQj0EazIwCRYPjRYS1 5KIgNR4wNcEaE3ZOcLNu0W/PJdgp+lb/X2qHUTI/3OigP9ZU4o+SJBWgTvQ3mqVU x8Ul+etJ1cCj4BTSUUOm =8Bk7 -----END PGP SIGNATURE----- --rwEMma7ioTxnRzrJ--