Received: from eggs.gnu.org ([2001:4830:134:3::10]:34332) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaiSu-0008Fk-Sd for qemu-devel@nongnu.org; Wed, 25 Mar 2015 06:23:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YaiSq-0004az-RE for qemu-devel@nongnu.org; Wed, 25 Mar 2015 06:23:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45286) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaiSq-0004av-K3 for qemu-devel@nongnu.org; Wed, 25 Mar 2015 06:23:08 -0400 From: Markus Armbruster References: <1427137790-27265-1-git-send-email-armbru@redhat.com> <55113AE7.1070506@redhat.com> <877fu68ssm.fsf@blackfin.pond.sub.org> <551179BB.4040201@redhat.com> <87d23y4e5h.fsf@blackfin.pond.sub.org> <323733322.3820871.1427214043347.JavaMail.zimbra@redhat.com> <87zj72cgdw.fsf@blackfin.pond.sub.org> Date: Wed, 25 Mar 2015 11:23:05 +0100 In-Reply-To: <87zj72cgdw.fsf@blackfin.pond.sub.org> (Markus Armbruster's message of "Tue, 24 Mar 2015 21:03:23 +0100") Message-ID: <87d23x9y0m.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH for-2.3 0/3] Contain drive_get() misuse List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: peter maydell , peter crosthwaite , qemu-devel@nongnu.org, michael@walle.cc, edgar iglesias , Andreas =?utf-8?Q?F=C3=A4rbe?= =?utf-8?Q?r?= Markus Armbruster writes: [...] > * "allwinner-a10" > > "-nodefaults -serial null -device allwinner-a10" doesn't explode, > which means I can't exclude the possibility that this might actually > do something useful for someone. I'd say we treat it just like > "pc87312": leave alone now, document incompatible change. [...] > How could this kind of mistake could look like in NIC device models? > "allwinner-a10"'s instance_init aw_a10_init() provides a clue: it messes > with qemu_check_nic_model(): > > if (nd_table[0].used) { > qemu_check_nic_model(&nd_table[0], TYPE_AW_EMAC); > qdev_set_nic_properties(DEVICE(&s->emac), &nd_table[0]); > } > > No other device does that. Without -nodefaults, this fails: > > -device allwinner-a10: Unsupported NIC model: xgmac Even better: $ qemu-system-arm -S -M highbank -monitor stdio QEMU 2.2.90 monitor - type 'help' for more information (qemu) device_add allwinner-a10 Unsupported NIC model: xgmac [Exit 1 ] exit() in monitor command, big no-no. Machine type doesn't matter. To get past this, nd_table[0] must have model=allwinner-emac. With -net nic,model=allwinner-emac, it has, and we get to the next round of failures: * cubieboard Board already creates an allwinner-a10, and creating a second one with -device or device_add aborts. * Any other board with an onboard NIC, e.g. highbank Refuses to start, as board doesn't support model=allwinner-emac: qemu-system-arm: Unsupported NIC model: allwinner-emac * Any other board without an onboard NIC, e.g. virt Warns on startup: Warning: requested NIC (anonymous, model allwinner-emac) was not created (not supported by this machine? -device / device_add allwinner-a10 succeeds, as long as serial_hds[0] is set. If you suppress it with -nodefaults, -device / device_add exit()s (no-no again) with Can't create serial device, empty char device If the board has an onboard serial (e.g. collie), both the onboard serial and the allwinner-a10 get are now connected to it. Not going to work. We normally catch this error, but bypassing qdev properties also bypasses the check. Actual use of -device / device_add allwinner-a10 seems vanishingly unlikely. Thus, setting cannot_instantiate_with_device_add_yet is unlikely to break anything. Let's do it to mask the "device_add exit()s" bug. > I haven't checked all uses of nd_table[]. I have now, this is the only offender.