From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52694) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V49rJ-0003wI-Qj for qemu-devel@nongnu.org; Tue, 30 Jul 2013 09:21:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V49rD-0008Sn-QR for qemu-devel@nongnu.org; Tue, 30 Jul 2013 09:21:01 -0400 Received: from mail-oa0-f48.google.com ([209.85.219.48]:42019) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V49rD-0008Sh-JL for qemu-devel@nongnu.org; Tue, 30 Jul 2013 09:20:55 -0400 Received: by mail-oa0-f48.google.com with SMTP id f4so16224912oah.35 for ; Tue, 30 Jul 2013 06:20:55 -0700 (PDT) From: Anthony Liguori In-Reply-To: <1375118141-8550-5-git-send-email-afaerber@suse.de> References: <1375118141-8550-1-git-send-email-afaerber@suse.de> <1375118141-8550-5-git-send-email-afaerber@suse.de> Date: Tue, 30 Jul 2013 08:20:52 -0500 Message-ID: <87bo5k5gln.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH for-1.6? 04/14] gumstix: Don't enforce use of -pflash for qtest List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?utf-8?Q?F=C3=A4rber?= , qemu-devel@nongnu.org Cc: Peter Maydell , Paul Brook Andreas F=C3=A4rber writes: > Signed-off-by: Andreas F=C3=A4rber I'm not sure this is heading in the right direction. What's the bigger picture here? Are we saying that all machines must be launchable without any special parameters? If so, can we document that somewhere? Is that reasonable in practice or are there cases where we must specify parameters for a machine? If the above is true, then I don't think there should be if (qtest_enabled())s guarding this stuff. Regards, Anthony Liguori > --- > hw/arm/gumstix.c | 31 +++++++++++++++++++------------ > 1 file changed, 19 insertions(+), 12 deletions(-) > > diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c > index b8cab10..27117fa 100644 > --- a/hw/arm/gumstix.c > +++ b/hw/arm/gumstix.c > @@ -42,6 +42,7 @@ > #include "hw/boards.h" > #include "sysemu/blockdev.h" > #include "exec/address-spaces.h" > +#include "sysemu/qtest.h" >=20=20 > static const int sector_len =3D 128 * 1024; >=20=20 > @@ -58,7 +59,7 @@ static void connex_init(QEMUMachineInitArgs *args) > cpu =3D pxa255_init(address_space_mem, connex_ram); >=20=20 > dinfo =3D drive_get(IF_PFLASH, 0, 0); > - if (!dinfo) { > + if (!dinfo && !qtest_enabled()) { > fprintf(stderr, "A flash image must be given with the " > "'pflash' parameter\n"); > exit(1); > @@ -69,11 +70,14 @@ static void connex_init(QEMUMachineInitArgs *args) > #else > be =3D 0; > #endif > - if (!pflash_cfi01_register(0x00000000, NULL, "connext.rom", connex_r= om, > - dinfo->bdrv, sector_len, connex_rom / sec= tor_len, > - 2, 0, 0, 0, 0, be)) { > - fprintf(stderr, "qemu: Error registering flash memory.\n"); > - exit(1); > + if (dinfo) { > + if (!pflash_cfi01_register(0x00000000, NULL, "connext.rom", conn= ex_rom, > + dinfo->bdrv, sector_len, > + connex_rom / sector_len, > + 2, 0, 0, 0, 0, be)) { > + fprintf(stderr, "qemu: Error registering flash memory.\n"); > + exit(1); > + } > } >=20=20 > /* Interrupt line of NIC is connected to GPIO line 36 */ > @@ -95,7 +99,7 @@ static void verdex_init(QEMUMachineInitArgs *args) > cpu =3D pxa270_init(address_space_mem, verdex_ram, cpu_model ?: "pxa= 270-c0"); >=20=20 > dinfo =3D drive_get(IF_PFLASH, 0, 0); > - if (!dinfo) { > + if (!dinfo && !qtest_enabled()) { > fprintf(stderr, "A flash image must be given with the " > "'pflash' parameter\n"); > exit(1); > @@ -106,11 +110,14 @@ static void verdex_init(QEMUMachineInitArgs *args) > #else > be =3D 0; > #endif > - if (!pflash_cfi01_register(0x00000000, NULL, "verdex.rom", verdex_ro= m, > - dinfo->bdrv, sector_len, verdex_rom / sec= tor_len, > - 2, 0, 0, 0, 0, be)) { > - fprintf(stderr, "qemu: Error registering flash memory.\n"); > - exit(1); > + if (dinfo) { > + if (!pflash_cfi01_register(0x00000000, NULL, "verdex.rom", verde= x_rom, > + dinfo->bdrv, sector_len, > + verdex_rom / sector_len, > + 2, 0, 0, 0, 0, be)) { > + fprintf(stderr, "qemu: Error registering flash memory.\n"); > + exit(1); > + } > } >=20=20 > /* Interrupt line of NIC is connected to GPIO line 99 */ > --=20 > 1.8.1.4