Received: from eggs.gnu.org ([2001:4830:134:3::10]:43867) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsSU8-0001M3-Kf for qemu-devel@nongnu.org; Wed, 13 May 2015 04:57:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YsSU5-0006mq-1w for qemu-devel@nongnu.org; Wed, 13 May 2015 04:57:48 -0400 Received: from 212-4-128-36.cust.selfnet.cz ([212.4.128.36]:57845 helo=workimage.brq.redhat.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsSU4-0006mL-ML for qemu-devel@nongnu.org; Wed, 13 May 2015 04:57:44 -0400 Date: Wed, 13 May 2015 10:57:42 +0200 From: Miroslav Rezanina Message-ID: <20150513085742.GA14442@lws.brq.redhat.com> References: <9c01b2089bb2a10d8674d4c79a81b88d3f2866d9.1431411260.git.mrezanin@redhat.com> <87wq0csy7r.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87wq0csy7r.fsf@blackfin.pond.sub.org> Subject: Re: [Qemu-devel] [PATCHv3 1/2] Move parallel_hds_isa_init to hw/isa/isa-bus.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: pbonzini@redhat.com, qemu-devel@nongnu.org On Wed, May 13, 2015 at 10:01:12AM +0200, Markus Armbruster wrote: > mrezanin@redhat.com writes: > > > From: Miroslav Rezanina > > > > Disabling CONFIG_PARALLEL cause removing parallel_hds_isa_init defined in > > parallel.c. This function is called during initialization of some boards so > > disabling CONFIG_PARALLEL cause build failure. > > > > This patch moves parallel_hds_isa_init to hw/isa/isa-bus.c so it is included > > in case of disabled CONFIG_PARALLEL. Build is successful but qemu will abort > > with "Unknown device" error when function is called. > > Can't reproduce this error. Test case: compile with CONFIG_PARALLEL=y > taken out, run like > > $ qemu-system-x86_64 -nodefaults -S -display none -parallel stdio > > > Signed-off-by: Miroslav Rezanina > > --- > > hw/char/parallel.c | 25 ------------------------- > > hw/isa/isa-bus.c | 29 +++++++++++++++++++++++++++++ > > 2 files changed, 29 insertions(+), 25 deletions(-) > > > > diff --git a/hw/char/parallel.c b/hw/char/parallel.c > > index 4079554..c2b553f 100644 > > --- a/hw/char/parallel.c > > +++ b/hw/char/parallel.c > > @@ -641,28 +641,3 @@ static void parallel_register_types(void) > > } > > > > type_init(parallel_register_types) > > - > > -static void parallel_init(ISABus *bus, int index, CharDriverState *chr) > > -{ > > - DeviceState *dev; > > - ISADevice *isadev; > > - > > - isadev = isa_create(bus, "isa-parallel"); > > - dev = DEVICE(isadev); > > - qdev_prop_set_uint32(dev, "index", index); > > - qdev_prop_set_chr(dev, "chardev", chr); > > - qdev_init_nofail(dev); > > -} > > - > > -void parallel_hds_isa_init(ISABus *bus, int n) > > -{ > > - int i; > > - > > - assert(n <= MAX_PARALLEL_PORTS); > > - > > - for (i = 0; i < n; i++) { > > - if (parallel_hds[i]) { > > - parallel_init(bus, i, parallel_hds[i]); > > - } > > - } > > -} > > diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c > > index 825aa62..94f645c 100644 > > --- a/hw/isa/isa-bus.c > > +++ b/hw/isa/isa-bus.c > > @@ -21,6 +21,7 @@ > > #include "hw/sysbus.h" > > #include "sysemu/sysemu.h" > > #include "hw/isa/isa.h" > > +#include "hw/i386/pc.h" > > > > static ISABus *isabus; > > > > @@ -267,3 +268,31 @@ MemoryRegion *isa_address_space_io(ISADevice *dev) > > } > > > > type_init(isabus_register_types) > > + > > +static void parallel_init(ISABus *bus, int index, CharDriverState *chr) > > +{ > > + DeviceState *dev; > > + ISADevice *isadev; > > + > > + isadev = isa_try_create(bus, "isa-parallel"); > > + if (!isadev) { > > + return; > > + } > > Not just code motion! You change the code to ignore the error. > > If that's what we want, the commit message needs fixing. Ouch,this is mixed in change from different code version. Intention was to move code only. This is the reason to different behavior. I will send fixed version. Mirek > > > + dev = DEVICE(isadev); > > + qdev_prop_set_uint32(dev, "index", index); > > + qdev_prop_set_chr(dev, "chardev", chr); > > + qdev_init_nofail(dev); > > +} > > + > > +void parallel_hds_isa_init(ISABus *bus, int n) > > +{ > > + int i; > > + > > + assert(n <= MAX_PARALLEL_PORTS); > > + > > + for (i = 0; i < n; i++) { > > + if (parallel_hds[i]) { > > + parallel_init(bus, i, parallel_hds[i]); > > + } > > + } > > +}