qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: "Andreas Färber" <afaerber@suse.de>, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Paul Brook <paul@codesourcery.com>
Subject: Re: [Qemu-devel] [PATCH for-1.6? 04/14] gumstix: Don't enforce use of -pflash for qtest
Date: Tue, 30 Jul 2013 08:20:52 -0500	[thread overview]
Message-ID: <87bo5k5gln.fsf@codemonkey.ws> (raw)
In-Reply-To: <1375118141-8550-5-git-send-email-afaerber@suse.de>

Andreas Färber <afaerber@suse.de> writes:

> Signed-off-by: Andreas Färber <afaerber@suse.de>

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"
>  
>  static const int sector_len = 128 * 1024;
>  
> @@ -58,7 +59,7 @@ static void connex_init(QEMUMachineInitArgs *args)
>      cpu = pxa255_init(address_space_mem, connex_ram);
>  
>      dinfo = 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 = 0;
>  #endif
> -    if (!pflash_cfi01_register(0x00000000, NULL, "connext.rom", connex_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);
> +    if (dinfo) {
> +        if (!pflash_cfi01_register(0x00000000, NULL, "connext.rom", connex_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);
> +        }
>      }
>  
>      /* Interrupt line of NIC is connected to GPIO line 36 */
> @@ -95,7 +99,7 @@ static void verdex_init(QEMUMachineInitArgs *args)
>      cpu = pxa270_init(address_space_mem, verdex_ram, cpu_model ?: "pxa270-c0");
>  
>      dinfo = 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 = 0;
>  #endif
> -    if (!pflash_cfi01_register(0x00000000, NULL, "verdex.rom", verdex_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);
> +    if (dinfo) {
> +        if (!pflash_cfi01_register(0x00000000, NULL, "verdex.rom", verdex_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);
> +        }
>      }
>  
>      /* Interrupt line of NIC is connected to GPIO line 99 */
> -- 
> 1.8.1.4

  reply	other threads:[~2013-07-30 13:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-29 17:15 [Qemu-devel] [PATCH for-1.6? 00/14] qtest: Test all targets Andreas Färber
2013-07-29 17:15 ` [Qemu-devel] [PATCH for-1.6? 01/14] mips_mipssim: Silence BIOS loading warning for qtest Andreas Färber
2013-07-29 17:15 ` [Qemu-devel] [PATCH for-1.6? 02/14] arm/boot: Turn arm_load_kernel() into no-op for qtest without -kernel Andreas Färber
2013-07-29 17:15 ` [Qemu-devel] [PATCH for-1.6? 03/14] mainstone: Don't enforce use of -pflash for qtest Andreas Färber
2013-07-29 17:15 ` [Qemu-devel] [PATCH for-1.6? 04/14] gumstix: " Andreas Färber
2013-07-30 13:20   ` Anthony Liguori [this message]
2013-07-30 13:35     ` Peter Maydell
2013-07-31 10:21     ` Andreas Färber
2013-07-29 17:15 ` [Qemu-devel] [PATCH for-1.6? 05/14] z2: " Andreas Färber
2013-07-29 17:15 ` [Qemu-devel] [PATCH for-1.6? 06/14] palm: Don't enforce loading ROM or kernel " Andreas Färber
2013-07-29 17:15 ` [Qemu-devel] [PATCH for-1.6? 07/14] omap_sx1: Don't enforce use of kernel or flash " Andreas Färber
2013-07-29 17:15 ` [Qemu-devel] [PATCH for-1.6? 08/14] exynos4_boards: Silence lack of -smp 2 warning " Andreas Färber
2013-07-29 17:15 ` [Qemu-devel] [PATCH for-1.6? 09/14] armv7m: Don't enforce use of kernel " Andreas Färber
2013-07-29 17:15 ` [Qemu-devel] [PATCH for-1.6? 10/14] axis_dev88: " Andreas Färber
2013-07-29 17:15 ` [Qemu-devel] [PATCH for-1.6? 11/14] puv3: Don't assert kernel filename " Andreas Färber
2013-07-29 17:15 ` [Qemu-devel] [PATCH for-1.6? 12/14] mcf5208: Don't enforce use of kernel " Andreas Färber
2013-07-29 17:15 ` [Qemu-devel] [PATCH for-1.6? 13/14] an5206: " Andreas Färber
2013-07-29 17:15 ` [Qemu-devel] [PATCH for-1.6? 14/14] qtest: Add dummy machine tests Andreas Färber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bo5k5gln.fsf@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=afaerber@suse.de \
    --cc=paul@codesourcery.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).