Patchwork [v3,11/18] axis_dev88: Don't enforce use of kernel for qtest

login
register
mail settings
Submitter Andreas Färber
Date Sept. 23, 2013, 1:35 p.m.
Message ID <1379943352-1979-12-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/277182/
State New
Headers show

Comments

Andreas Färber - Sept. 23, 2013, 1:35 p.m.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 hw/cris/axis_dev88.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
Edgar Iglesias - Sept. 23, 2013, 6:26 p.m.
On Mon, Sep 23, 2013 at 03:35:45PM +0200, Andreas Färber wrote:
> Signed-off-by: Andreas Färber <afaerber@suse.de>

Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

> ---
>  hw/cris/axis_dev88.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/hw/cris/axis_dev88.c b/hw/cris/axis_dev88.c
> index 03058d3..5524088 100644
> --- a/hw/cris/axis_dev88.c
> +++ b/hw/cris/axis_dev88.c
> @@ -32,6 +32,7 @@
>  #include "boot.h"
>  #include "sysemu/blockdev.h"
>  #include "exec/address-spaces.h"
> +#include "sysemu/qtest.h"
>  
>  #define D(x)
>  #define DNAND(x)
> @@ -340,14 +341,14 @@ void axisdev88_init(QEMUMachineInitArgs *args)
>                               irq[0x14 + i]);
>      }
>  
> -    if (!kernel_filename) {
> +    if (kernel_filename) {
> +        li.image_filename = kernel_filename;
> +        li.cmdline = kernel_cmdline;
> +        cris_load_image(cpu, &li);
> +    } else if (!qtest_enabled()) {
>          fprintf(stderr, "Kernel image must be specified\n");
>          exit(1);
>      }
> -
> -    li.image_filename = kernel_filename;
> -    li.cmdline = kernel_cmdline;
> -    cris_load_image(cpu, &li);
>  }
>  
>  static QEMUMachine axisdev88_machine = {
> -- 
> 1.8.1.4
>

Patch

diff --git a/hw/cris/axis_dev88.c b/hw/cris/axis_dev88.c
index 03058d3..5524088 100644
--- a/hw/cris/axis_dev88.c
+++ b/hw/cris/axis_dev88.c
@@ -32,6 +32,7 @@ 
 #include "boot.h"
 #include "sysemu/blockdev.h"
 #include "exec/address-spaces.h"
+#include "sysemu/qtest.h"
 
 #define D(x)
 #define DNAND(x)
@@ -340,14 +341,14 @@  void axisdev88_init(QEMUMachineInitArgs *args)
                              irq[0x14 + i]);
     }
 
-    if (!kernel_filename) {
+    if (kernel_filename) {
+        li.image_filename = kernel_filename;
+        li.cmdline = kernel_cmdline;
+        cris_load_image(cpu, &li);
+    } else if (!qtest_enabled()) {
         fprintf(stderr, "Kernel image must be specified\n");
         exit(1);
     }
-
-    li.image_filename = kernel_filename;
-    li.cmdline = kernel_cmdline;
-    cris_load_image(cpu, &li);
 }
 
 static QEMUMachine axisdev88_machine = {