From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IrcXg-00038w-5P for qemu-devel@nongnu.org; Mon, 12 Nov 2007 11:53:44 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IrcXe-00038H-J2 for qemu-devel@nongnu.org; Mon, 12 Nov 2007 11:53:43 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IrcXe-000389-EA for qemu-devel@nongnu.org; Mon, 12 Nov 2007 11:53:42 -0500 Received: from ecfrec.frec.bull.fr ([129.183.4.8]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IrcXb-0001ug-1F for qemu-devel@nongnu.org; Mon, 12 Nov 2007 11:53:39 -0500 Subject: Re: [Qemu-devel] [PATCH 2/2][UPDATE] Add arg -drive to define new drive with more features From: Laurent Vivier In-Reply-To: References: <1194879921937@bull.net> <11948799213737@bull.net> Date: Mon, 12 Nov 2007 17:53:07 +0100 Message-Id: <1194886387.8525.12.camel@frecb07144> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-GUbcVst9aH3nZ81gtAtY" Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel@nongnu.org --=-GUbcVst9aH3nZ81gtAtY Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Le lundi 12 novembre 2007 =C3=A0 18:44 +0200, Blue Swirl a =C3=A9crit : > 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. >=20 > For maximal compatibility, I'd like the following mappings for SS-5, > SS-10, and SS-600MP: > -hda =3D SCSI ID 0 > -hdb =3D SCSI ID 1 > -hdc =3D -cdrom =3D SCSI ID 2 > -hdd =3D SCSI ID 3 Yes, there is mistake there. > There is no bus 1, only 0. Maybe a warning should be issued for bus=3D1. > I didn't find where this was implemented, so is the above in line with > the patch? See following lines: ... #define HD_ALIAS "file=3D%s,bus=3D%d,unit=3D%d,media=3Ddisk" ... if (!strcmp(machine->name, "realview") || !strcmp(machine->name, "SS-5") || !strcmp(machine->name, "SS-10") || !strcmp(machine->name, "versatilepb") || !strcmp(machine->name, "versatileab")) { interface =3D IF_SCSI; max_devs =3D MAX_SCSI_DEVS; } else { interface =3D IF_IDE; max_devs =3D MAX_IDE_DEVS; } ... case QEMU_OPTION_hdb: case QEMU_OPTION_hdc: case QEMU_OPTION_hdd: drive_add(HD_ALIAS, optarg, hd_index / MAX_IDE_DEVS, hd_index % MAX_IDE_DEVS); ... Of course this last line is wrong... > > Index: qemu/hw/sun4m.c >=20 > > - if (hwdef->fd_base !=3D (target_phys_addr_t)-1) > > - sun4m_fdctrl_init(slavio_irq[hwdef->fd_irq], hwdef->fd_base, f= d_table); > > + if (hwdef->fd_base !=3D (target_phys_addr_t)-1) { > > + for(i =3D 0; i < MAX_FD; i++) { > > + index =3D drive_get_index(IF_FLOPPY, 0, i); > > + if (index !=3D -1) > > + fd[i] =3D drives_table[index].bdrv; > > + else > > + fd[i] =3D NULL; > > + } > > + > > + sun4m_fdctrl_init(slavio_irq[hwdef->fd_irq], hwdef->fd_base, f= d); > > + } >=20 > This is broken, there are zero or one floppy drives, never more. I just try to mimic original behavior. I'll correct this. > > Index: qemu/hw/sun4u.c >=20 > > - floppy_controller =3D fdctrl_init(NULL/*6*/, 2, 0, 0x3f0, fd_table= ); > > + for(i =3D 0; i < MAX_FD; i++) { > > + index =3D drive_get_index(IF_FLOPPY, 0, i); > > + if (index !=3D -1) > > + fd[i] =3D drives_table[index].bdrv; > > + else > > + fd[i] =3D NULL; > > + } > > + floppy_controller =3D fdctrl_init(NULL/*6*/, 2, 0, 0x3f0, fd); >=20 > 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. ditto Laurent --=20 ------------- Laurent.Vivier@bull.net -------------- "In short: just say NO TO DRUGS and maybe you won't end up like the Hurd people." -- Linus Torvald --=-GUbcVst9aH3nZ81gtAtY Content-Type: application/pgp-signature; name=signature.asc Content-Description: Ceci est une partie de message =?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?= -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQBHOITz9Kffa9pFVzwRAvMUAKDEMRW7FkcnpMlo1oDIaqjzzRMalwCZAarS T4iZTY9KLpjcS7Mb8uOxuFA= =wRP5 -----END PGP SIGNATURE----- --=-GUbcVst9aH3nZ81gtAtY--