From patchwork Tue Oct 8 17:44:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 281579 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DB7942C00B3 for ; Wed, 9 Oct 2013 05:54:53 +1100 (EST) Received: from localhost ([::1]:38294 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTbpG-0005Qg-BE for incoming@patchwork.ozlabs.org; Tue, 08 Oct 2013 14:16:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37915) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTbe6-00053k-W0 for qemu-devel@nongnu.org; Tue, 08 Oct 2013 14:04:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VTbdt-0007Xz-QZ for qemu-devel@nongnu.org; Tue, 08 Oct 2013 14:04:34 -0400 Received: from cantor2.suse.de ([195.135.220.15]:43025 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTbdt-0007VV-Id for qemu-devel@nongnu.org; Tue, 08 Oct 2013 14:04:21 -0400 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 800F3A5429; Tue, 8 Oct 2013 19:45:02 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Tue, 8 Oct 2013 19:44:02 +0200 Message-Id: <1381254296-3203-5-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1381254296-3203-1-git-send-email-afaerber@suse.de> References: <1381254296-3203-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 195.135.220.15 Cc: Guan Xuetao , =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PULL 04/58] puv3: Turn puv3_load_kernel() into a no-op for qtest without -kernel X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Replacing the assert() with more user-friendly error handling is left for a follow-up. Signed-off-by: Andreas Färber --- hw/unicore32/puv3.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/unicore32/puv3.c b/hw/unicore32/puv3.c index a900061..e05cbc1 100644 --- a/hw/unicore32/puv3.c +++ b/hw/unicore32/puv3.c @@ -17,6 +17,7 @@ #include "hw/boards.h" #include "hw/loader.h" #include "hw/i386/pc.h" +#include "sysemu/qtest.h" #undef DEBUG_PUV3 #include "hw/unicore32/puv3.h" @@ -84,6 +85,9 @@ static void puv3_load_kernel(const char *kernel_filename) { int size; + if (kernel_filename == NULL && qtest_enabled()) { + return; + } assert(kernel_filename != NULL); /* only zImage format supported */