qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: mrezanin@redhat.com, qemu-devel@nongnu.org
Cc: armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCHv3 1/2] Move parallel_hds_isa_init to hw/isa/isa-bus.c
Date: Tue, 12 May 2015 15:22:16 +0200	[thread overview]
Message-ID: <5551FE88.8060801@redhat.com> (raw)
In-Reply-To: <9c01b2089bb2a10d8674d4c79a81b88d3f2866d9.1431411260.git.mrezanin@redhat.com>



On 12/05/2015 08:22, mrezanin@redhat.com wrote:
> From: Miroslav Rezanina <mrezanin@redhat.com>
> 
> 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.
> 
> Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
> ---
>  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;
> +    }
> +    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]);
> +        }
> +    }
> +}
> 

ACK

Paolo

  reply	other threads:[~2015-05-12 13:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-12  6:22 [Qemu-devel] [PATCHv3 0/2] parallel: Allow to disable CONFIG_PARALLEL mrezanin
2015-05-12  6:22 ` [Qemu-devel] [PATCHv3 1/2] Move parallel_hds_isa_init to hw/isa/isa-bus.c mrezanin
2015-05-12 13:22   ` Paolo Bonzini [this message]
2015-05-13  8:01   ` Markus Armbruster
2015-05-13  8:57     ` Miroslav Rezanina
2015-05-12  6:22 ` [Qemu-devel] [PATCHv3 2/2] stubs: Provide parallel_mm_init stub version mrezanin
2015-05-12 13:22   ` Paolo Bonzini
2015-05-13  8:04     ` Markus Armbruster
2015-05-13  8:58       ` Miroslav Rezanina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5551FE88.8060801@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=armbru@redhat.com \
    --cc=mrezanin@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).