summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-06-19 18:06:25 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-06-19 18:06:25 +0100
commit476e75ab9d2cf2ad8ac8dfd9530c9fee148c2c7a (patch)
tree3509aeb7b90df72a377d5e0200c13afeac7ceac4
parent4063452eca8aaa432b5c42b1ccea81be01219b0e (diff)
downloadqemu-476e75ab9d2cf2ad8ac8dfd9530c9fee148c2c7a.tar.gz
qemu-476e75ab9d2cf2ad8ac8dfd9530c9fee148c2c7a.tar.bz2
qemu-476e75ab9d2cf2ad8ac8dfd9530c9fee148c2c7a.zip
hw/arm/vexpress: Forbid specifying flash contents in two ways at once
Detect attempts by the user to specify the contents of the first flash device via both -bios and -drive if=pflash... simultaneously and print a helpful error message. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1402419834-25982-1-git-send-email-peter.maydell@linaro.org
-rw-r--r--hw/arm/vexpress.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
index f311595d67..3d83e6c98d 100644
--- a/hw/arm/vexpress.c
+++ b/hw/arm/vexpress.c
@@ -533,7 +533,15 @@ static void vexpress_common_init(VEDBoardInfo *daughterboard,
* If a bios file was provided, attempt to map it into memory
*/
if (bios_name) {
- const char *fn = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
+ const char *fn;
+
+ if (drive_get(IF_PFLASH, 0, 0)) {
+ error_report("The contents of the first flash device may be "
+ "specified with -bios or with -drive if=pflash... "
+ "but you cannot use both options at once");
+ exit(1);
+ }
+ fn = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
if (!fn || load_image_targphys(fn, map[VE_NORFLASH0],
VEXPRESS_FLASH_SIZE) < 0) {
error_report("Could not load ROM image '%s'", bios_name);