summaryrefslogtreecommitdiffstats
path: root/hw/fdc.c
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2010-12-08 13:35:05 +0200
committerBlue Swirl <blauwirbel@gmail.com>2010-12-11 21:32:46 +0000
commit1ca4d09ae0bcc2fdd6aeef0fdc11f82394f7e757 (patch)
tree6ce3a2ba2b2f643935d12ca9765ec6e4847ca4a4 /hw/fdc.c
parentdb07c0f84ba2bedea4b8201ccb62602fd5e64c28 (diff)
downloadhqemu-1ca4d09ae0bcc2fdd6aeef0fdc11f82394f7e757.zip
hqemu-1ca4d09ae0bcc2fdd6aeef0fdc11f82394f7e757.tar.gz
Add bootindex parameter to net/block/fd device
If bootindex is specified on command line a string that describes device in firmware readable way is added into sorted list. Later this list will be passed into firmware to control boot order. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/fdc.c')
-rw-r--r--hw/fdc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/fdc.c b/hw/fdc.c
index 9d92e93..4bbcc47 100644
--- a/hw/fdc.c
+++ b/hw/fdc.c
@@ -35,6 +35,7 @@
#include "sysbus.h"
#include "qdev-addr.h"
#include "blockdev.h"
+#include "sysemu.h"
/********************************************************/
/* debug Floppy devices */
@@ -523,6 +524,8 @@ typedef struct FDCtrlSysBus {
typedef struct FDCtrlISABus {
ISADevice busdev;
struct FDCtrl state;
+ int32_t bootindexA;
+ int32_t bootindexB;
} FDCtrlISABus;
static uint32_t fdctrl_read (void *opaque, uint32_t reg)
@@ -1992,6 +1995,9 @@ static int isabus_fdc_init1(ISADevice *dev)
qdev_set_legacy_instance_id(&dev->qdev, iobase, 2);
ret = fdctrl_init_common(fdctrl);
+ add_boot_device_path(isa->bootindexA, &dev->qdev, "/floppy@0");
+ add_boot_device_path(isa->bootindexB, &dev->qdev, "/floppy@1");
+
return ret;
}
@@ -2053,6 +2059,8 @@ static ISADeviceInfo isa_fdc_info = {
.qdev.props = (Property[]) {
DEFINE_PROP_DRIVE("driveA", FDCtrlISABus, state.drives[0].bs),
DEFINE_PROP_DRIVE("driveB", FDCtrlISABus, state.drives[1].bs),
+ DEFINE_PROP_INT32("bootindexA", FDCtrlISABus, bootindexA, -1),
+ DEFINE_PROP_INT32("bootindexB", FDCtrlISABus, bootindexB, -1),
DEFINE_PROP_END_OF_LIST(),
},
};
OpenPOWER on IntegriCloud