mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
kill drives_table
First step cleaning up the drives handling. This one does nothing but removing drives_table[], still it became seriously big. drive_get_index() is gone and is replaced by drives_get() which hands out DriveInfo pointers instead of a table index. This needs adaption in *tons* of places all over. The drives are now maintained as linked list. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
8a14daa5a1
commit
751c6a1704
36 changed files with 308 additions and 343 deletions
16
hw/sun4m.c
16
hw/sun4m.c
|
@ -581,9 +581,9 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, ram_addr_t RAM_size,
|
|||
qemu_irq *cpu_halt;
|
||||
unsigned long kernel_size;
|
||||
BlockDriverState *fd[MAX_FD];
|
||||
int drive_index;
|
||||
void *fw_cfg;
|
||||
DeviceState *dev;
|
||||
DriveInfo *dinfo;
|
||||
|
||||
/* init CPUs */
|
||||
if (!cpu_model)
|
||||
|
@ -662,9 +662,9 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, ram_addr_t RAM_size,
|
|||
if (hwdef->fd_base) {
|
||||
/* there is zero or one floppy drive */
|
||||
memset(fd, 0, sizeof(fd));
|
||||
drive_index = drive_get_index(IF_FLOPPY, 0, 0);
|
||||
if (drive_index != -1)
|
||||
fd[0] = drives_table[drive_index].bdrv;
|
||||
dinfo = drive_get(IF_FLOPPY, 0, 0);
|
||||
if (dinfo)
|
||||
fd[0] = dinfo->bdrv;
|
||||
|
||||
sun4m_fdctrl_init(slavio_irq[hwdef->fd_irq], hwdef->fd_base, fd,
|
||||
&fdc_tc);
|
||||
|
@ -1507,10 +1507,10 @@ static void sun4c_hw_init(const struct sun4c_hwdef *hwdef, ram_addr_t RAM_size,
|
|||
qemu_irq fdc_tc;
|
||||
unsigned long kernel_size;
|
||||
BlockDriverState *fd[MAX_FD];
|
||||
int drive_index;
|
||||
void *fw_cfg;
|
||||
DeviceState *dev;
|
||||
unsigned int i;
|
||||
DriveInfo *dinfo;
|
||||
|
||||
/* init CPU */
|
||||
if (!cpu_model)
|
||||
|
@ -1565,9 +1565,9 @@ static void sun4c_hw_init(const struct sun4c_hwdef *hwdef, ram_addr_t RAM_size,
|
|||
if (hwdef->fd_base != (target_phys_addr_t)-1) {
|
||||
/* there is zero or one floppy drive */
|
||||
memset(fd, 0, sizeof(fd));
|
||||
drive_index = drive_get_index(IF_FLOPPY, 0, 0);
|
||||
if (drive_index != -1)
|
||||
fd[0] = drives_table[drive_index].bdrv;
|
||||
dinfo = drive_get(IF_FLOPPY, 0, 0);
|
||||
if (dinfo)
|
||||
fd[0] = dinfo->bdrv;
|
||||
|
||||
sun4m_fdctrl_init(slavio_irq[hwdef->fd_irq], hwdef->fd_base, fd,
|
||||
&fdc_tc);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue