From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ce6FR-00007g-VO for qemu-devel@nongnu.org; Wed, 15 Feb 2017 15:32:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ce6FQ-0001rX-S7 for qemu-devel@nongnu.org; Wed, 15 Feb 2017 15:32:21 -0500 References: <1487153147-11530-1-git-send-email-armbru@redhat.com> <1487153147-11530-9-git-send-email-armbru@redhat.com> From: John Snow Message-ID: <25d26460-9a09-b532-48d1-fad104f9c79c@redhat.com> Date: Wed, 15 Feb 2017 15:32:12 -0500 MIME-Version: 1.0 In-Reply-To: <1487153147-11530-9-git-send-email-armbru@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 8/8] hw: Drop superfluous special checks for orphaned -drive List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: kwolf@redhat.com, mreitz@redhat.com, qemu-block@nongnu.org, =?UTF-8?Q?Herv=c3=a9_Poussineau?= , Mark Cave-Ayland On 02/15/2017 05:05 AM, Markus Armbruster wrote: > We've traditionally rejected orphans here and there, but not > systematically. For instance, the sun4m machines have an onboard SCSI > HBA (bus=3D0), and have always rejected bus>0. Other machines with an > onboard SCSI HBA don't. >=20 > Commit a66c9dc made all orphans trigger a warning, and the previous > commit turned this into an error. The checks "here and there" are now > redundant. Drop them. >=20 > Note that the one in mips_jazz.c was wrong: it rejected bus > MAX_FD, > but MAX_FD is the number of floppy drives per bus. >=20 > Error messages change from >=20 > $ qemu-system-x86_64 -drive if=3Dide,bus=3D2 > qemu-system-x86_64: Too many IDE buses defined (3 > 2) > $ qemu-system-mips64 -M magnum,accel=3Dqtest -drive if=3Dfloppy,bus= =3D2,id=3Dfd1 > qemu: too many floppy drives > $ qemu-system-sparc -M LX -drive if=3Dscsi,bus=3D1 > qemu: too many SCSI bus >=20 > to >=20 > $ qemu-system-x86_64 -drive if=3Dide,bus=3D2 > qemu-system-x86_64: -drive if=3Dide,bus=3D2: machine type does not = support if=3Dide,bus=3D2,unit=3D0 > $ qemu-system-mips64 -M magnum,accel=3Dqtest -drive if=3Dfloppy,bus= =3D2,id=3Dfd1 > qemu-system-mips64: -drive if=3Dfloppy,bus=3D2,id=3Dfd1: machine ty= pe does not support if=3Dfloppy,bus=3D2,unit=3D0 > $ qemu-system-sparc -M LX -drive if=3Dscsi,bus=3D1 > qemu-system-sparc: -drive if=3Dscsi,bus=3D1: machine type does not = support if=3Dscsi,bus=3D1,unit=3D0 >=20 > Cc: John Snow > Cc: "Herv=C3=A9 Poussineau" > Cc: Mark Cave-Ayland > Signed-off-by: Markus Armbruster > --- > hw/ide/core.c | 17 ----------------- > hw/mips/mips_jazz.c | 4 ---- > hw/sparc/sun4m.c | 5 ----- > 3 files changed, 26 deletions(-) >=20 > diff --git a/hw/ide/core.c b/hw/ide/core.c > index 43709e5..cfa5de6 100644 > --- a/hw/ide/core.c > +++ b/hw/ide/core.c > @@ -2840,23 +2840,6 @@ const VMStateDescription vmstate_ide_bus =3D { > void ide_drive_get(DriveInfo **hd, int n) > { > int i; > - int highest_bus =3D drive_get_max_bus(IF_IDE) + 1; > - int max_devs =3D drive_get_max_devs(IF_IDE); > - int n_buses =3D max_devs ? (n / max_devs) : n; > - > - /* > - * Note: The number of actual buses available is not known. > - * We compute this based on the size of the DriveInfo* array, n. > - * If it is less than max_devs * , > - * We will stop looking for drives prematurely instead of overfill= ing > - * the array. > - */ > - > - if (highest_bus > n_buses) { > - error_report("Too many IDE buses defined (%d > %d)", > - highest_bus, n_buses); > - exit(1); > - } > =20 > for (i =3D 0; i < n; i++) { > hd[i] =3D drive_get_by_index(IF_IDE, i); > diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c > index 73f6c9f..1cef581 100644 > --- a/hw/mips/mips_jazz.c > +++ b/hw/mips/mips_jazz.c > @@ -291,10 +291,6 @@ static void mips_jazz_init(MachineState *machine, > qdev_get_gpio_in(rc4030, 5), &esp_reset, &dma_enable); > =20 > /* Floppy */ > - if (drive_get_max_bus(IF_FLOPPY) >=3D MAX_FD) { > - fprintf(stderr, "qemu: too many floppy drives\n"); > - exit(1); > - } > for (n =3D 0; n < MAX_FD; n++) { > fds[n] =3D drive_get(IF_FLOPPY, 0, n); > } > diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c > index f5b6efd..61416a6 100644 > --- a/hw/sparc/sun4m.c > +++ b/hw/sparc/sun4m.c > @@ -989,11 +989,6 @@ static void sun4m_hw_init(const struct sun4m_hwdef= *hwdef, > slavio_misc_init(hwdef->slavio_base, hwdef->aux1_base, hwdef->aux2= _base, > slavio_irq[30], fdc_tc); > =20 > - if (drive_get_max_bus(IF_SCSI) > 0) { > - fprintf(stderr, "qemu: too many SCSI bus\n"); > - exit(1); > - } > - > esp_init(hwdef->esp_base, 2, > espdma_memory_read, espdma_memory_write, > espdma, espdma_irq, &esp_reset, &dma_enable); >=20 http://i.imgur.com/v1Lvzb1.jpg Reviewed-by: John Snow