From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkbKg-0006cn-H7 for qemu-devel@nongnu.org; Mon, 17 Dec 2012 09:06:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TkbKY-0004Jl-Mz for qemu-devel@nongnu.org; Mon, 17 Dec 2012 09:06:14 -0500 Received: from oxygen.pond.sub.org ([2a01:4f8:121:10e4::3]:58440) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkbKY-0004Iq-D3 for qemu-devel@nongnu.org; Mon, 17 Dec 2012 09:06:06 -0500 From: Markus Armbruster Date: Mon, 17 Dec 2012 15:05:51 +0100 Message-Id: <1355753160-17544-2-git-send-email-armbru@redhat.com> In-Reply-To: <1355753160-17544-1-git-send-email-armbru@redhat.com> References: <1355753160-17544-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH 01/10] ide: Break all non-qdevified controllers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-ppc@nongnu.org, agraf@suse.de They complicate IDE data structures and keep getting in the way. Also, TRIM support (commit d353fb72) is broken for them, because ide_identify() accesses IDEDevice member conf, but IDEDevice exists only with qdevified controllers. The non-qdevified controllers are still there, but attempting to connect devices to them fails with "IDE controller not qdevified yet; drive ignored". Affected machines: * g3beige's first IDE channel (MacIO) -hda, -hdb are on first channel, and no longer work -hdc, -hdd are on second channel, and still work * mac99's second and third IDE channel (MacIO) All four IDE drives no longer work * spitz, borzoi, terrier and tosa (CF microdrive) -hda no longer works the other IDE drives have always been silently ignored * r2d's onboard CF (MMIO) -hda no longer works the other IDE drives have always been silently ignored The writing has been on the wall for a few years. Signed-off-by: Markus Armbruster --- hw/ide/core.c | 43 +++++++++---------------------------------- 1 file changed, 9 insertions(+), 34 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index c4f93d0..2c0c978 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -2057,53 +2057,28 @@ void ide_init2(IDEBus *bus, qemu_irq irq) bus->dma = &ide_dma_nop; } -/* TODO convert users to qdev and remove */ +/* TODO users are *broken*; convert them to qdev and remove this function */ void ide_init2_with_non_qdev_drives(IDEBus *bus, DriveInfo *hd0, DriveInfo *hd1, qemu_irq irq) { - int i, trans; + Location loc; + int i; DriveInfo *dinfo; - uint32_t cyls, heads, secs; + loc_push_none(&loc); for(i = 0; i < 2; i++) { dinfo = i == 0 ? hd0 : hd1; ide_init1(bus, i); if (dinfo) { - cyls = dinfo->cyls; - heads = dinfo->heads; - secs = dinfo->secs; - trans = dinfo->trans; - if (!cyls && !heads && !secs) { - hd_geometry_guess(dinfo->bdrv, &cyls, &heads, &secs, &trans); - } else if (trans == BIOS_ATA_TRANSLATION_AUTO) { - trans = hd_bios_chs_auto_trans(cyls, heads, secs); - } - if (cyls < 1 || cyls > 65535) { - error_report("cyls must be between 1 and 65535"); - exit(1); - } - if (heads < 1 || heads > 16) { - error_report("heads must be between 1 and 16"); - exit(1); - } - if (secs < 1 || secs > 255) { - error_report("secs must be between 1 and 255"); - exit(1); - } - if (ide_init_drive(&bus->ifs[i], dinfo->bdrv, - dinfo->media_cd ? IDE_CD : IDE_HD, - NULL, dinfo->serial, NULL, 0, - cyls, heads, secs, trans) < 0) { - error_report("Can't set up IDE drive %s", dinfo->id); - exit(1); - } - bdrv_attach_dev_nofail(dinfo->bdrv, &bus->ifs[i]); - } else { - ide_reset(&bus->ifs[i]); + qemu_opts_loc_restore(dinfo->opts); + error_report("IDE controller not qdevified yet; drive %s ignored", + dinfo->id); } + ide_reset(&bus->ifs[i]); } bus->irq = irq; bus->dma = &ide_dma_nop; + loc_pop(&loc); } static const MemoryRegionPortio ide_portio_list[] = { -- 1.7.11.7