From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IrcOw-0006RR-Un for qemu-devel@nongnu.org; Mon, 12 Nov 2007 11:44:43 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IrcOv-0006OX-EF for qemu-devel@nongnu.org; Mon, 12 Nov 2007 11:44:42 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IrcOv-0006OA-4B for qemu-devel@nongnu.org; Mon, 12 Nov 2007 11:44:41 -0500 Received: from nf-out-0910.google.com ([64.233.182.188]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IrcOt-0005Ga-Jt for qemu-devel@nongnu.org; Mon, 12 Nov 2007 11:44:40 -0500 Received: by nf-out-0910.google.com with SMTP id 30so1131101nfu for ; Mon, 12 Nov 2007 08:44:37 -0800 (PST) Message-ID: Date: Mon, 12 Nov 2007 18:44:37 +0200 From: "Blue Swirl" Subject: Re: [Qemu-devel] [PATCH 2/2][UPDATE] Add arg -drive to define new drive with more features In-Reply-To: <11948799213737@bull.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1194879921937@bull.net> <11948799213737@bull.net> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier , qemu-devel@nongnu.org On 11/12/07, Laurent Vivier wrote: > It also defines the default interface type to "scsi" for targets > "realview", "SS-5", "SS-10", "versatilepb", "versatileab" > to keep old behavior, where "-hda" is a SCSI disk. For maximal compatibility, I'd like the following mappings for SS-5, SS-10, and SS-600MP: -hda = SCSI ID 0 -hdb = SCSI ID 1 -hdc = -cdrom = SCSI ID 2 -hdd = SCSI ID 3 There is no bus 1, only 0. Maybe a warning should be issued for bus=1. I didn't find where this was implemented, so is the above in line with the patch? > Index: qemu/hw/sun4m.c > - if (hwdef->fd_base != (target_phys_addr_t)-1) > - sun4m_fdctrl_init(slavio_irq[hwdef->fd_irq], hwdef->fd_base, fd_table); > + if (hwdef->fd_base != (target_phys_addr_t)-1) { > + for(i = 0; i < MAX_FD; i++) { > + index = drive_get_index(IF_FLOPPY, 0, i); > + if (index != -1) > + fd[i] = drives_table[index].bdrv; > + else > + fd[i] = NULL; > + } > + > + sun4m_fdctrl_init(slavio_irq[hwdef->fd_irq], hwdef->fd_base, fd); > + } This is broken, there are zero or one floppy drives, never more. > Index: qemu/hw/sun4u.c > - floppy_controller = fdctrl_init(NULL/*6*/, 2, 0, 0x3f0, fd_table); > + for(i = 0; i < MAX_FD; i++) { > + index = drive_get_index(IF_FLOPPY, 0, i); > + if (index != -1) > + fd[i] = drives_table[index].bdrv; > + else > + fd[i] = NULL; > + } > + floppy_controller = fdctrl_init(NULL/*6*/, 2, 0, 0x3f0, fd); I think same applies here (0 to 1 drives), but as the hardware is PC-like, technically it may be possible that someone could replace the cables and insert additional floppy drives.