qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCHv3 0/2] parallel: Allow to disable CONFIG_PARALLEL
@ 2015-05-12  6:22 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  6:22 ` [Qemu-devel] [PATCHv3 2/2] stubs: Provide parallel_mm_init stub version mrezanin
  0 siblings, 2 replies; 9+ messages in thread
From: mrezanin @ 2015-05-12  6:22 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, Miroslav Rezanina, armbru

From: Miroslav Rezanina <mrezanin@redhat.com>

There's few uncoditional calls to functions in hw/char/parallel.c so
disabling CONFIG_PARALLEL can cause build failure. This series allow
building with CONFIG_PARALLEL disabled. In addition, it changes behavior
so the run of "qemu -parallel" will abort in case target expects parallel
device to exists.

Affected targets are:
- i386 (pc.c)
- mips (mips_fulong2e.c, mips_malta.c, mips_jazz.c)
- sparc64 (sun4u.c)

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Miroslav Rezanina (2):
  Move parallel_hds_isa_init to hw/isa/isa-bus.c
  stubs: Provide parallel_mm_init stub version

 hw/char/parallel.c  | 25 -------------------------
 hw/isa/isa-bus.c    | 29 +++++++++++++++++++++++++++++
 stubs/Makefile.objs |  1 +
 stubs/parallel.c    |  8 ++++++++
 4 files changed, 38 insertions(+), 25 deletions(-)
 create mode 100644 stubs/parallel.c

-- 
2.1.0

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Qemu-devel] [PATCHv3 1/2] Move parallel_hds_isa_init to hw/isa/isa-bus.c
  2015-05-12  6:22 [Qemu-devel] [PATCHv3 0/2] parallel: Allow to disable CONFIG_PARALLEL mrezanin
@ 2015-05-12  6:22 ` mrezanin
  2015-05-12 13:22   ` Paolo Bonzini
  2015-05-13  8:01   ` Markus Armbruster
  2015-05-12  6:22 ` [Qemu-devel] [PATCHv3 2/2] stubs: Provide parallel_mm_init stub version mrezanin
  1 sibling, 2 replies; 9+ messages in thread
From: mrezanin @ 2015-05-12  6:22 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, Miroslav Rezanina, armbru

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]);
+        }
+    }
+}
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Qemu-devel] [PATCHv3 2/2] stubs: Provide parallel_mm_init stub version
  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  6:22 ` mrezanin
  2015-05-12 13:22   ` Paolo Bonzini
  1 sibling, 1 reply; 9+ messages in thread
From: mrezanin @ 2015-05-12  6:22 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, Miroslav Rezanina, armbru

From: Miroslav Rezanina <mrezanin@redhat.com>

mips build fail with link error in case PARALLEL_CONFIG is disabled as
hw/mips/mips_jazz.c calls parallel_mm_init. Due to dependecies to content
of parallel.c we can't simply move it to hw/isa/isa-devices.c.

This patch adds stubs/parallel.c file that contains stub version of
parallel_mm_init. This ensure successful build with PARALLEL_CONFIG disabled.

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 stubs/Makefile.objs | 1 +
 stubs/parallel.c    | 8 ++++++++
 2 files changed, 9 insertions(+)
 create mode 100644 stubs/parallel.c

diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
index 8beff4c..ad4e110 100644
--- a/stubs/Makefile.objs
+++ b/stubs/Makefile.objs
@@ -24,6 +24,7 @@ stub-obj-y += mon-printf.o
 stub-obj-y += mon-set-error.o
 stub-obj-y += monitor-init.o
 stub-obj-y += notify-event.o
+stub-obj-y += parallel.o
 stub-obj-$(CONFIG_SPICE) += qemu-chr-open-spice.o
 stub-obj-y += qtest.o
 stub-obj-y += reset.o
diff --git a/stubs/parallel.c b/stubs/parallel.c
new file mode 100644
index 0000000..8293d52
--- /dev/null
+++ b/stubs/parallel.c
@@ -0,0 +1,8 @@
+#include "hw/i386/pc.h"
+
+bool parallel_mm_init(MemoryRegion *address_space,
+                      hwaddr base, int it_shift, qemu_irq irq,
+                      CharDriverState *chr)
+{
+    return false;
+}
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCHv3 1/2] Move parallel_hds_isa_init to hw/isa/isa-bus.c
  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
  2015-05-13  8:01   ` Markus Armbruster
  1 sibling, 0 replies; 9+ messages in thread
From: Paolo Bonzini @ 2015-05-12 13:22 UTC (permalink / raw)
  To: mrezanin, qemu-devel; +Cc: armbru



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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCHv3 2/2] stubs: Provide parallel_mm_init stub version
  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
  0 siblings, 1 reply; 9+ messages in thread
From: Paolo Bonzini @ 2015-05-12 13:22 UTC (permalink / raw)
  To: mrezanin, qemu-devel; +Cc: armbru



On 12/05/2015 08:22, mrezanin@redhat.com wrote:
> From: Miroslav Rezanina <mrezanin@redhat.com>
> 
> mips build fail with link error in case PARALLEL_CONFIG is disabled as
> hw/mips/mips_jazz.c calls parallel_mm_init. Due to dependecies to content
> of parallel.c we can't simply move it to hw/isa/isa-devices.c.
> 
> This patch adds stubs/parallel.c file that contains stub version of
> parallel_mm_init. This ensure successful build with PARALLEL_CONFIG disabled.
> 
> Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
> ---
>  stubs/Makefile.objs | 1 +
>  stubs/parallel.c    | 8 ++++++++
>  2 files changed, 9 insertions(+)
>  create mode 100644 stubs/parallel.c
> 
> diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
> index 8beff4c..ad4e110 100644
> --- a/stubs/Makefile.objs
> +++ b/stubs/Makefile.objs
> @@ -24,6 +24,7 @@ stub-obj-y += mon-printf.o
>  stub-obj-y += mon-set-error.o
>  stub-obj-y += monitor-init.o
>  stub-obj-y += notify-event.o
> +stub-obj-y += parallel.o
>  stub-obj-$(CONFIG_SPICE) += qemu-chr-open-spice.o
>  stub-obj-y += qtest.o
>  stub-obj-y += reset.o
> diff --git a/stubs/parallel.c b/stubs/parallel.c
> new file mode 100644
> index 0000000..8293d52
> --- /dev/null
> +++ b/stubs/parallel.c
> @@ -0,0 +1,8 @@
> +#include "hw/i386/pc.h"
> +
> +bool parallel_mm_init(MemoryRegion *address_space,
> +                      hwaddr base, int it_shift, qemu_irq irq,
> +                      CharDriverState *chr)
> +{
> +    return false;
> +}
> 

I think removing CONFIG_PARALLEL from a board that hardcodes its
presence makes little sense, so I would just drop this patch.

Paolo

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCHv3 1/2] Move parallel_hds_isa_init to hw/isa/isa-bus.c
  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
@ 2015-05-13  8:01   ` Markus Armbruster
  2015-05-13  8:57     ` Miroslav Rezanina
  1 sibling, 1 reply; 9+ messages in thread
From: Markus Armbruster @ 2015-05-13  8:01 UTC (permalink / raw)
  To: mrezanin; +Cc: pbonzini, qemu-devel

mrezanin@redhat.com writes:

> 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.

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 <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;
> +    }

Not just code motion!  You change the code to ignore the error.

If that's what we want, the commit message needs fixing.

> +    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]);
> +        }
> +    }
> +}

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCHv3 2/2] stubs: Provide parallel_mm_init stub version
  2015-05-12 13:22   ` Paolo Bonzini
@ 2015-05-13  8:04     ` Markus Armbruster
  2015-05-13  8:58       ` Miroslav Rezanina
  0 siblings, 1 reply; 9+ messages in thread
From: Markus Armbruster @ 2015-05-13  8:04 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: mrezanin, qemu-devel

Paolo Bonzini <pbonzini@redhat.com> writes:

> On 12/05/2015 08:22, mrezanin@redhat.com wrote:
>> From: Miroslav Rezanina <mrezanin@redhat.com>
>> 
>> mips build fail with link error in case PARALLEL_CONFIG is disabled as
>> hw/mips/mips_jazz.c calls parallel_mm_init. Due to dependecies to content
>> of parallel.c we can't simply move it to hw/isa/isa-devices.c.
>> 
>> This patch adds stubs/parallel.c file that contains stub version of
>> parallel_mm_init. This ensure successful build with PARALLEL_CONFIG disabled.
>> 
>> Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
>> ---
>>  stubs/Makefile.objs | 1 +
>>  stubs/parallel.c    | 8 ++++++++
>>  2 files changed, 9 insertions(+)
>>  create mode 100644 stubs/parallel.c
>> 
>> diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
>> index 8beff4c..ad4e110 100644
>> --- a/stubs/Makefile.objs
>> +++ b/stubs/Makefile.objs
>> @@ -24,6 +24,7 @@ stub-obj-y += mon-printf.o
>>  stub-obj-y += mon-set-error.o
>>  stub-obj-y += monitor-init.o
>>  stub-obj-y += notify-event.o
>> +stub-obj-y += parallel.o
>>  stub-obj-$(CONFIG_SPICE) += qemu-chr-open-spice.o
>>  stub-obj-y += qtest.o
>>  stub-obj-y += reset.o
>> diff --git a/stubs/parallel.c b/stubs/parallel.c
>> new file mode 100644
>> index 0000000..8293d52
>> --- /dev/null
>> +++ b/stubs/parallel.c
>> @@ -0,0 +1,8 @@
>> +#include "hw/i386/pc.h"
>> +
>> +bool parallel_mm_init(MemoryRegion *address_space,
>> +                      hwaddr base, int it_shift, qemu_irq irq,
>> +                      CharDriverState *chr)
>> +{
>> +    return false;
>> +}
>> 
>
> I think removing CONFIG_PARALLEL from a board that hardcodes its
> presence makes little sense, so I would just drop this patch.

I pointed Mirek to parallel_mm_init().  Second thoughts: since we don't
know omitting the device breaks guests, and aren't really interested in
finding out, let's leave things as they are, i.e. drop this patch.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCHv3 1/2] Move parallel_hds_isa_init to hw/isa/isa-bus.c
  2015-05-13  8:01   ` Markus Armbruster
@ 2015-05-13  8:57     ` Miroslav Rezanina
  0 siblings, 0 replies; 9+ messages in thread
From: Miroslav Rezanina @ 2015-05-13  8:57 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: pbonzini, qemu-devel

On Wed, May 13, 2015 at 10:01:12AM +0200, Markus Armbruster wrote:
> mrezanin@redhat.com writes:
> 
> > 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.
> 
> 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 <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;
> > +    }
> 
> 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]);
> > +        }
> > +    }
> > +}

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCHv3 2/2] stubs: Provide parallel_mm_init stub version
  2015-05-13  8:04     ` Markus Armbruster
@ 2015-05-13  8:58       ` Miroslav Rezanina
  0 siblings, 0 replies; 9+ messages in thread
From: Miroslav Rezanina @ 2015-05-13  8:58 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: Paolo Bonzini, qemu-devel

On Wed, May 13, 2015 at 10:04:23AM +0200, Markus Armbruster wrote:
> Paolo Bonzini <pbonzini@redhat.com> writes:
> 
> > On 12/05/2015 08:22, mrezanin@redhat.com wrote:
> >> From: Miroslav Rezanina <mrezanin@redhat.com>
> >> 
> >> mips build fail with link error in case PARALLEL_CONFIG is disabled as
> >> hw/mips/mips_jazz.c calls parallel_mm_init. Due to dependecies to content
> >> of parallel.c we can't simply move it to hw/isa/isa-devices.c.
> >> 
> >> This patch adds stubs/parallel.c file that contains stub version of
> >> parallel_mm_init. This ensure successful build with PARALLEL_CONFIG disabled.
> >> 
> >> Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
> >> ---
> >>  stubs/Makefile.objs | 1 +
> >>  stubs/parallel.c    | 8 ++++++++
> >>  2 files changed, 9 insertions(+)
> >>  create mode 100644 stubs/parallel.c
> >> 
> >> diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
> >> index 8beff4c..ad4e110 100644
> >> --- a/stubs/Makefile.objs
> >> +++ b/stubs/Makefile.objs
> >> @@ -24,6 +24,7 @@ stub-obj-y += mon-printf.o
> >>  stub-obj-y += mon-set-error.o
> >>  stub-obj-y += monitor-init.o
> >>  stub-obj-y += notify-event.o
> >> +stub-obj-y += parallel.o
> >>  stub-obj-$(CONFIG_SPICE) += qemu-chr-open-spice.o
> >>  stub-obj-y += qtest.o
> >>  stub-obj-y += reset.o
> >> diff --git a/stubs/parallel.c b/stubs/parallel.c
> >> new file mode 100644
> >> index 0000000..8293d52
> >> --- /dev/null
> >> +++ b/stubs/parallel.c
> >> @@ -0,0 +1,8 @@
> >> +#include "hw/i386/pc.h"
> >> +
> >> +bool parallel_mm_init(MemoryRegion *address_space,
> >> +                      hwaddr base, int it_shift, qemu_irq irq,
> >> +                      CharDriverState *chr)
> >> +{
> >> +    return false;
> >> +}
> >> 
> >
> > I think removing CONFIG_PARALLEL from a board that hardcodes its
> > presence makes little sense, so I would just drop this patch.
> 
> I pointed Mirek to parallel_mm_init().  Second thoughts: since we don't
> know omitting the device breaks guests, and aren't really interested in
> finding out, let's leave things as they are, i.e. drop this patch.

Ok, v4 will be patch 1 only.

Mirek

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-05-13  8:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).