From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34150) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsIn9-0000GB-I5 for qemu-devel@nongnu.org; Thu, 06 Oct 2016 20:13:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsIn4-0003Go-MJ for qemu-devel@nongnu.org; Thu, 06 Oct 2016 20:13:34 -0400 Received: from ozlabs.org ([103.22.144.67]:51609) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsIn4-0003GA-CL for qemu-devel@nongnu.org; Thu, 06 Oct 2016 20:13:30 -0400 Date: Fri, 7 Oct 2016 10:49:12 +1100 From: David Gibson Message-ID: <20161006234912.GF18490@umbus.fritz.box> References: <1475765448-18949-1-git-send-email-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="p8PhoBjPxaQXD0vg" Content-Disposition: inline In-Reply-To: <1475765448-18949-1-git-send-email-lvivier@redhat.com> Subject: Re: [Qemu-devel] [PATCH] tests: minor cleanups in usb-hcd-uhci-test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier Cc: qemu-devel@nongnu.org, Gerd Hoffmann , Thomas Huth --p8PhoBjPxaQXD0vg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 06, 2016 at 04:50:48PM +0200, Laurent Vivier wrote: > Two minor cleanups: > - exit gracefully in case on unsupported target, > - put machine command line in a constant to avoid > to duplicate it. >=20 > Signed-off-by: Laurent Vivier Reviewed-by: David Gibson I'm not sure if I should take this through my tree or not. > --- > tests/usb-hcd-uhci-test.c | 15 +++++++++------ > 1 file changed, 9 insertions(+), 6 deletions(-) >=20 > diff --git a/tests/usb-hcd-uhci-test.c b/tests/usb-hcd-uhci-test.c > index 4b951ce..e956b9c 100644 > --- a/tests/usb-hcd-uhci-test.c > +++ b/tests/usb-hcd-uhci-test.c > @@ -77,6 +77,9 @@ static void test_usb_storage_hotplug(void) > int main(int argc, char **argv) > { > const char *arch =3D qtest_get_arch(); > + const char *cmd =3D "-device piix3-usb-uhci,id=3Duhci,addr=3D1d.0" > + " -drive id=3Ddrive0,if=3Dnone,file=3D/dev/null,fo= rmat=3Draw" > + " -device usb-tablet,bus=3Duhci.0,port=3D1"; > int ret; > =20 > g_test_init(&argc, &argv, NULL); > @@ -87,13 +90,13 @@ int main(int argc, char **argv) > qtest_add_func("/uhci/pci/hotplug/usb-storage", test_usb_storage_hot= plug); > =20 > if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 0= ) { > - qs =3D qtest_pc_boot("-device piix3-usb-uhci,id=3Duhci,addr=3D1d= =2E0" > - " -drive id=3Ddrive0,if=3Dnone,file=3D/dev/nu= ll,format=3Draw" > - " -device usb-tablet,bus=3Duhci.0,port=3D1"); > + qs =3D qtest_pc_boot(cmd); > } else if (strcmp(arch, "ppc64") =3D=3D 0) { > - qs =3D qtest_spapr_boot("-device piix3-usb-uhci,id=3Duhci,addr= =3D1d.0" > - " -drive id=3Ddrive0,if=3Dnone,file=3D/dev/nu= ll,format=3Draw" > - " -device usb-tablet,bus=3Duhci.0,port=3D1"); > + qs =3D qtest_spapr_boot(cmd); > + } else { > + g_printerr("usb-hcd-uhci-test tests are only " > + "available on x86 or ppc64\n"); > + exit(EXIT_FAILURE); > } > ret =3D g_test_run(); > qtest_shutdown(qs); --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --p8PhoBjPxaQXD0vg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX9uL3AAoJEGw4ysog2bOSWA4P/RiOQPzMe9eoE1D2lxAUOlJm L8k5U40inQgqARfwJSzjKgVRSZ1SEK+Lql2zr4EJwKkN579V+lROYCTDNYb/ZW5A 6iK4GNdT+mAyfIVQhz68Fk04Flgkp4/SIhoFjmHGtdehni+vg9bF0+pWJKGEe0m2 3vUPdQy/2M8/tNKX/laIpgfBFXcwpFRoCxzId7HR7w2SOIwnx00kyP7ERqu4Mt5A y+7XhVnrjEn7lQTVrKybliK3DYhqBNKWfhwecgQP6BCKEpD0RIFxc2xqZPcVmwvm tv9Uq6K9fcJLAOoBPEFtreMo5fcvLO622komMe76+RwYgK76T9N+JBRRUuIA3XYU kuJRYdUHur1rSXfuCauiBOCHS2YlqVbBnztKqsdKglqcqJgwgGC39EtjmrDXfReq S+RvMt3p0GMA7ty0zpIAaZc6uj83Ern60aUbatP8GPHimDBK/cKXXCfgGnoHYw4Q bXffrfnK6ECZ5VXzah/YxLeIJ8Bbf51Av3i6cT6k6ay/1bnx7EhU6+7sAKo6TnWK 6NjkJe4NMZz8zpTgbGf+u8vVnXdNvnxKgCyQ1ifSTgFxhWOF3djbQWvPDsF4ox+l JFxQSxXt1iJlSn6HF6K8wdIEvJA6P8dd5QkK+QaigMQ+ndHghzO4J/DJMmApFrcH a+Rd9cFV6phKqWVH5Yql =4fyl -----END PGP SIGNATURE----- --p8PhoBjPxaQXD0vg--