diff mbox

[v2,11/11] xilinx_axidma: changed device name

Message ID 18cf993e615d81b1f7f2a71d6ef696a20089022d.1339562634.git.peter.crosthwaite@petalogix.com
State New
Headers show

Commit Message

Peter A. G. Crosthwaite June 13, 2012, 4:46 a.m. UTC
Changed device name to xlnx,axi-dma. This is the exact name of the device in the
Xilinx EDK development tools.

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
---
 hw/xilinx.h        |    2 +-
 hw/xilinx_axidma.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Andreas Färber June 15, 2012, 11:30 a.m. UTC | #1
Am 13.06.2012 06:46, schrieb Peter A. G. Crosthwaite:
> Changed device name to xlnx,axi-dma. This is the exact name of the device in the
> Xilinx EDK development tools.
> 
> Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>

Same here. Please review more carefully.

/-F

> ---
>  hw/xilinx.h        |    2 +-
>  hw/xilinx_axidma.c |    4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/xilinx.h b/hw/xilinx.h
> index 8f915b4..7df21eb 100644
> --- a/hw/xilinx.h
> +++ b/hw/xilinx.h
> @@ -75,7 +75,7 @@ xilinx_axiethernetdma_create(void *dmach,
>  {
>      DeviceState *dev = NULL;
>  
> -    dev = qdev_create(NULL, "xilinx,axidma");
> +    dev = qdev_create(NULL, "xlnx.axi-dma");
>      qdev_prop_set_uint32(dev, "freqhz", freqhz);
>      qdev_prop_set_ptr(dev, "dmach", dmach);
>      qdev_init_nofail(dev);
> diff --git a/hw/xilinx_axidma.c b/hw/xilinx_axidma.c
> index 59373b5..f4bec37 100644
> --- a/hw/xilinx_axidma.c
> +++ b/hw/xilinx_axidma.c
> @@ -473,7 +473,7 @@ static int xilinx_axidma_init(SysBusDevice *dev)
>      xlx_dma_connect_dma(s->dmach, s, axidma_push);
>  
>      memory_region_init_io(&s->iomem, &axidma_ops, s,
> -                          "axidma", R_MAX * 4 * 2);
> +                          "xlnx.axi-dma", R_MAX * 4 * 2);
>      sysbus_init_mmio(dev, &s->iomem);
>  
>      for (i = 0; i < 2; i++) {
> @@ -502,7 +502,7 @@ static void axidma_class_init(ObjectClass *klass, void *data)
>  }
>  
>  static TypeInfo axidma_info = {
> -    .name          = "xilinx,axidma",
> +    .name          = "xlnx.axi-dma",
>      .parent        = TYPE_SYS_BUS_DEVICE,
>      .instance_size = sizeof(struct XilinxAXIDMA),
>      .class_init    = axidma_class_init,
Edgar E. Iglesias June 16, 2012, 1:11 a.m. UTC | #2
On Fri, Jun 15, 2012 at 01:30:17PM +0200, Andreas Färber wrote:
> Am 13.06.2012 06:46, schrieb Peter A. G. Crosthwaite:
> > Changed device name to xlnx,axi-dma. This is the exact name of the device in the
> > Xilinx EDK development tools.
> > 
> > Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
> 
> Same here. Please review more carefully.

Code is an approximation of the real name. Commas are not ok
in QEMU, so dot will do.
If you wan't quality reviews, pay somebody to verify comments vs code.

I'll review best effort when time permits until somone pays me for
doing better. Dont matter what you or anyone says.

Cheers



> 
> /-F
> 
> > ---
> >  hw/xilinx.h        |    2 +-
> >  hw/xilinx_axidma.c |    4 ++--
> >  2 files changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/hw/xilinx.h b/hw/xilinx.h
> > index 8f915b4..7df21eb 100644
> > --- a/hw/xilinx.h
> > +++ b/hw/xilinx.h
> > @@ -75,7 +75,7 @@ xilinx_axiethernetdma_create(void *dmach,
> >  {
> >      DeviceState *dev = NULL;
> >  
> > -    dev = qdev_create(NULL, "xilinx,axidma");
> > +    dev = qdev_create(NULL, "xlnx.axi-dma");
> >      qdev_prop_set_uint32(dev, "freqhz", freqhz);
> >      qdev_prop_set_ptr(dev, "dmach", dmach);
> >      qdev_init_nofail(dev);
> > diff --git a/hw/xilinx_axidma.c b/hw/xilinx_axidma.c
> > index 59373b5..f4bec37 100644
> > --- a/hw/xilinx_axidma.c
> > +++ b/hw/xilinx_axidma.c
> > @@ -473,7 +473,7 @@ static int xilinx_axidma_init(SysBusDevice *dev)
> >      xlx_dma_connect_dma(s->dmach, s, axidma_push);
> >  
> >      memory_region_init_io(&s->iomem, &axidma_ops, s,
> > -                          "axidma", R_MAX * 4 * 2);
> > +                          "xlnx.axi-dma", R_MAX * 4 * 2);
> >      sysbus_init_mmio(dev, &s->iomem);
> >  
> >      for (i = 0; i < 2; i++) {
> > @@ -502,7 +502,7 @@ static void axidma_class_init(ObjectClass *klass, void *data)
> >  }
> >  
> >  static TypeInfo axidma_info = {
> > -    .name          = "xilinx,axidma",
> > +    .name          = "xlnx.axi-dma",
> >      .parent        = TYPE_SYS_BUS_DEVICE,
> >      .instance_size = sizeof(struct XilinxAXIDMA),
> >      .class_init    = axidma_class_init,
> 
> 
> -- 
> SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
> GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Alexander Graf June 27, 2012, 11:06 p.m. UTC | #3
On 16.06.2012, at 03:11, Edgar E. Iglesias wrote:

> On Fri, Jun 15, 2012 at 01:30:17PM +0200, Andreas Färber wrote:
>> Am 13.06.2012 06:46, schrieb Peter A. G. Crosthwaite:
>>> Changed device name to xlnx,axi-dma. This is the exact name of the device in the
>>> Xilinx EDK development tools.
>>> 
>>> Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
>> 
>> Same here. Please review more carefully.
> 
> Code is an approximation of the real name. Commas are not ok
> in QEMU, so dot will do.
> If you wan't quality reviews, pay somebody to verify comments vs code.
> 
> I'll review best effort when time permits until somone pays me for
> doing better. Dont matter what you or anyone says.

Yeah, that's perfectly fine and I don't think anyone would reasonably expect any different from you :). Overall, you have been an awesome maintainer for your components, so thanks a lot for your work :). I'm pretty sure Andreas didn't mean the above the way you perceived it :).

So let me take the chance and rephrase his comment: Why did commas in names work before, but now don't? Or put differently: Was this change on purpose?

> 
> Cheers
> 
> 
> 
>> 
>> /-F
>> 
>>> ---
>>> hw/xilinx.h        |    2 +-
>>> hw/xilinx_axidma.c |    4 ++--
>>> 2 files changed, 3 insertions(+), 3 deletions(-)
>>> 
>>> diff --git a/hw/xilinx.h b/hw/xilinx.h
>>> index 8f915b4..7df21eb 100644
>>> --- a/hw/xilinx.h
>>> +++ b/hw/xilinx.h
>>> @@ -75,7 +75,7 @@ xilinx_axiethernetdma_create(void *dmach,
>>> {
>>>     DeviceState *dev = NULL;
>>> 
>>> -    dev = qdev_create(NULL, "xilinx,axidma");
>>> +    dev = qdev_create(NULL, "xlnx.axi-dma");

comma -> dot

>>>     qdev_prop_set_uint32(dev, "freqhz", freqhz);
>>>     qdev_prop_set_ptr(dev, "dmach", dmach);
>>>     qdev_init_nofail(dev);
>>> diff --git a/hw/xilinx_axidma.c b/hw/xilinx_axidma.c
>>> index 59373b5..f4bec37 100644
>>> --- a/hw/xilinx_axidma.c
>>> +++ b/hw/xilinx_axidma.c
>>> @@ -473,7 +473,7 @@ static int xilinx_axidma_init(SysBusDevice *dev)
>>>     xlx_dma_connect_dma(s->dmach, s, axidma_push);
>>> 
>>>     memory_region_init_io(&s->iomem, &axidma_ops, s,
>>> -                          "axidma", R_MAX * 4 * 2);
>>> +                          "xlnx.axi-dma", R_MAX * 4 * 2);
>>>     sysbus_init_mmio(dev, &s->iomem);
>>> 
>>>     for (i = 0; i < 2; i++) {
>>> @@ -502,7 +502,7 @@ static void axidma_class_init(ObjectClass *klass, void *data)
>>> }
>>> 
>>> static TypeInfo axidma_info = {
>>> -    .name          = "xilinx,axidma",
>>> +    .name          = "xlnx.axi-dma",

comma -> dot


Alex
Peter A. G. Crosthwaite June 28, 2012, 1:08 a.m. UTC | #4
On Thu, Jun 28, 2012 at 9:06 AM, Alexander Graf <agraf@suse.de> wrote:
>
> On 16.06.2012, at 03:11, Edgar E. Iglesias wrote:
>
>> On Fri, Jun 15, 2012 at 01:30:17PM +0200, Andreas Färber wrote:
>>> Am 13.06.2012 06:46, schrieb Peter A. G. Crosthwaite:
>>>> Changed device name to xlnx,axi-dma. This is the exact name of the device in the
>>>> Xilinx EDK development tools.
>>>>
>>>> Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
>>>
>>> Same here. Please review more carefully.
>>
>> Code is an approximation of the real name. Commas are not ok
>> in QEMU, so dot will do.
>> If you wan't quality reviews, pay somebody to verify comments vs code.
>>
>> I'll review best effort when time permits until somone pays me for
>> doing better. Dont matter what you or anyone says.
>
> Yeah, that's perfectly fine and I don't think anyone would reasonably expect any different from you :). Overall, you have been an awesome maintainer for your components, so thanks a lot for your work :). I'm pretty sure Andreas didn't mean the above the way you perceived it :).
>
> So let me take the chance and rephrase his comment: Why did commas in names work before, but now don't? Or put differently: Was this change on purpose?
>
>>
>> Cheers
>>
>>
>>
>>>
>>> /-F
>>>
>>>> ---
>>>> hw/xilinx.h        |    2 +-
>>>> hw/xilinx_axidma.c |    4 ++--
>>>> 2 files changed, 3 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/hw/xilinx.h b/hw/xilinx.h
>>>> index 8f915b4..7df21eb 100644
>>>> --- a/hw/xilinx.h
>>>> +++ b/hw/xilinx.h
>>>> @@ -75,7 +75,7 @@ xilinx_axiethernetdma_create(void *dmach,
>>>> {
>>>>     DeviceState *dev = NULL;
>>>>
>>>> -    dev = qdev_create(NULL, "xilinx,axidma");
>>>> +    dev = qdev_create(NULL, "xlnx.axi-dma");
>
> comma -> dot
>
>>>>     qdev_prop_set_uint32(dev, "freqhz", freqhz);
>>>>     qdev_prop_set_ptr(dev, "dmach", dmach);
>>>>     qdev_init_nofail(dev);
>>>> diff --git a/hw/xilinx_axidma.c b/hw/xilinx_axidma.c
>>>> index 59373b5..f4bec37 100644
>>>> --- a/hw/xilinx_axidma.c
>>>> +++ b/hw/xilinx_axidma.c
>>>> @@ -473,7 +473,7 @@ static int xilinx_axidma_init(SysBusDevice *dev)
>>>>     xlx_dma_connect_dma(s->dmach, s, axidma_push);
>>>>
>>>>     memory_region_init_io(&s->iomem, &axidma_ops, s,
>>>> -                          "axidma", R_MAX * 4 * 2);
>>>> +                          "xlnx.axi-dma", R_MAX * 4 * 2);
>>>>     sysbus_init_mmio(dev, &s->iomem);
>>>>
>>>>     for (i = 0; i < 2; i++) {
>>>> @@ -502,7 +502,7 @@ static void axidma_class_init(ObjectClass *klass, void *data)
>>>> }
>>>>
>>>> static TypeInfo axidma_info = {
>>>> -    .name          = "xilinx,axidma",
>>>> +    .name          = "xlnx.axi-dma",
>
> comma -> dot
>

The -device command line arg. E.G. qemu-system-microblaze -device
xilinx.axidma,foo=bar, ...

If I have ,'s in the device name i need to escape them as they are
syntax in -device.

Regards,
Peter

>
> Alex
>
Andreas Färber June 28, 2012, 12:53 p.m. UTC | #5
Am 16.06.2012 03:11, schrieb Edgar E. Iglesias:
> On Fri, Jun 15, 2012 at 01:30:17PM +0200, Andreas Färber wrote:
>> Am 13.06.2012 06:46, schrieb Peter A. G. Crosthwaite:
>>> Changed device name to xlnx,axi-dma. This is the exact name of the device in the
>>> Xilinx EDK development tools.
>>>
>>> Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
>>
>> Same here. Please review more carefully.

[referring to: Commit message doesn't match the change. Which one is right?]

> Code is an approximation of the real name. Commas are not ok
> in QEMU, so dot will do.
> If you wan't quality reviews, pay somebody to verify comments vs code.
> 
> I'll review best effort when time permits until somone pays me for
> doing better. Dont matter what you or anyone says.

If you want a pay rise, talk to John. But don't take the QEMU community
hostage.

Maybe I was a bit brief, not much time for upstream myself lately: I'm
not bitching about some minor English-language grammar typo that slipped
you by, I am complaining about you committing a patch that claims to do
one thing and in fact does another for the sole thing it is doing.

It would have taken you all of five seconds to fix that yourself - or
ask your colleague to fix it if many you're even in the same office at
Petalogix. I've been student, hobbyist and now professional developer
and my (lack of) payment has never been a criteria for accepting patches
here on qemu-devel. Especially from you as a committer I expect to give
a good role model to Joe developer. Usually you and Peter C. do pretty
well and a simple "Oops, I'll try to catch it next time" plus a review
of which version you guys really intended was all I wanted from you. Is
that really too much to ask?

Listening to what people say to your contributions is part of Open
Source development, I'm pretty sure that's not what you meant to oppose
with the above but it can be read in such a way.

Regards,
Andreas
Andreas Färber June 28, 2012, 1:05 p.m. UTC | #6
Am 28.06.2012 03:08, schrieb Peter Crosthwaite:
> On Thu, Jun 28, 2012 at 9:06 AM, Alexander Graf <agraf@suse.de> wrote:
>>
[...]
>> [...] Why did commas in names work before, but now don't? Or put differently: Was this change on purpose?
[...]
>>>>> ---
>>>>> hw/xilinx.h        |    2 +-
>>>>> hw/xilinx_axidma.c |    4 ++--
>>>>> 2 files changed, 3 insertions(+), 3 deletions(-)
>>>>>
>>>>> diff --git a/hw/xilinx.h b/hw/xilinx.h
>>>>> index 8f915b4..7df21eb 100644
>>>>> --- a/hw/xilinx.h
>>>>> +++ b/hw/xilinx.h
>>>>> @@ -75,7 +75,7 @@ xilinx_axiethernetdma_create(void *dmach,
>>>>> {
>>>>>     DeviceState *dev = NULL;
>>>>>
>>>>> -    dev = qdev_create(NULL, "xilinx,axidma");
>>>>> +    dev = qdev_create(NULL, "xlnx.axi-dma");
>>
>> comma -> dot
>>
>>>>>     qdev_prop_set_uint32(dev, "freqhz", freqhz);
>>>>>     qdev_prop_set_ptr(dev, "dmach", dmach);
>>>>>     qdev_init_nofail(dev);
>>>>> diff --git a/hw/xilinx_axidma.c b/hw/xilinx_axidma.c
>>>>> index 59373b5..f4bec37 100644
>>>>> --- a/hw/xilinx_axidma.c
>>>>> +++ b/hw/xilinx_axidma.c
>>>>> @@ -473,7 +473,7 @@ static int xilinx_axidma_init(SysBusDevice *dev)
>>>>>     xlx_dma_connect_dma(s->dmach, s, axidma_push);
>>>>>
>>>>>     memory_region_init_io(&s->iomem, &axidma_ops, s,
>>>>> -                          "axidma", R_MAX * 4 * 2);
>>>>> +                          "xlnx.axi-dma", R_MAX * 4 * 2);
>>>>>     sysbus_init_mmio(dev, &s->iomem);
>>>>>
>>>>>     for (i = 0; i < 2; i++) {
>>>>> @@ -502,7 +502,7 @@ static void axidma_class_init(ObjectClass *klass, void *data)
>>>>> }
>>>>>
>>>>> static TypeInfo axidma_info = {
>>>>> -    .name          = "xilinx,axidma",
>>>>> +    .name          = "xlnx.axi-dma",
>>
>> comma -> dot
>>
> 
> The -device command line arg. E.G. qemu-system-microblaze -device
> xilinx.axidma,foo=bar, ...
> 
> If I have ,'s in the device name i need to escape them as they are
> syntax in -device.

QOM is perfectly capable of handling commas and SPARC uses "SUNW,", too.
Using QMP in the future (Markus' RFC) should not be a problem either.

Do you really need to construct board-level devices using -device?

Maybe you have a suggestion to fix the syntax escaping issue for
Anthony's suggested -object? Because a comma is rather common in OF/FDT.

Adjusting device names to match what your Xilinx tool set uses sounds
very reasonable. But translating from "," to "." in two places does not
sound superior to translating from "," to ",," in one place to me? Maybe
I'm misunderstanding something? It might help to introduce QOM-style
TYPE_ constants, then the name is in a single location only.

Cheers,
Andreas
Edgar E. Iglesias June 28, 2012, 1:32 p.m. UTC | #7
On Thu, Jun 28, 2012 at 02:53:13PM +0200, Andreas Färber wrote:
> Am 16.06.2012 03:11, schrieb Edgar E. Iglesias:
> > On Fri, Jun 15, 2012 at 01:30:17PM +0200, Andreas Färber wrote:
> >> Am 13.06.2012 06:46, schrieb Peter A. G. Crosthwaite:
> >>> Changed device name to xlnx,axi-dma. This is the exact name of the device in the
> >>> Xilinx EDK development tools.
> >>>
> >>> Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
> >>
> >> Same here. Please review more carefully.
> 
> [referring to: Commit message doesn't match the change. Which one is right?]

...

> Maybe I was a bit brief, not much time for upstream myself lately: I'm

Hi,

Yes me too. I probably missinterpreted your "Please review more carefully"
in a too broad sense and overreacted, sorry.

The name thing came up when Peter wanted to change the names of the devices
to better match xilinx names. I had chosen the names pretty arbitrarily when
adding the devs and figuring they were not really used outside the code, it
seemed OK to change them. I had some vague memory though that the commas
were causing issues with some options, so I asked Peter on the chat to look
at it and that it was probably worth avoiding commas if it caused hassle.

Peter confirmed and changed the names to use dots but I'm guessing forgot
to change the commit msg. When applying the patch, I tested the boards,
they ran and I applied. I didn't look carefully enough at the commit msg.

I've got no problem with chaning to commas if people insist.

Cheers,
Edgar
Peter A. G. Crosthwaite June 29, 2012, 12:34 a.m. UTC | #8
On Thu, Jun 28, 2012 at 11:05 PM, Andreas Färber <afaerber@suse.de> wrote:
> Am 28.06.2012 03:08, schrieb Peter Crosthwaite:
>> On Thu, Jun 28, 2012 at 9:06 AM, Alexander Graf <agraf@suse.de> wrote:
>>>
> [...]
>>> [...] Why did commas in names work before, but now don't? Or put differently: Was this change on purpose?
> [...]
>>>>>> ---
>>>>>> hw/xilinx.h        |    2 +-
>>>>>> hw/xilinx_axidma.c |    4 ++--
>>>>>> 2 files changed, 3 insertions(+), 3 deletions(-)
>>>>>>
>>>>>> diff --git a/hw/xilinx.h b/hw/xilinx.h
>>>>>> index 8f915b4..7df21eb 100644
>>>>>> --- a/hw/xilinx.h
>>>>>> +++ b/hw/xilinx.h
>>>>>> @@ -75,7 +75,7 @@ xilinx_axiethernetdma_create(void *dmach,
>>>>>> {
>>>>>>     DeviceState *dev = NULL;
>>>>>>
>>>>>> -    dev = qdev_create(NULL, "xilinx,axidma");
>>>>>> +    dev = qdev_create(NULL, "xlnx.axi-dma");
>>>
>>> comma -> dot
>>>
>>>>>>     qdev_prop_set_uint32(dev, "freqhz", freqhz);
>>>>>>     qdev_prop_set_ptr(dev, "dmach", dmach);
>>>>>>     qdev_init_nofail(dev);
>>>>>> diff --git a/hw/xilinx_axidma.c b/hw/xilinx_axidma.c
>>>>>> index 59373b5..f4bec37 100644
>>>>>> --- a/hw/xilinx_axidma.c
>>>>>> +++ b/hw/xilinx_axidma.c
>>>>>> @@ -473,7 +473,7 @@ static int xilinx_axidma_init(SysBusDevice *dev)
>>>>>>     xlx_dma_connect_dma(s->dmach, s, axidma_push);
>>>>>>
>>>>>>     memory_region_init_io(&s->iomem, &axidma_ops, s,
>>>>>> -                          "axidma", R_MAX * 4 * 2);
>>>>>> +                          "xlnx.axi-dma", R_MAX * 4 * 2);
>>>>>>     sysbus_init_mmio(dev, &s->iomem);
>>>>>>
>>>>>>     for (i = 0; i < 2; i++) {
>>>>>> @@ -502,7 +502,7 @@ static void axidma_class_init(ObjectClass *klass, void *data)
>>>>>> }
>>>>>>
>>>>>> static TypeInfo axidma_info = {
>>>>>> -    .name          = "xilinx,axidma",
>>>>>> +    .name          = "xlnx.axi-dma",
>>>
>>> comma -> dot
>>>
>>
>> The -device command line arg. E.G. qemu-system-microblaze -device
>> xilinx.axidma,foo=bar, ...
>>
>> If I have ,'s in the device name i need to escape them as they are
>> syntax in -device.
>
> QOM is perfectly capable of handling commas and SPARC uses "SUNW,", too.
> Using QMP in the future (Markus' RFC) should not be a problem either.
>
> Do you really need to construct board-level devices using -device?
>
> Maybe you have a suggestion to fix the syntax escaping issue for
> Anthony's suggested -object? Because a comma is rather common in OF/FDT.

Yeh, our names are OF/FDT based, which is where the commas come from.
I got rid of the comma though as something of a take the most
defensive approach and handle the rest in external tools.

>
> Adjusting device names to match what your Xilinx tool set uses sounds
> very reasonable. But translating from "," to "." in two places does not
> sound superior to translating from "," to ",," in one place to me? Maybe
> I'm misunderstanding something? It might help to introduce QOM-style
> TYPE_ constants, then the name is in a single location only.

So does escaping ","s with -device work today?

Regards,
Peter

>
> Cheers,
> Andreas
>
P.S. Egdar and Me are on opposite sides of the world (Sweden and Australia).

> --
> SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
> GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Andreas Färber June 29, 2012, 3:21 p.m. UTC | #9
Am 29.06.2012 02:34, schrieb Peter Crosthwaite:
> On Thu, Jun 28, 2012 at 11:05 PM, Andreas Färber <afaerber@suse.de> wrote:
>> Am 28.06.2012 03:08, schrieb Peter Crosthwaite:
>>> On Thu, Jun 28, 2012 at 9:06 AM, Alexander Graf <agraf@suse.de> wrote:
>>>>
>> [...]
>>>> [...] Why did commas in names work before, but now don't? Or put differently: Was this change on purpose?
>> [...]
>>> The -device command line arg. E.G. qemu-system-microblaze -device
>>> xilinx.axidma,foo=bar, ...
>>>
>>> If I have ,'s in the device name i need to escape them as they are
>>> syntax in -device.
>>
>> QOM is perfectly capable of handling commas and SPARC uses "SUNW,", too.
>> Using QMP in the future (Markus' RFC) should not be a problem either.
>>
>> Do you really need to construct board-level devices using -device?
>>
>> Maybe you have a suggestion to fix the syntax escaping issue for
>> Anthony's suggested -object? Because a comma is rather common in OF/FDT.
> 
> Yeh, our names are OF/FDT based, which is where the commas come from.
> I got rid of the comma though as something of a take the most
> defensive approach and handle the rest in external tools.
> 
>>
>> Adjusting device names to match what your Xilinx tool set uses sounds
>> very reasonable. But translating from "," to "." in two places does not
>> sound superior to translating from "," to ",," in one place to me? Maybe
>> I'm misunderstanding something? It might help to introduce QOM-style
>> TYPE_ constants, then the name is in a single location only.
> 
> So does escaping ","s with -device work today?

I never needed it myself but I remember reading that for file names ",,"
(double comma) escaping was introduced. I would assume that to be
implemented at QemuOpts level so that it should work for random
parameters, and after all the device name is translated to a regular
driver= parameter, too. If that doesn't work I would consider it a bug.

Cheers,
Andreas
diff mbox

Patch

diff --git a/hw/xilinx.h b/hw/xilinx.h
index 8f915b4..7df21eb 100644
--- a/hw/xilinx.h
+++ b/hw/xilinx.h
@@ -75,7 +75,7 @@  xilinx_axiethernetdma_create(void *dmach,
 {
     DeviceState *dev = NULL;
 
-    dev = qdev_create(NULL, "xilinx,axidma");
+    dev = qdev_create(NULL, "xlnx.axi-dma");
     qdev_prop_set_uint32(dev, "freqhz", freqhz);
     qdev_prop_set_ptr(dev, "dmach", dmach);
     qdev_init_nofail(dev);
diff --git a/hw/xilinx_axidma.c b/hw/xilinx_axidma.c
index 59373b5..f4bec37 100644
--- a/hw/xilinx_axidma.c
+++ b/hw/xilinx_axidma.c
@@ -473,7 +473,7 @@  static int xilinx_axidma_init(SysBusDevice *dev)
     xlx_dma_connect_dma(s->dmach, s, axidma_push);
 
     memory_region_init_io(&s->iomem, &axidma_ops, s,
-                          "axidma", R_MAX * 4 * 2);
+                          "xlnx.axi-dma", R_MAX * 4 * 2);
     sysbus_init_mmio(dev, &s->iomem);
 
     for (i = 0; i < 2; i++) {
@@ -502,7 +502,7 @@  static void axidma_class_init(ObjectClass *klass, void *data)
 }
 
 static TypeInfo axidma_info = {
-    .name          = "xilinx,axidma",
+    .name          = "xlnx.axi-dma",
     .parent        = TYPE_SYS_BUS_DEVICE,
     .instance_size = sizeof(struct XilinxAXIDMA),
     .class_init    = axidma_class_init,